{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

9
votes
1answer
2k views

pgfplot with constant decimal places on ticks

I'm trying to display the tick labels of the y axis of just this graph within my document formatting to two decimal places. I've tried the following code but it seems that it doesn't like the way I'm ...
10
votes
2answers
1k views

Intersection of 2 surface plots in pgfplots

My question is pretty much a duplicate of this one. I'd like pgfplots to display the intersection between tho surface plots properly. Unfortunately, my function is quite different from the one in the ...
8
votes
1answer
923 views

Plots with data coming from different files

Is it possible to draw a graph with pgfplots using data from different files ? Let say I have two data files : data.dat and error.dat and would like to plot column 1 versus column 0 from data.dat and ...
13
votes
1answer
2k views

How to use a string column with pgfplotstable to label datapoints in a pgfplot?

I have a comma-separated list of data points. They should be plotted as a scatter plot, and should be labeled using data from the .csv file. Having specified the first column of my file as string ...
12
votes
1answer
727 views

How can I automatically mark local extrema with pgfplots and scatter?

I am trying to have TikZ automatically mark a local maximum in a fourth-degree polynomial I built using a curve-fitting tool. I am new to LaTeX and TikZ, and am a bit overwhelmed - there seem to be a ...
12
votes
1answer
970 views

3D Arrow Tips for TikZ/pgfplots

I really like the arrow tips shown in How to get rid of the viewer's (incorrect) axes in an Asymptote 3D graphics and am wondering how to produce this in pgfplots: I admit I have not tried ...
12
votes
1answer
2k views

Stacked barplots/groupplots with text labels in x-coordinate

I was trying to stack a groupplot, or was it grouping a stacked plot? However I was trying to get something like: The ybar stacked option works quite nice here. But when I try to adapt it to a ...
12
votes
1answer
10k views

How to properly scale a TikZ/PGF picture which has a `\begin{axis}…\end{axis}`

Applying a scale option to a TikZ picture works great. It keeps the text the proper size and scales everything else. I would like to have the same behavior when using a \begin{axis}...\end{axis}. ...
9
votes
1answer
171 views

Local colormaps in global coordinate system

I am trying to get a surface graph with two colormaps. Instead of using the full Z range i want to give the first surface its own colormap and the second surface should receive its own colormap too ...
9
votes
1answer
916 views

How to Graph Floor/Ceiling Functions in LaTeX (PGFPlots)

I am trying to make a graph of some floor/ceiling functions for examplep the floor of 3x+2 like this: http://www.wolframalpha.com/input/?i=graph+of+floor%283x%2B2%29#=. However, I searched through ...
8
votes
1answer
796 views

Pgfplots: title covers scientific notation

I have a problem with pgfplots. As you can see by compiling my MWE, the title of the plot covers the scientific notation of the y axis. Is there any way to fix that (move the title or the scientific ...
8
votes
1answer
845 views

pgfplots: color a surf using arbitrary colors

I am trying to figure out if there is an equivalent in pgfplots to what in MATLAB is done through the following command: surf(A,B). This would plot the geometry A, using the colors specified in B. I ...
7
votes
1answer
391 views

Align pinned nodes in PGFplots

I'm working with plots generated from matlab2tikz and I have several plot lines close to each other. Labeling them is proving difficult, but I believe a good looking solution could be to list the ...
7
votes
1answer
641 views

How can one predict pgfplots memory overload?

I have some legitimate data sets that overload the memory available to TeX. Of course the recommended step is to cut the number of data points instead of changing the "main memory size". (In my case ...
6
votes
1answer
496 views

2d graphs in a 3d plot

I am trying to create 3d plots with several 2d graphs, like in Plotting several 2d functions in a 3d graph. However the end result looks like this: Using \closedcycle doesn't help either, as it ...
6
votes
2answers
1k views

Using reference with externalized pgfplot figure

I am currently writing a document with a lot of plots. I draw them with pgfplots. which uses a lot of ressources. To manage that, I use the externalization feature of TikZ. In the file myarticle.tex, ...
4
votes
1answer
118 views

PGFplots and table with different number of elements in columns

I am trying to plot a table where I have different number of elements in the columns. In the MWE, the pairs (x1,y1),...,(x4,y4) all have different number of elements, can I use PGFplots in such ...
14
votes
1answer
2k views

Add a legend title to the legend box with pgfplots?

I am using the awesome pgfplots package to draw some plots. I usually use \addlegendentry and get a nice default legend box. There are some options for legend box placement and layout (e.g. number of ...
13
votes
2answers
952 views

Allow underscore in PGFPlots tick labels read from table

I'm trying to use the text data from a table column as the tick labels in a plot. The text data contains underscores, which makes LaTeX throw a Missing $ inserted error. I'd usually get around this by ...
13
votes
2answers
4k views

ylabel postion with pgfplots

I am using pgfplots to plot some data, but I am having problem you see in the image below. Basically, the ylabel overlaps with the axis numbering. I have googled a LOT but couldn't find any solution. ...
11
votes
2answers
419 views

Visualize data on a variable-radius graph/network

I am trying to visualize the output from a simulation model I have been working with. The simulation finds the steady-state solution to a system of differential equations on a variable-radius (and ...
10
votes
1answer
729 views

How to scale existing coordinates data in pgfplots?

I have a plot with its data, for example \documentclass[]{article} \usepackage[]{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[] \addplot+[%multiply x data by a factor here, multiply y ...
10
votes
1answer
2k views

What “smooth” plot interpolation algorithm does pgfplots use?

In the pgfplots manual it says: \addplot+[smooth] Smooth plots interpolate smoothly between successive points. In order to choose the right sampling of points from a function evaluation for ...
9
votes
1answer
851 views

Having y-axis in log scale base 2 using pgfplots

I have made a chart using pgfplots as written below and I want to have the y-axis in logarithmic scale. This code works fine but the base of the logarithm is 10. How can I change it to base 2? ...
9
votes
1answer
2k views

How can I filter/select data from a table and plot it?

I have a table with data from a file and before anything, I sort the data. Then I would like to filter only the rows that have a specific value. There has been a similar question which almost contains ...
8
votes
1answer
547 views

How to reuse the plotmark styles from PGFPlots outside the tikzpicture environment?

In a figure caption or in the main text I want to reuse the style of the plotmarks or the combination of line and symbol as in the figure legend. As I did not find a command to reuse the legend image ...
8
votes
2answers
1k views

Compiling a document with PGFplots processing only every x-th data point? [duplicate]

Possible Duplicate: How to select a finite number of samples from the file when plotting using pgfplot Compiling my document with many PGF Plots, each containing thousands of data points ...
7
votes
1answer
382 views

Read boxplot prepared values from a table

Update: Is there any possibility of drawing two box plots this way using a single datatable as in the updated MWE below? I'm trying to use pgfplots 1.8's shiny new boxplot feature. As I am also ...
7
votes
2answers
566 views

Particular bar plot with pgfplots: bar color = category

I want to create a bar plot using pgfplots. In this plot the bars should be represent categorys. So that one color suggest the category. The categorys are: 0-8 None 9-13 Minimal 14-19 Slightly ...
7
votes
1answer
726 views

Calculate and draw difference of two plots automatically

I'm trying to automatically generate a plot, which visualizes the difference of two other plots. The input source is a single(!) file. The data is filtered by one column with /tr/rowfilter. Here is an ...
6
votes
1answer
599 views

Piecewise Function Using Pgfplots

Using the question here I have tried to plot a piecewise function. My code looks like \begin{document} \pgfmathdeclarefunction{func}{1}{% \pgfmathparse{% (and(#1<=-2) * (#1*#1 + #1*6 + 8) ...
6
votes
1answer
805 views

pgfplots: color a (3D) surf using arbitrary RGB colors

I would like to color a surf using arbitrary RGB colors (unlike this question, which just colors the surf using the colormap). In this minimal example (which plots the x+y function), I would like the ...
6
votes
1answer
1k views

create scatter plot from dat file

I would create a scatter plot using pgfplots using data from my dat file that contains this data: nodes x y label 1.0000 14.1209 7.0332 a 2.0000 0.6367 16.6166 a ...
6
votes
1answer
378 views

Question regarding piecewise syntax with pgfplot?

The piece function is defined as following: Here is the code snippet: \pgfmathdeclarefunction{func}{1}{% \pgfmathparse{% (and(#1>=0 , #1<=500) * (300 + #1*(12/10)) +% ...
5
votes
1answer
4k views

Different marker shape for pgf/TikZ

I have a figure in my paper which compared 6 different cases. The figure needs to be in black and white. In below is the code I used to create the figure. \documentclass{standalone} ...
3
votes
1answer
353 views

pgfplots: how to load distinct symbolic ticks/labels from file?

I want to plot a matrix of color-values from a csv file. Inspired by this website, I set out to write my MWE below, to which I added this way of dynamically loading symbolic ticks/labels from my data ...
2
votes
1answer
650 views

Consistently specify function to be graphed with or without gnuplot

I would like to be able to specify a function and then graph that with with pgfplot only, or use gnuplot to compute the coordinates. As far as I know there are two main differences in how the ...
1
vote
1answer
155 views

Tikz won't plot the function properly

I tried to plot the following function but it didn't work: y = 300 + 1000/x + 2.5x. This is the document, but instead of the plot it only shows the axis. \documentclass{article} ...
17
votes
3answers
859 views

Fill area between curves

I need to reproduce the following plot: I tried the following code using pgfplots: \documentclass[8pt]{beamer} \usepackage{tikz} \usetikzlibrary{patterns} \usepackage{pgfplots} \begin{document} ...
16
votes
1answer
2k views

PGFplot Axis Labels Detaching From Graph

Update: Aug 04, 2013 With the current version of TeXLive 2013, the second MWE below still exhibits the same behavior if the \todo[inline] is commented out after the first run. Furthermore, the ...
13
votes
1answer
2k views

TikZ, 3d library and circle fading

I'm using the 3d library to put a circle on the z=0 plane, and other things. I'd like to fade this circle radially, but the result isn't as I would expect because the fading is not proportional to the ...
11
votes
1answer
2k views

pgfplots - Placing Nodes on x Coordinates of a Plot

I want to plot some graphs in pgfplots and want to place nodes on the exact same x coordinate of the plot. The position of the note has to be set in x direction but free in y direction. Here is one ...
11
votes
1answer
478 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
163 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
252 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
524 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
664 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 ...