{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

11
votes
1answer
492 views

Why does pgfplots package cause tikz layer to disappear?

I wish to include a pgf-generated line plot and a tikz-generated graphical model in the same document. However, the presence of the pgfplots package (needed for the axis environment) seems to turn one ...
11
votes
3answers
2k views

PGFPlot - Missing values in table data

I am using PGFPlot with external table data. However, some values are missing for some plots. This causes data in column 2 does not exists error. Is there a way to solve this. The value does not ...
11
votes
3answers
4k views

Using LaTeX to draw time series graphs and histograms

I have some graphs I drew in maple, some simple line plots and histograms. Now I'd like to redraw these graphs in LaTeX, so I can do fancy stuff in beamer like have one histogram appear, and then ...
10
votes
2answers
1k views

“pgf Error: No shape named i-0 is known”, but only upon 2nd run

Update 2012-01-31: This seems to be a version (and/or OS specific) problem. It breaks on my latest TeXLive2011 on a Mac, but I can get it to run on my PC version of MiKTeX 2.8, and @MarcvanDongen ...
9
votes
2answers
175 views

pgfplots function x^(0.5) skipping first sample, sqrt is not

In the following example, you will see that the sample at (0,0) is not drawn using x^(0.5) (blue), with sqrt it is (green). How can you explain that? \documentclass{standalone} \usepackage{pgfplots} ...
9
votes
2answers
264 views

Adding to a \foreach variable in pgfplots

How can I say sum multiple columns of a table using y expr while also using \foreach I was hoping something like this would work but apparently it requires some sort of expression evaluation I can't ...
9
votes
1answer
564 views

Modified pattern does not see the pattern color option

I have modified the north east lines pattern to accept a \LineSpace option that sets the density of the pattern (see the question Can I control the density of a pattern in TikZ?). The code works very ...
9
votes
1answer
693 views

How can I add space between two separate plots, using pgfplots?

I currently have the following: Now as you can probably imagine I do not want this. I want the upper right plot to be aligned with the lower right plot. However when I do this, using the at and ...
9
votes
1answer
434 views

Is there a workaround against loss of precision in pgfplots axis?

I am generating a bunch of plots automatically using pgfplots. For some datasets the span of data in one axis (y) is relatively small (relative to the absolute value) and therefore pgfplots when ...
8
votes
1answer
498 views

Polar Plot x and y ticks and units

I'm having some trouble with polar plots. I generate the plot coordinates using Scilab and then plot them in Latex. I can't figure out how to remove the points (mark = \empty does nothing, but ...
8
votes
1answer
1k views

Different color for individual bar in bar chart & adding bar labels

Please consider the following MWE. There are three things I would like to do: Individual colouring For the last element ("not rejected") I would like to fill the bar with another color (e.g. ...
8
votes
2answers
1k views

pgfplots: post-processing data created with gnuplot

I have managed to use pgfplots' gnuplot option to solve an implicit equation: \documentclass{standalone} \usepackage{tikz,pgfplots} \begin{document} \begin{tikzpicture} \begin{loglogaxis}[ ...
8
votes
1answer
2k views

Using ifthenelse in pgfmath

Following questions on constructing functions on the forum, I tried to build some myself. I can't seem to get the ifthenelse function in TikZ/PGF to work. Here is an example: ...
7
votes
1answer
619 views

Why does pgfplots plot functions only until x = 5 and y = 5?

Why does pgfplots plot functions only until x = 5 and y = 5, but not any further? \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} %%%< \usepackage[active,tightpage]{preview} ...
7
votes
1answer
643 views

weibull plot with arbitrary y axis scale

I want to draw a function in a weibull plot. The x axis is log, the y axis however goes with log(-log(1-y)) (as far as I understood it from this site). The y axis looks similar to a log scale but ...
7
votes
1answer
2k views

tikz spy library with pgfplots: opacity and grid

When I use the tikz.spy library in order to magnify a part of my pgfplots plot with the use of grids, there are both the original grid and the magnified grid in the magnified area. screenshot: . a ...
6
votes
1answer
282 views

scaling multi column groupplot while maintaining font size and node placement

This is a follow-up to two previous questions: 1: font size scaling and node placement issues using pgfplots and tikzscale 2: Scaling a multi-column TikZ/pgfplots groupplot to page width I would ...
6
votes
1answer
775 views

How to expand linear regression fit to the full x-axis range while using semilogyaxis

Since I was asked in another post: Trend line or line of best fit in pgfplots to ask this question explicitly, I'm now doing so: How can I expand the linear regression fit, generated with for ...
6
votes
1answer
3k views

3D surface plots in TikZ

I need to plot a surface plot using TikZ. I have the (x,y) coordinate and the corresponding function value in a table form. I have not done 3D plots before in TikZ and hence I would appreciate any ...
6
votes
1answer
869 views

How to make a pgfplots stacked xbar plot with bar-“explicit meta” labels computed from input table data

I am making a pgfplots stacked xbar plot where each bar has a distinct label, in addition to a numeric bar length. Each pair of bars also has a common label. I would like to mark each bar with its ...
5
votes
1answer
444 views

How to draw density estimate on histogram by pgfplots?

I know how to draw a density histogram using pgfplots from this answer: Is it possible to "transform" a histogram into a density plot in pgfplots?. But how can I draw an estimate line on ...
5
votes
1answer
191 views

Draw group line error

How draw group line works? I tryed to use this example, but when chaged the index it gives me an error: Undefined control sequence \end{axis} CODE: \documentclass[conference]{IEEEtran} ...
5
votes
1answer
199 views

Automatically choosing preset color schemes in pgfplots based on number of entries

This is really more of a question to satisfy personal curiosity than to solve a real problem. When choosing the colour schemes for my plots, I try to select colours that will work well with the ...
5
votes
1answer
809 views

Is there any way to remove mesh lines completely in a pgfplots faceted 3d plot?

I can not seem to find the way to remove the lines in the surface mesh in a 3d faceted plot. I need a solution that does not use the "shader=interp" (i.e. gradient filling) so that the faces are ...
4
votes
1answer
86 views

Positioning of decorations on parallel lines

I'm displayed three lines on a pgfplot. I want to show a marker for the slope of each line and the difference in height between lines. I'm showing the slopes by adding triangles under the lines ...
4
votes
1answer
184 views

How to skip ticks in pgfplots plot?

I have frequently the problem that too many data points are available for the x axis, I want to show them all in the actual plot, but I would like to show only a subset of the ticks. For instance, if ...
4
votes
0answers
97 views

Axis labels according to DIN461 [closed]

DIN461 requires to put the unit of the axis between the last two ticks of an axis, see http://de.wikipedia.org/wiki/DIN_461 (sorry only in german, but the lower two images make it clear, I think) Is ...
4
votes
2answers
412 views

Why do I fail to import external 3D plots with pgfplots?

I have tried to import external 3D plots from Matlab et.al, but to no avail. To show what I managed to accomplish, I present a minimum non-working example below. Any ideas of what I'm doing wrong? ...
4
votes
1answer
2k views

Plot and label data from file with PGFPlots

Given some data from a file, I would like to use the first two columns as coordinates, and the second two columns as label for every point. The data is given in this form: x y ...
4
votes
2answers
2k views

How to make an xbar plot, with pgfplots, having different y tick labels on the left and right side y axis?

I am making an xbar plot with pgfplots. I want this plot to show the results from a test, where people in different age classes are given scores. For each of these age classes a single person is the ...
2
votes
1answer
116 views

How to plot stacked bar plot inside table?

I have following code in Latex. Which plots only one data series (data2). I would like to plot staked bar plot inside table for both data1 and data2 with different colours. Any ideas.? Many thanks. ...
2
votes
1answer
348 views

A simple (indented) integration contour with Tikz

I would like to draw an integration contour which is pretty easy I think, but I am a newbie at the Tikz package. The integration contour goes from -i*infinity to +i*infinity parallel to the ...
11
votes
1answer
337 views

Place point on helix

Pasted below is a helix created with PGFPlots package and now I need to add points to a helix. What I was able to get so far is pasted below. I also included a figure depicting desired output I ...
10
votes
1answer
157 views

Adding a “passive” plot in pgfplots

I would like to add a plot to a pgfplots figure, but such that it doesn't change the automatically computed limits. for example: \documentclass{article} \usepackage{tikz,pgfplots} \begin{document} ...
9
votes
1answer
414 views

Recreate plot when data file changes

Is it possible to use the TikZ/external library and have pgfplots recreate a figure when a data file that is plotted changes? Say I have something like the following: file.tex: ...
8
votes
1answer
506 views

dashed line in pgfplots legend results in incomplete marks

When defining the pgfplots legend entries myself, I have a problem when using dashed lines in combination with marks. The mark is also dashed (or dotted, etc.), just as the accompanying line is. Is ...
8
votes
1answer
543 views

Problem: tikz, pgfplots and external coordinates using overlay

I need to draw arrows from text to a pgfplots graph using TikZ. For some reason, the arrow coordinates are not where I want them to be in the pgfplots graph. Here is an example: ...
8
votes
1answer
422 views

Single double-logarithmic axis

I'm trying to make a plot which has a double logarithmic y-axis. Is this possible? This should change the distance of each logarithmic increment, for I want to plot so called Bit-error rates. To have ...
7
votes
2answers
85 views

Using LaTeX commands inside pgfplotsset

Is there any way to use LaTeX commands inside \pgfplotsset? For instance, the following code produces an error indicated in the \pgfplotsset line, whereas if one replaced \contents in the ...
7
votes
1answer
822 views

Compiling CircuiTikZ with -shell-escape (pdflatex)

I'm trying to use both CircuiTikZ and pgfplots. In order not to overflow LaTeX memory, I use the TikZ externalize library with -shell-escape command in pdfLaTeX. It compiles the pgfplots nicely, but ...
7
votes
1answer
268 views

PGFPlots: synchronize the filling of the bars with the colorbar

How i can synchronize the filling of the bars with the color of the color bar to the right? they are a little shifted... \documentclass[border=0.5mm,12pt]{standalone} ...
7
votes
1answer
2k views

Zero space between bars in pgfplots bar graph

I want to draw a bar graph with the bars touching, like in a histogram, using pgfplots. This is basically what I'm aiming for: That plot is generated with this code: \documentclass{article} ...
7
votes
2answers
609 views

How to maintain the ratio between two axis in pgfplots

I have two axis environments both containing different plots. I do however want to maintain comparability between both, i.e. I want both plots to consume the same space on the paper for a coordinate ...
6
votes
1answer
644 views

Tikz Stacked Bar Chart with Text

I have the following stacked bar chart and want to put some text behind each bar element and some text into each of the colored areas. Do you have some ideas, how I could achieve that? The ...
6
votes
1answer
2k views

change color of pgfplot bar plot

I want to plot two bar plots next to each other. This works without a problem. However both use the first color defined in a pre or selfdefined colorseries. I tried to modify the color manually in the ...
6
votes
1answer
939 views

2D colors above 3D surface plot

I would like to draw a 2D, colored plot of a function above its surface plot. I tried copying the surface plot and setting z filter/.code={\def\pgfmathresult{1.4}}, but then everything is the same ...
6
votes
2answers
1k views

Force “axis on top” for plotmarks in pgfplots

The pgfplots manual says that axis on top=true won't affect the plot if using plotmarks as this usually doesn't make sense, which I agree with. However, in this case I'd prefer both the axis and tick ...
6
votes
1answer
953 views

import input pgfplots with relative paths

The package import makes it posible to \input (and \include) a .tex document which itself \input (or \includegraphics etc.) stuff using relative paths. I was hoping that this also would work with the ...
5
votes
1answer
289 views

How to move axis multiplier in a polar plot in pgfplot

How can I move the axis multiplier in a polar plot? In the following MWE, the axis multiplier is over the ticks and prevent the plot to be nice and readable. ...
5
votes
1answer
548 views

tikz/pgfplot unstacked ybar with “switched” overlay

So, i'm trying to make a nice ybar plot using pgfplot, but i have some issues i want to solve, hope you can help me. 1) the ybar are not centered on the x value as they should, i mean, the bar for x ...