{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

4
votes
1answer
2k views

How can i create bar plot groups of different sizes in pgfplots?

One can easily create "groups" of bar plots using the ybar/xbar attribute for the axis environment. When multiple \addplot commands are issued using the same x/y coordinate, the entire group of bar ...
3
votes
2answers
1k views

pgfplots function which touches the edges of the plot

I need to plot the constant y = pi function with the plot touching both sides of the plot. I have had a search through the pgfplots manual without much luck. I have tried \addplot{3.141...} which ...
4
votes
4answers
1k views

Pgfplots: Assemble dates from different columns

I am trying to plot a datafile of a time series in pgfplots. The date is not in the YYYY-MM-DD hh:mm format required by the PGF calendar library (see p. 210 in the pgfplots manual), but in different ...
10
votes
1answer
3k views

PGFPlots how can I hide extra y tick marks?

simple question (I hope) Using pgfplots 1.5.1, miktex 2.9 on Windows 7 32 bits. I'd like to hide the tick marks at the right and top side of the plot, but without losing the lines (e.g. keep the ...
5
votes
1answer
1k views

How to enforce printing the decimal part in pgfmath macros?

I have the opposite problem to this question. I want the decimal parts of an integer printed for consistency's sake. I already tried specifying the precision but without success. See below. ...
13
votes
2answers
4k views

Reversing direction of x axis in pgfplots

I want to reverse to direction of the x axis in one of my plots. pgfplots offers the x dir=reverse key for this. However, this does not work as expected - not even in this example: ...
10
votes
2answers
2k 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 ...
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
0answers
55 views

custom function in pgf doesn't behave consistently [duplicate]

Possible Duplicate: Is plotting exponential graphs a known source of bugs in TikZ? I want to use a custom function in pgf plots and in text, like in this example: ...
2
votes
1answer
596 views

How to order barplots in aligned rows and columns?

I am making xbar plots with pgfplots. Within different age groups ("Agen interval") of men a single winner is choosen (Winner), based on some test, and on this winner two different variables are ...
1
vote
0answers
646 views

Reproducing a 3dplot example from texample.net using pgfplots: drawing angles with pgfplots in 3d [closed]

I am trying to reproduce the 3dplots example from www.texample.net using pgfplots: So far, I did not come far at all, actually. One problem is that pgfplots does not allow to work in spherical ...
14
votes
1answer
11k views

pgfplots: Legends in multiple y-axis plot overlapping

I am trying to add a legend for two plots on two different y-axes, however they are overlapping each other and each one is being written in its own box. I would like for both of them to share a single ...
12
votes
1answer
3k views

plot within a plot: zoom into a plot so that the magnified part is framed by axis with ticks and tick labels

I want to zoom into a plot much like it is possible by using the spy library but I want the spy-in node to contain its own ticks and tick labels with a finer grid than the original plot. To clarify ...
5
votes
2answers
776 views

pgfplots: stacking plots in positive and negative y direction in the same diagram

I have several data files which I want to plot in the following manner: I achieved this with the following code: \documentclass{minimal} \usepackage{pgfplots,filecontents} ...
5
votes
1answer
3k views

Change pin node style in pgfplots

With pgfplot, how can I change the style of a "pin node" to have a thicker line? I saw posts here how to change the "text label" part of the pin node.. but not this little line beneath it.
6
votes
1answer
679 views

3 dimension plots with larger z axis and all the values show up on ticks

I am trying to build a 3 dimension graph using the following code. \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{figure} [H] \centering \pgfplotsset{compat=newest} ...
10
votes
1answer
1k views

pgfplots: How to ignore the last line of a data file?

I need to plot data files which contain a comment in the last line, like this: 0 2 4 1 5 7 2 9 5 3 11 15 4 10 15 THIS WAS: TOTAL Now, pgfplots seems to have a problem with that giving me ...
6
votes
1answer
723 views

Locking the color (z) scale for multiple scatter plots

I am trying to show multiple scatter plots on one frame using Beamer's overlays and the \only command; see previous stackexchange question and answer. I wish to show the third (z) axis using a color ...
9
votes
1answer
2k views

Draw in pgfplot axis before axis and grid are drawn

Is there a way to draw something using the axis coordinates (axis cs:x,y) before the axis and the grid are drawn? Namely I would like to draw rectangles with tikz to give different areas of the plot ...
7
votes
1answer
755 views

Simplest example from pfgplots documentation not working

I get a lot of errors when I try to compile even the simplest examples with pgfplots. The following is taken from the documentation of the package: \documentclass{article} \usepackage{pgfplots} ...
10
votes
2answers
691 views

LuaLaTeX:PGFplots can't read data passed by Lua

I wanted to give a LuaLaTeX answer to this question Here it is the listing I wrote: % !TEX encoding = UTF-8 % !TEX program = LuaLaTeX % !TEX spellcheck = en_GB \documentclass{standalone} ...
4
votes
0answers
360 views

Artefacts in 3D-Plots when z-values exceed z-axis limits? [closed]

When plotting an expression using pgfplots, there are strange artefacts in places where the z-values are too big for the current axis. How do I fix it? Is there an equivalent to y domain for the ...
8
votes
1answer
3k views

How can I use two x axes in pgfplots?

I would like to draw two x axes with ticks and legends in the bottom and top axes where one axis is a linear transformation of the other for the same y range. There is a similar application described ...
10
votes
1answer
3k views

pgfplots: Add/subtract whole columns of data files with one another?

I want to analyze data files with the following format 0.01 1.00 11.00 21.00 0.02 2.00 12.00 22.00 0.03 3.00 13.00 23.00 0.04 4.00 14.00 24.00 0.05 5.00 ...
1
vote
0answers
200 views

Pgfplots: How to get the data to be shown by hours instead of days? [duplicate]

Possible Duplicate: pgfplot: Datafile format for datetime field The solution to the following problem is probably very straightforward, but I've yet to find the right solution. I'm trying ...
10
votes
2answers
2k views

pgf(plots) node shadow/opaque pin

Is it possible to place a shadow/fill/opaque setting on text of a node pin? I know I can do that with the actual node, but I am using \node in pgfplots to mark some stuff on graphs, and it would be ...
7
votes
1answer
496 views

Use tikz macros in pgfplots?

Since the axis environment is within a tikzpicture I thought that you could use the usual \draw commands within the axis environment. I am confused as to why the code below produces the red line ...
8
votes
2answers
3k views

domain option for pgfplot's \addplot ignored?

I want to do a simple plot of goniometric functions with pgf in a beamer presentation: \usepackage{tikz,pgfplots} % ... \begin{tikzpicture} \begin{axis}\addplot[domain=0:pi]{sin(deg(x))}; ...
5
votes
1answer
685 views

pgfplots: Using a column header as the plot title [duplicate]

Possible Duplicate: Use first row of a table as legend entry in pgfplot graph ? I am creating a number of very similar plots using pgfplots. The raw data for these is provided in a single ...
5
votes
1answer
484 views

pgfplot will not plot past a x value, plot is cut off

I tried plotting the following functions; however, they are cut off at x=[-5,5] and I cannot figure out why. Any help would greatly be appreciated. \documentclass{article} \usepackage{pgfplots} ...
10
votes
1answer
11k views

pgfplots axis scaling

Is it possible to define in pgfplots that y should correspond to Y cm in my plot? I know how to do this in tkz-fct, so let me add an tkz-fct example to make more clear what I want: ...
7
votes
2answers
452 views

Comparison of pgf plotting packages

I know three ways to do function plots based on the TikZ/pgf package: TikZ/pgf directly pgfplots tkz-fct Which of those options is the most powerful? Why? Can you give typical cases where one ...
11
votes
1answer
3k views

Scaling colormaps with pgfplots

I have two surface plots, which I would like to have to same color for the same height. So, as the first plot is dark blue for f(x,y)=0, the right plot should also be dark blue for f(x,y)=0. However, ...
37
votes
2answers
12k views

Label plots in pgfplots without entering coordinates manually

I like to label my plots directly, i.e. without using a legend, but instead using a pin node. So far, I have added the labels with manually specified coordinates, which means trial-and-error for data ...
6
votes
1answer
944 views

Consistent Pgfplot Labels Positions with/without Gnuplot

I like that I can place a node at the end of plot and the node appears relative to the last point on the graph. When the domain is specified in increasing order \DomainMin:\DomainMax, the label gets ...
3
votes
1answer
855 views

pgfplots: shadow for markers

I was wondering if it's possible to add shadows to markers within pgfplots. I tried the circular drop shadow option (from TikZ) which unfortunately had no effect at all. I also read that one can ...
8
votes
2answers
3k views

Change color of plots in pgfplots globally

In pgfplots I can change the color of plots locally as in the example below. However is there a way to change the color for all plots in a document globally? \documentclass{article} ...
2
votes
1answer
831 views

Plotting area in the plane where two inequalities in two variables hold

I would like to plot the area in the plane where two inequalities hold, both involving two variables. I would like to do it the way Wolfram Alpha does it, but within a LaTeX document. I have looked ...
15
votes
2answers
7k views

Need to do some changes to pgfplots axis

I am still in the habit of learning TikZ, barely started using pgfplots to create my images Although I am still not sure what the best way to do so is, I need to create the image below. My problems ...
6
votes
3answers
3k views

How do I set the aspect ratio of 2D (flattened 3D) surface plot?

I am trying to do a 2D surface plot, and the way to do this in pgfplots seems to be making a 3D surface plot, and then adjusting the view. And this works fine, until I try to adjust the aspect ratio. ...
2
votes
1answer
318 views

Wrong area plot

I'm trying to draw a plot from this table: ip Min Std 0 19.86764349 97.20356138 16 19.86764349 250.079659 22 19.86764349 168.2253117 23 19.86764349 169.2514577 33 ...
11
votes
2answers
2k views

Coordinates of intersections

In axis environment I have a curve and a line intersecting it. How can I get components of intersection-1, intersection-2 etc. in axis units? \documentclass{minimal} \usepackage{pgfplots} ...
9
votes
1answer
720 views

Disable warning messages in pgfplots

When I plot a graph with pgfplots sometimes I got such warning message NOTE: coordinate (500,0) has been dropped because of the y-coordinate filter. However in may case such points are legal. How ...
6
votes
1answer
1k views

pgfplot consistent number format

I am trying to make a the number format in my pgfplots the same, as in the rest of my document. I am normally using the \num from the siunitx package to typeset numbers, and would like to use it in my ...
19
votes
1answer
3k views

pgfplots: externalization and legend referencing

There are some issues when using the pgfplots option legend to name together with externalization. When I disable externalization, everything works fine. When I enable externalization, I get an error ...
2
votes
1answer
335 views

pgfplots: externalization and ifthen

I use pgfplots with externalization. When I try to include a macro that uses \ifthenelse, always the 'else' statement is being executed. When I switch off externalization, it works again. See this ...
9
votes
2answers
908 views

pgfplots: legendentrys are wrong

I'm using pgfplots to plot a lot of data as you can see below. For some of the plots I'v specified a legendentry, but the marks for these plots are not shown in the legend. does anyone know where the ...
9
votes
2answers
4k views

pgfplots multiple plots in one file

In pgfplots is it possible to have several plots in one datafile? The goal is to add about 20 plots, which has different number of points and not the same x-value, to the same axis. (app. 350 points) ...
7
votes
2answers
411 views

Axis background has missing draw/stroke

I want to draw a rectangle around an axis created using pgfplots. This is a minimal example: \documentclass{minimal} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
5
votes
1answer
2k views

pgfplots: nodes near coords only for one plot

Does anyone know how to set up pgfplots to print nodes only for one and not for all plots? For example, in 1 I would like to see the nodes only for the test-plot and not for the trend-plot. You will ...