{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
926 views

Using Macro Defined Lists in TikZ/PGFplots

I want to be able to use a macro to specify a list (it is a constant list, i.e. will not change throughout the document) and use this macro rather than hard code the list contents in the TikZ/PGFplots ...
5
votes
1answer
341 views

Using \IfNoValueTF within a TikZ style specification.

In an answer to Flushing PGF commands and local variable Matthew had suggested using \IfNoValueTF within a TikZ \node specification to determine the text. This solution works great for me. However, ...
12
votes
1answer
13k 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}. ...
4
votes
1answer
237 views

Determine if within a PGF axis environment

Is there an easy way to test whether a macro is called from within an PGF \begin{axis}...\end{axis} environment? One solution would be to define a new environment myself that sets a flag at ...
3
votes
2answers
537 views

pgfplots - lack of one bar

I want to make a chart with nine bars. As you can see they are in the code (0-8). Unfortunately it's making only eight bars. \documentclass[12pt]{report} \usepackage{polski} ...
3
votes
3answers
2k 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 ...
7
votes
1answer
739 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
5answers
3k views

How do I use pgfmathdeclarefunction to create define a new pgf function?

I'd like to define new function for pgf so I can use it in pgfplots. I'm trying to create a unit pulse function p(x) which has a value of 1 from x=0 to x=1, and 0 elsewhere. I read the pgf manual on ...
1
vote
0answers
553 views

pgfplotsinvokeforeach using parameter [closed]

The following code works in the minimal example but not in my document \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \pgfplotsinvokeforeach{1,2,...,10} { ...
21
votes
1answer
4k views

How can I make my pgfplots ylabel multiline?

My pgfplots ylabel text is too long and looks strange. Can I make it multiline?
12
votes
3answers
2k views

Use macro as coordinate in pgfplots plot

I'm trying to come up with a solution to the question How to maintain consistency with TikZ and Pgfplots?. Essentially, what is needed is a way to save a coordinate as a macro (or a global key, ...
4
votes
1answer
636 views

How can I prevent pgfplots from rendering lines incorrectly when I use “no markers”?

I plot tabular data wherein none of the y-values of the data go above 1.0. In the resulting plot, however, there are a couple of peaks that go beyond 1.0, giving a false impression about those data ...
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: ...
6
votes
1answer
977 views

Pointing from Data in a pgfplotstable to a pgfplot

Are there PGF coordinates available for elements in a pgfplots table? Groupplots allow to address plots via (group c2r1.center) (column 2, row1). \pgfplotstabletypeset[col sep=&,row sep=\\,sci ...
7
votes
1answer
3k views

Scatterplot with pgfplots

I want a 2x2 scatterplot matrix of the data in the file scatter.dat: 0.5334437 0.4824717 0.6848940 0.6865826 0.5818373 0.6335347 0.5465202 0.5290712 The following code works: ...
4
votes
1answer
473 views

Accessing the n-th coordinates of a plot

\begin{tikzpicture} \begin{axis} \addplot coordinates { (1,1) (2,4) (3,9) (4,16) }; \draw (axis cs:0,0) -- (axis cs:3,9); \end{axis} \end{tikzpicture} I can easily draw a line ...
11
votes
1answer
624 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
314 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 ...
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
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 ...
4
votes
1answer
475 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
863 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} ...
7
votes
2answers
1k 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 ...
15
votes
2answers
5k 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 ...
2
votes
1answer
620 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 ...
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 ...
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
600 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 ...
2
votes
0answers
178 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 ...
4
votes
1answer
1k 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}, ...
10
votes
3answers
7k 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 ...
8
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, ...
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 ...
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
302 views

Dropped spines in pgfplot

How can I achieve something similar to the "dropped spines" example below using pgfplots?
11
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} ...
11
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 ...
2
votes
1answer
2k 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: ...
11
votes
1answer
6k 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} ...
4
votes
3answers
6k 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] ...
4
votes
1answer
726 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 ...
16
votes
1answer
4k 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 ...
15
votes
1answer
2k views

Is it possible to create overlays in beamer inside pgfplots graphics?

When working with pgf-tikz, I can create overlays in beamer presentations with \path<overlay specification> ... However, I could not get this to work in pgfplots graphics. It would be nice ...
19
votes
2answers
19k views

Hide tick numbers in a TikZ/PGF axis environment.

I have a TikZ/PGF axis enviroment where by default numbers are shown along the ticks. I want it to look like this: (Axis without tick numbers) I found out how to modify the ticks itself using ...