{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

10
votes
1answer
539 views

Tabs in output file written by xelatex and pdflatex are different

I'm trying out pgfplots with gnuplot to generate the data. This works by having pgfplots write some stuff to an external file, run gnuplot on the file, and then use the generated data to plot the ...
3
votes
2answers
307 views

Use \def without including the square bracktes with pgfplot?

I would like to define a line style to use in my pictures. But would still like to retain the flexibility to be able to tweak these if needed in the actual picture, as in the third picture ...
16
votes
1answer
3k views

pgfplots: prevent single plot from being listed in legend

In order to fill the area between two complex curves I use tables and the vertcat command (see Fill between two curves in pgfplots.). Now I don't want the plotted area to appear in my legend, just ...
10
votes
2answers
2k views

tikz/pgfplots advanced z-order axis/grid

Is it possible to have both the axis on top and the grid on the very bottom (or somewhere in between some other planes/lines/...) of a plot? Example figure with axis on top=true but the grid on top ...
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 ...
3
votes
3answers
1k views

How to plot a third variable (z) on pgfplot as a color gradient

I'm trying to use pgfplots to create a 2D plot with 3 variables, the third one being plotted as a color gradient. \begin{tikzpicture}[scale=0.75] \begin{axis}[xlabel=Selta,ylabel={Hitastig ...
6
votes
1answer
1k views

grouping options problem in pgfplots.groupplots

i have a problem with the grouping options of pgfplots.groupplots. besides the labels i have also units defined. with the option xlabels at=edge bottom only the label but not the unit is moved to the ...
6
votes
4answers
866 views

How to create pgfplots cycle list from a table?

I know that a pgfplots cycle list can be created with \pgfplotscreateplotcyclelist. However, the examples given in the pgfplots manual explicitly list all the items. I am wondering if it is possible ...
4
votes
1answer
434 views

Pgfplots jump mark error when plotting a floor function

For some weird reason the following code gives me the wrong plot \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} \addplot+[jump mark left,samples ...
2
votes
2answers
787 views

pgfplots: setlength inside foreach

I have the following code, where the size of the cube marks is set to \x inside a foreach loop: \begin{tikzpicture} \begin{axis}[axis lines=none] \newlength{\mylen} \foreach \x in {1,2,...,10} ...
6
votes
1answer
1k views

Extract the x/y part from a coordinate in pgfplots

How can I extract only the x or y part of a predefined coordinate? For instance, let's say we have \coordinate (A) at (1,2); And I want to use the x part of (A) like this \draw (x of A,3)--(0,0);
6
votes
2answers
962 views

Use a variable as a coordinate in pgfplots

I have the following code: \begin{tikzpicture} \begin{axis}[domain=0:40] \addplot {x}; \def\a{\pgfmathparse{1+1}\pgfmathresult} %\draw (\a,20)--(axis cs:20,0); \node at (axis ...
2
votes
1answer
584 views

how to use \insert{_file_} to include tikz \draw command?

I'm using Stata to run some simultions, and my data change every time I run my do file. My data have a discontinuity that changes with each run and I'd like a curly brace that reflects the size of ...
12
votes
2answers
4k views

Dimension too large while plotting with pgfplots

I have the following pgfplots code: \begin{tikzpicture} \begin{axis}[domain=-8:2] \foreach \i in {-10,-9.8,...,10} {\addplot+[smooth] {-x/\i+\i};}% \end{axis} \end{tikzpicture} I need several ...
7
votes
1answer
638 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 ...
1
vote
1answer
1k views

\pgfresetboundingbox is undefined control sequence?

I'm sure this question has a simple answer that I'm missing: I'm trying to use pgfplots to put two graphs right next to each other with no space in between. I thought I could do this by using the ...
6
votes
1answer
2k views

pgfplots: Multiple (shifted) stacked plots in one diagram

How can I get multiple stacked plots (ybar stacked, stack plots=y) in one diagram, such that there are multiple stacked bars for the same x-coordinate, each slightly shifted? Is there a way to reset ...
4
votes
2answers
2k views

How to make pgfplots vertical labels have proper hyperref erence box?

PGFPlots and hyperref don't seem to play well together for vertical text. For example, the ylabel (which is vertical) shows its hyperref box in the middle of nowhere instead of at the position and ...
15
votes
1answer
3k views

Declare nodes in pgfplots as overlays

The Background In pgfplots, it is possible to make plot elements such as axis labels, ticks and legends overlay, which means they will not be considered when determining the bounding box of the plot. ...
5
votes
1answer
547 views

Grid Z-order in PGFPlots

How can I go about putting a grid in front of a bar chart in PGFPlots, preferably as automagically as possible? Ed Tufte demonstrates a rather appealing way of drawing bar charts in The Visual Display ...
4
votes
1answer
1k views

Accessing individual table elements with pgfplots?

I want to create a plot using a non-standard plot-style that I don't see in the pgfplots manual. It would be nice if I could take advantage of the \pgfplotstableread function and then somehow loop ...
4
votes
2answers
1k views

Incorrect plot using Pgfplots

I'm trying to plot a function with pgfplots for LaTeX. Unfortunately, pgfplots plots the function incorrectly. Here is the LaTeX code I use: \begin{figure}[H] \centering \begin{tikzpicture} ...
2
votes
0answers
174 views

Incorrect plot with pgfplots and LaTeX [duplicate]

Possible Duplicate: Incorrect plot using Pgfplots I'm trying to plot a function with pgfplots for LaTeX. Unfortunately, pgfplots plots the function incorrectly. Here is the LaTeX code I ...
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, ...
34
votes
2answers
8k 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 ...
10
votes
1answer
987 views

Make pgfplots typeset axis units as reciprocals using siunitx

pgfplots has a library units that allows to typeset units in axis labels provided through x unit=<unit>. Through the key \pgfplotsset{unit code/.code={\si{#1}}}, it can be made to typeset the ...
3
votes
1answer
1k views

Can't replicate this graph using TikZ

I'm having trouble replicating this graph I know it's silly to do a graph with so little info, but my teacher demands it.. go figure... I can't seem to make the bars stick together. It's my first ...
34
votes
1answer
7k views

Bell Curve/Gaussian Function/Normal Distribution in TikZ/PGF

Can anyone tell me how to plot a gaussian function/bell curve using TikZ/PGF? I'm basically looking to implement something like PSTricks's \psGauss command.
9
votes
1answer
3k views

Trend line or line of best fit in pgfplots

Is there an "out of the box" way to automatically draw the trend line in pgfplots? Below follows a basic illustration of a scatter graph with a line of best fit:
4
votes
1answer
2k views

Maths expression in coordinates for a bar chart

I am using pgfplots to create a bar chart, with the x-axis representing different categories. Using symbolic x coords I can specify the labels for the categories. However, I am unable to use a ...
4
votes
1answer
293 views

Dropped spines in pgfplot

How can I achieve something similar to the "dropped spines" example below using pgfplots?
10
votes
1answer
1k views

Z-Order of plots pgfplots

Simple question: I can’t seem to control the z-order (i.e. which comes in front, which comes in the back) of the plots in a 2D axis. MWE: \documentclass{article} \usepackage{pgfplots} ...
10
votes
3answers
5k views

Restrict function plot to a range of x values using pgfplots.

I want to create a plot of two functions using pgfplots and LaTeX. I want one of the functions only in a certain interval, I'll give an example: \begin{tikzpicture} \begin{axis}[ axis x ...
4
votes
1answer
833 views

How to get more information to the y-axis, and a grid to the background

I need a grid in the background and more values on the y-axis. Can you help me out? \begin{tikzpicture} \begin{axis}[width=14cm,height=6cm,title={Entwicklung},ylabel={Wachstum in Prozent}, ...
2
votes
1answer
1k views

Bar plot legend not displaying correctly

In the legend for a bar plot that I'm building, I'm only getting a small tick next to the name, not a block of color. I'm not defining any special cycle lists. The code for the plot is: ...
9
votes
1answer
1k views

Multiple Files input to one pgfplotstable

I have several data files that I would like to combine into one table using pgfplots table. Specifically, I would like to use one file to set the first three columns and then have each data file fill ...
3
votes
1answer
402 views

Strange behavior y label in PGFplots

I've noted a strange behavior of PGFplots y label with the following code: \documentclass{report} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ compat = 1.3, no markers, ...
17
votes
1answer
6k views

How do you remove the axis multiplier?

A chart with data in the range of 200,000 and small difference between max and min values, will be assigned a 10^5 multiplier to the entire axis. This results in the ticks becoming meaningless, since ...
11
votes
1answer
4k views

pgfplot: Datafile format for datetime field

I have a datafile (which I may manipulate to any format), it contains a date-time stamp currently in the form "year-month-day hour:min" and a single variable for each recorded time. When I attempt to ...
2
votes
1answer
1k views

Regarding bar chart with text as x axis labels

I have seen the previous posts regarding "bar chart with text as x axis labels". I tried to use the same code discussed in the posts and in the documentation, \begin{tikzpicture} ...
10
votes
1answer
3k views

Chart with long x axis text labels looks ugly

Thanks to Caramdir and Alan Munn I am now able to create basic bar charts that use text as x axis labels. Functionally they are perfect, but some of them look kind of ugly. See for yourself: ...
12
votes
2answers
9k views

Basic bar chart with text as x axis labels

I am trying to create a very basic bar chart using pgfplots. I need four bars representing percentages with text as labels under the x axis. Text labels contain spaces and accented, non-English ...
6
votes
3answers
1k views

Plot a matrix of real values with TikZ/PGF like imshow in matlab

How can I plot a matrix of real values with TikZ/PGF such that it looks like plotted with imshow in MATLAB? \addplot3 does something similar, but I'd like to have that in a color-coded 2D plot.
3
votes
3answers
4k views

Line with arrowhead in PGFPLOT

How can I add a line ending with an arrowhead in pgfplot? \begin{tikzpicture} \begin{axis}[grid=major,axis x line=middle, axis y line=middle] \addplot[domain=0:1, no markers] ...
50
votes
5answers
16k views

How to expand TeX's “main memory size”? (pgfplots memory overload)

I'm compiling one pretty simple LaTeX file with few dozen of pgfplots. Now, I can compile part by part, but am unable to compile it all at once. I really need good precision for all those plots (noise ...
20
votes
2answers
3k views

Fill between two curves in pgfplots.

How to accomplish fill between two curves in pgfplots? For example, I have ... \addplot coordinates {(0,1) (1,1)}; \addplot file {something.dat}; ... and I would like to have filling between those ...
4
votes
1answer
661 views

How can I restrict `pgfplots` plot to an interval manually?

OK, I've plotted these graphs but am unable to stretch the second one, so that they both have the same values on the vertical lines drawn from one to another. I've tried to set domain=0:2200 for both ...
4
votes
4answers
951 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 ...
9
votes
2answers
2k views

Using pgfplot externalize with .eps output

I'm trying use to use pgfplot's externalization feature b/c I've got many large plots that I don't want to regenerate every time I typeset my thesis. Other components of my thesis require compile via ...
13
votes
1answer
3k views

Removing legend box (border) in pgfplots

I'm attempting to remove or 'turn off' the legend border in pgfplots, but I can't seem to figure out how to do it. I assume it will look something like this: \begin{axis}[ legend style={?}] where ...