{pgfplots} is a package for creating 2D and 3D plots of mathematical functions and numerical data, using the PGF graphics framework. For questions about the inbuilt plotting functionality of TikZ/PGF, use {tikz-pgf} instead.

learn more… | top users | synonyms

6
votes
1answer
44 views

Plotting multiple lines with a colormap in pgfplots

I have a similar question to Steve Hatcher from this thread: Spectrum colormap for multiple curves I have a data file (mwe_data.txt) which contains multiple columns. The first column is the x-axis, ...
3
votes
1answer
146 views

Very fancy bar chart

Just wonder if this could be done with tikz? I know I should provide at least a MWE, but I am new to latex and have absolutely no idea where to start. MWE (Addition by HK) ...
2
votes
0answers
16 views

Changing max/min a function will be plotted with pgfplot [duplicate]

I was hoping someone could shed some light on this issue: When I plot a function using something like \addplot+[mark=none,smooth,] (\x,{2 * \x^2 + 4 * \x + 1}); the line of the function does not ...
2
votes
1answer
28 views

TikZ with multi colum datas

I have a data file containing 3 columns, X, Y and Z. X Y Z # datas from the natural movement of a robot 0.0000000e+00 3.3891017e-01 -1.3249598e-01 ...
7
votes
1answer
167 views
+250

How to fix this interaction bug between pgfplots and babel-french module?

Here is an example of a minimum non-working case which is generating the bug: \documentclass{standalone} \usepackage{luatextra} \usepackage[frenchb]{babel} \usepackage{pgfplots} \begin{document} ...
2
votes
1answer
42 views

Not distinct x values and different domain in one graph

I want to plot data like this \pgfplotstableread{ x y 5 10 6 12 6 12 7 11 }\dataA \pgfplotstableread{ x y 5 8 5 15 6 10 7 13 8 14 ...
2
votes
1answer
68 views
+50

pgfplots - How can I change an option (e.g. xlabel) for all subsequent groupplots?

If xlabel or ylabel are defined in the groupplots options, the values are used for all subsequent plots. Same with other options. Can one change the xlabel for all following groupplots from one point ...
2
votes
1answer
41 views

axis alignment for 3D graph using matlab2tikz

I am trying to include multiple 3D figures (created in matlab) into a latex file. The original 3D figures in matlab look like this: In the .m file that creates these figures, I use ...
1
vote
1answer
125 views

Miktex 2.9 pgfplots, circuitikz library collision problem

In my book, I use both libraries. After Miktex update yesterday evening (circuitikz ver 0.3 pgfplots 1.11), I have problem with compiling following code: \documentclass{article} \usepackage{tikz} ...
0
votes
2answers
59 views

Scale Y and X axis in pgfplots

I made the following plot, and the numbers are print to close together. How can I scale the the y and x axis? \begin{tikzpicture} \begin{axis}[ axis y line=center, axis x line=middle, axis equal, ...
8
votes
2answers
416 views

Plotting 1/(x^2) - graph looks weird near x = 0

I'm a beginner to LaTeX, so the amount of variables I can change to modify a graph/plot get confusing. I found similar questions on the site, however all of them propose different solutions with ...
3
votes
1answer
65 views

Clipping plots to other plots in pgfplots

I'm plotting a convex frame as shown below, with the given MWE. Inside this frame, the idea is to plot additional functions to create an image. In order to avoid manually computing the domain ...
1
vote
1answer
48 views

How to put a table next to a plot?

I made a plot and a table, and I want to put the table next to the plot, how can I do that? \begin{tikzpicture} \begin{axis}[ axis y line=center, axis x line=middle, axis equal, grid=both, ...
0
votes
1answer
23 views

how to make a plot with consecutive numbers in x and y axis?

I made this plot but I want consecutive numbers from 1 to 10 in the labels for the x and y axis. The current plot shows 0 then jumps to 5 and 10. \tikzpicture \begin{axis}[ axis y line=center, axis ...
5
votes
1answer
67 views

pgfplots: horizontal distance between two plots

I'm trying to plot the following graph using pgfplots: This plot was generated with matlab. I can easily plot the two curves with pgfplots but I have no clue how to add the vertical line with the ...
12
votes
1answer
202 views

Drawing a semicircle in 3D with pgfplots

I'm trying to make a plot of a torus with a semicircle drawn on its surface. The following MWE \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} ...
2
votes
0answers
64 views

Is there a reliable way to define the scale label's position in a groupplot in relation to the respective label?

I was asked to try and put the scale labels for the yticks not right above the north west corner of the plot as it is rather unusual. Personally, I tend to agree. It works easily but above left might ...
4
votes
2answers
77 views

pgfplots - How can I print the y tick scale label only once in a groupplot?

I'd like to have the tick label for the y-axis only printed once in a groupplot. This would be very useful for the case when one uses the following options: ylabels at=edge left, yticklabels at=edge ...
3
votes
1answer
49 views

Conditionally use bold font for table cell with pgfplotstable

I am trying to conditionally use bold font for table cells with values according to a condition. It works nicely with changing the text color as illustrated in the example below, but I am not able to ...
0
votes
0answers
64 views

How can I plot Binomial and Poisson Cumulated Distribution Functions?

I know that \begin{tikzpicture}[ declare function={binom(\k,\n,\p)=\n!/(\k!*(\n-\k)!)*\p^\k*(1-\p)^(\n-\k);} ] serves to declare the p.m.f. for the binomial distribution with TikZ, and that ...
2
votes
1answer
61 views

Shaded area in graph behind axes and plot, plot in front of axes

I want part of the graph shaded. The problem is of course that shade is above axis and grid, like in MWE below. Of course, I also tried axis on top option, but the problem is that in this case plot ...
2
votes
0answers
62 views

Insert pgf with referenced png file from a different folder

I'm trying to insert a pgf file that I made with matplotlib. This file references to a png file (since I inserted a png figure in the plot). When I put the png in the same folder than my tex file, ...
2
votes
2answers
126 views

octopus-graph tikz/pgfplots

EDIT:I found a solution. See below. i'm trying to get something like this: I have small dots and big dots, and some small dots are connected to one big dot. I can "plot" all points with pgfplots: ...
1
vote
1answer
136 views

PGF stacked bar graph not drawn correctly

I am having problem with the following code which is supposed to produce a simple stacked graph. \documentclass[tikz,border=2pt]{standalone} \usepackage{pgfplots} \usepackage{tikz} \begin{document} ...
2
votes
1answer
54 views

Contour plot using pgfplots where some data entries are NaN

I would like to make a contour plot of data that has been saved in a text file that consists of three columns where the columns are x_i, y_i and z_i and some elements z_i are NaN. I use MikTex 2.9 ...
8
votes
4answers
292 views

How to Draw This Free Body Diagram on TikZ or PGFPlots

This is not a duplicate question of the one titled Creating a Free Body Diagram in TikZ. I am confused as to how one might draw this specific diagram: Say we want to describe two masses on a pulley ...
6
votes
0answers
44 views

What is this glitch in pgfplots? Plot seems cropped [duplicate]

I have this plot generated following the answers proposed here. \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \pgfkeys{/pgfplots/x axis shift ...
3
votes
0answers
74 views

pgfplots groupplot: fillbetween breaks alignment of plots

I recently (foolishly) updated all my TeXlive packages, including pgfplots (from 1.10 to 1.11). I now have an issue with the groupplots and fillbetween libraries, where using the fillbetween library ...
2
votes
1answer
54 views

Is it possible to assign to two extra x-tick labels different colors?

I think the question says it all. I'd like to have two extra x tick labels with different colors. I thought of using a cycle command, but I couldn't figure out how it should work. I changed the color ...
2
votes
1answer
67 views

Modifying some features on the graphs of a function and its inverse

The following code is compiled by pgfplots to graph an exponential function and its inverse. I have some questions about the code, and I would like to modify some of the features of the graphs. How ...
4
votes
1answer
104 views

Why is July Printed Twice on X-Axis?

\documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \usepgfplotslibrary{dateplot} \pgfplotsset{compat=1.11} \begin{document} \begin{tikzpicture} \begin{axis}[ date coordinates in=x, ...
5
votes
1answer
79 views

How can I add open and closed circles on either side of a jump discontinuity?

How to indicate "including" and "excluding" dots on the graph? \documentclass[paper=a4, fontsize=11pt]{scrartcl} \usepackage{pgfplots, pgfplotstable} \usepackage{tikz} \begin{document} ...
2
votes
2answers
87 views

Plotting standard error

I am trying to create a chart with the std error but I can't seem to get it to work the way I want it to. I want to get rid of the line between every entry. This is what I have right now: ...
1
vote
0answers
49 views

Unequal bin widths in pgfplots density histogram

In the pgfplots manual, it talks about density histograms with equal bin widths/ranges. Is it possible to make a density histogram with specified unequal bin widths/ranges? For example, if I set ...
4
votes
1answer
46 views

Hide y labels in pgfplots, and make coordinates fit inside of the pdfplot box

I want to compare time spent on different simulation with bars from a pgfplot that show my simulation time. Here is the code: \begin{figure}[htbp] \centering \begin{tikzpicture} ...
6
votes
1answer
74 views

3D surface plot with axis inside plot

I try to draw the energy surface of a magnetic particle. For this i want the axis system to come from the inside of the particles pointing to the ouside. Ist ist basically the example below, but with ...
4
votes
2answers
71 views

pgfplots axis abbreviation

Suppose I have a pgfplot with the following axis text: |-----|-----|-----|------| 0 500 1000 1500 2000 Is there a way to change axis text to: |-----|-----|-----|------| 0 0.5K 1K 1.5K ...
6
votes
1answer
99 views

Plotting one x- vs multiple y- using custom color map

I am trying to plot data that comes in the form of one x-axis vs multiple y-axis on the same plot. I would like the color of each line to spread itself out through my desired color map (spectrum ...
4
votes
1answer
68 views

pgfplots interpolation

Whats the best way of interpolating a graph and show the interpolation like this (using pgfplots): I have the following code for my plot in an axis environment: ...
3
votes
1answer
78 views

pgfplots generating incorrect boxplots

While trying to reproduce some boxplots using pgfplots (and analyzing samples automatically), I noticed that in some cases I was getting different plots from Matlab. I have left all the settings in ...
2
votes
1answer
51 views

Scatter plot with a grid and axis lines going through the origin

I want to make a scatter plot with error bars (using pgfplots or tikz) with two characteristics; I need the two axes to meet at (0,0), and a grid in the background. I tried to google this a number of ...
1
vote
1answer
49 views

pgfplots - How can I address the coordinates of a plot's title in a groupplot?

Say I provide a title to a groupplot via title={Word} Is there a way to address the area of this node, e.g. via .north west and so on (as detailed on page 314 in the manual)?
4
votes
1answer
61 views

Expressing a y-only shift with `axis direction cs` with symbolic x coords

I have a vertical bar chart with error bars. I want to put a star just above or below the error bar where the results are significant. I achieved this using the very neat trick provided in this ...
1
vote
1answer
92 views

how to change color at line chart?

I have the following code. \begin{figure}[p] \centering \begin{tikzpicture} \begin{axis}[ use units, width=15cm, height=8cm, % size of the image grid = major, ...
3
votes
1answer
37 views

Missing something obvious with tick label styles in pgfplots [duplicate]

Why does this not produce y tick labels in fixed number format? (pgfplots version 1.9 produces y tick labels in scientific format) \documentclass[12pt]{article} \usepackage{pgfplots} ...
2
votes
4answers
210 views

Plotting several functions with TikZ/pgf

How do I plot several functions in Latex with tikz? I want it to look something like this: With the this code: \documentclass{article} \usepackage[latin1]{inputenc} \usepackage{tikz} % GNUPLOT ...
3
votes
3answers
879 views

How should I start with this image?

I have an old image with ppt style and I would like to customise it a bit. Main problem is I'm a beginner in Tikz/PGF and i really don't know where to start and which environments I should use. If ...
2
votes
0answers
68 views

Contour plot of data, where the data is of the form x_i, y_i, f(x_i,y_i)

I would like to plot the following data in a contour plot using pgfplots: data.txt. The data is of the form x_i, y_i, f(x_i,y_i) and contains NaN values. I am able to plot this exact data in a surface ...
3
votes
0answers
50 views

Reduce number of input files for group plot in pgfplots [duplicate]

In the pgfplots groupplot below, I have three sets of data represented by data1, data2 and data3. Each of the data have three subtypes. And I need to plot a graph for each of the subtype. The file ...
1
vote
3answers
260 views

How to create a 32 by 32 grid?

I want to create a 32 by 32 grid as shown below. And I also want to add two labeling in x and y directions. 1) 0 - 31 (grid number) 2) 0- 1 (box unit) I a next slide I have to draw a new box ...