{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

6
votes
1answer
75 views

Reference to pgfplot with margincap

I was using references to parts of a pgfplots plot, which worked perfectly. However, when I changed the document to use margincaps, this breaks: I get a warning that one reference is undefined, and ...
11
votes
2answers
514 views

How can I create a polar plot on a Cartesian grid?

I'm currently using tikzpicture and pgfplots to plot this polar function: \documentclass{article} \usepackage{pgfplots} \usepackage{tikz} \begin{document} \begin{tikzpicture} \begin{polaraxis} ...
3
votes
0answers
272 views

pgfplots 1.9 on Mac [closed]

I have an iMac with TeX Live 2011. It came with pgfplots version 1.4, which I am able to use without a problem. I just downloaded pgfplots version 1.9 which has new environments like polar axis, smith ...
5
votes
1answer
86 views

How to prevent extra yticks within a Tikz Grid?

I created a nice scatter diagram based on the example at http://www.dgsiegel.net/news/2011_12_05-creating_beautiful_graphics_with_pgfplots. The problem I have now is that in order to show all the ...
5
votes
0answers
207 views

Tick labels in pgfplots data time format

I tried to plot a data set containing seconds and milliseconds with pgfplots. I’ve found a solution for my task here (pgfplots data time format), which I changed a bit. This principally works very ...
2
votes
0answers
159 views

How to make a tidy grouped and stacked barchart?

I found this chart in a recent paper. I've emailed the author about it but they didn't reply. I want to create something similar but I don't know what the correct software to use is. I need the ...
3
votes
0answers
126 views

How to color groups of bars in a graph, coming form an external file?

I have a graph displaying bars and error bars, the numbers comming from an external .dat, being simply black and white. And this is how I got there: \documentclass[12pt]{report} ...
5
votes
1answer
114 views

labels disappearing in pgfplot bar chart

Only the third label appears for this bar chart. If I put only one data row, the label shows up fine. If I put two data rows, both the labels are hidden. If I put three data rows (as below), only the ...
2
votes
1answer
176 views

How to define optional arguments for custom pgfplots style

I see from other question that it is possible to create styles with parameters. Like \pgfplotsset{ custom style/.style 2 args{ % code that uses #1 and #2 } } However, I can't find a way of ...
6
votes
2answers
410 views

Path with complicated colormap in TikZ

I want to draw a path in tikz whose local color is a function of position. Here are two examples of what I have in mind: I found the answers from Path following color gradient in TikZ very ...
3
votes
1answer
84 views

Label placement in pgfplots

I want to have the label arrows look that I get when using axis lines=center but I also want my x and y label to be on the outside of the plot and not inside the actual plot area. I have been looking ...
0
votes
1answer
276 views

How can I draw with coordinates of intersection in pgfplots?

When using pgfplots, the command \pgfgetlastxy works well without axis environment and with axis environment set as default. But it is hard getting the correct coordinate of intersecting, when ...
3
votes
1answer
598 views

Collapse range in x-axis with pgfplots? (break x-axis)

I want to plot data from a table file. The data has quite big gaps in the x-axis, making the actual data barely readable. Is it possible to tell pgfplots to kind of collapse the x-axis in a given ...
5
votes
1answer
172 views

Horizontal lines in bar plots without first line

I'm starting to learn pgf-plot and this is my first plot: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \begin{document} \begin{tikzpicture} \begin{axis}[ ybar, ...
3
votes
0answers
197 views

Error using “x expr” in “\addplot table” options [closed]

I have not been succesfull using x expr in \addplot table options, within Tikz/pgfplots. I don't think the problem is with the package being installed or not, because I have been using \addplot table ...
6
votes
2answers
266 views

Bug pgfplots extra ticks?

I want to add some extra ticks to a plot. However, they seem to bug out with formatting numbers. \documentclass{article} \usepackage{tikz,pgfplots} \begin{document} \begin{tikzpicture} ...
6
votes
2answers
891 views

How to draw legend lines in caption/text without including original plot's TikZ picture?

I would like to reference some plot lines in text/captions. It is possible by defining a label for the plot in the corresponding axis environment. However, I'm using externalization and only want to ...
2
votes
1answer
165 views

How to change location of boxplots along axis in pgfplots?

pgfplots draws boxplots equally spaced along the axis (x axis in my example below). How can I draw the boxplots at different locations along the axis? E.g., the example below the distance between the ...
4
votes
2answers
294 views

Pgfplots: Error of Linear Regression

Hope you don't mind me asking this, I'm only a starter at both gnuplot and LaTeX, but I've already searched the pgfplots manual and couldn't find an answer: Is it possible to have pgfplots calculate ...
29
votes
2answers
1k views

How to plot a lattice of points on the surface of a torus?

I am doing a report on the Ising model, without going into the complex details of the model, in its two-dimensional form it involves a lattice of points. Which, when periodic boundary conditions ...
2
votes
1answer
115 views

Disable decoration for pgfplot nested in tikzpicture

I have the following MWE: \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations,decorations.pathmorphing} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \begin{document} ...
4
votes
2answers
1k views

Pgfplots circles

I'm having a little trouble drawing circles in pgfplots. Here is my code and then I'll explain: \documentclass{article} \usepackage{amsmath} \usepackage{pgfplots} \usepackage{color} ...
9
votes
3answers
237 views

Use \macro within xcolor expression

So this seems to be impossible: OrangeRed!\c!white with \c being any kind of \def formula, or precisely in my case, with a \pgfmathsetmacro. Here is MWE \documentclass{article} ...
3
votes
1answer
179 views

Add arrow to 3D pgfplot

How to add an arrow (cf red arrows below) in a 3D plot (or 2D plot should be similar) in pgfplots ? The arrow has not to be specifically aligned with the label but could be placed closer to the axis. ...
2
votes
0answers
268 views

Set xticks, yticks and colorbar tikz at once [closed]

I couldn't figure it out how I can manually set the xticks, yticks as well as those ticks of the colorbar at once. It only works for one of those three, but compiling never ends if I try to change a ...
1
vote
1answer
99 views

pgfplots tick lines are behind const plot

The tick lines in the plot are in a layer behind the actual plot. Have a look at this example below: \documentclass[11pt, oneside]{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} ...
2
votes
1answer
186 views

How could we fix the legend in the x-axis with bar chart?

How could we fix the problem with the x-axis ? Also, would it be possible to have written above or in the middle of each column each number ? So as to make my bar chart, I have used the following ...
4
votes
1answer
1k views

Draw a vertical line with filled areas and dateplot

I'like to add an vertical line with some text in a graphic, but i've not found the way. I tried something like \addplot coordinates { (2008-01-01,0) (2008-01-01,130)} node {some text}; but it ...
7
votes
1answer
2k views

pgfplots, bar graph, axis distance

I have a following chart, and I am trying to decrease the distance between the x-axis ticks FCC and Beta pi. Any suggestions on how to reduce this? \documentclass{standalone} \usepackage{pgfplots} ...
2
votes
1answer
138 views

unaligned groupplot

I tried to stack my plots with a groupplot from pgfplots package. Like in this MWE: \documentclass{article} \usepackage{pgfplots} \usepgfplotslibrary{units} \usepgfplotslibrary{groupplots} ...
7
votes
3answers
1k views

Weird result plotting sin(x) using tikz/pgf [duplicate]

Trying to plot the sin(x) function, I get this result: The MWE is here: \documentclass{standalone} \usepackage{ pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} ...
8
votes
1answer
73 views

Pgfplotstable ignores chars in filename

I am using the ignore chars key from the pgfplotstable to ignore some characters in a table. However, I have noticed that it also removes characters from the file name and I am wondering if this is ...
3
votes
2answers
352 views

Origin shift in pgfplots

I want to shift the origin in such a way as the following code will cause the circle to appear with center at the point marked in red. \documentclass{article} \usepackage{amsmath} ...
5
votes
1answer
152 views

pgfplots: Add main diagonal (identity line) without affecting the axis

I would like to add a main diagonal to a plot that does not affect the axis. The line should start and end at the axis or beyond them. Furthermore, I would like to avoid xminand xmax, because I work ...
1
vote
0answers
70 views

Citation in externalized pgfplots

I have a few \cite commands in my pgfplots which are not being displayed properly when externalization in on. As soon as you turn off the externalization, the references will be displayed correctly. ...
12
votes
2answers
440 views

TikZ: Regression Line with Residuals

Desired Output I made this diagram in R with ggplot2. Now I want to reproduce this diagram with Tikz. My MWE is: \documentclass[tikz]{standalone} \usepackage{pgfplots} \usepackage{pgfplotstable} ...
4
votes
1answer
205 views

Error using tikz/pgf with font=\size (and minimal document class)

I'm having an issue with pgfplots/tikz when trying to change the font size for legends/nodes. Any command that contains "font=\size" fails (for example, "font=\small") with the error "Undefined ...
3
votes
0answers
232 views

Normal probability plot with percentile grid and axis

How can I make a normal probability plot with a percentile grid and y-axis as shown in figure? I've read the pgfplots documentation but i can't find anything useful.
8
votes
1answer
467 views

Pgfplots linear regression (mean square error)

Pgfplots offers the possibility to compute a linear regression, as in the following post Linear regression - trend line with pgfplots . However, is it possible to compute the mean square error ? My ...
2
votes
0answers
62 views

combine png and tikz, scalingproblem [duplicate]

due to the huge amount of data in my plot I wasn't able to compile the whole badboy at once after creating a tikz file and then using latex. Since the save_size won't go higher than 80000. so while ...
7
votes
1answer
624 views

X-Bar plot with intervall (a,b) rather than (0,a)

When one makes a xbar plot using pgfplots, the bar always goes from 0 to the requested coordinate. For example (p. 78 in pgfplots manual): \documentclass{article} \usepackage{pgfplots} ...
6
votes
2answers
296 views

Splitting y domain in 3D pgfplots

What I want is to plot my function from y=0-->y=3 and then from y=3,2-->y=6. I want to ommit the space between 3 and 3,2. This is my code: \documentclass[border= 5mm]{standalone} ...
14
votes
2answers
483 views

quiver plot on hyperboloid surface

Using pgfplots, I'm trying to create a quiver plot on a hyperboloid surface something like this. I was able to generate the hyperboloid surface using parametric equations. I could'nt find out how ...
3
votes
0answers
92 views

Pgfplots fails to generate boxplots for some data set

I use pgfplots to generate boxplots, however with some small data sets as the following, I get an error message. speed 2 3 1 2 2 11 Here is the error message : Sorry, an ...
1
vote
0answers
173 views

PGFPlots - no lines between marks [closed]

I am starting playing with plots in latex. In my preample I have: \usepackage{pgfplots} \pgfplotsset{width=12cm,compat=1.9} My plots code: (first is copy from from tutorial, second is my attempt) ...
4
votes
0answers
183 views

Problems with pgfplots, loops inside tikzpicture and reading from files

I was trying to implement this method (How to import ASCII coordinates to TikZ) to import coordinates and draw them, but I am having this problem Undefined control sequence \end{tikzpicture} Extra }, ...
4
votes
1answer
127 views

Use column header as labels for x ticks

With pgfplots, it is possible to let the xticklabels be given by one column of a table. However, is it possible to import it from the table header ? In my concrete case, I have a table with two ...
4
votes
1answer
210 views

Draw lines inside tikz plot (exported from matlab), independent of coordinate system

I am exporting plots from matlab with the matlab2tikz package. While this works just fine, I now want to insert some lines and text to describe the plot. I have multiple plots which are to be labelled ...
5
votes
1answer
931 views

Plotting semilog plot with pgfplot

I am trying to graph frequency response of certain filters. This is the code I currently have: \begin{tikzpicture} \begin{semilogxaxis}[xlabel=Frequency, ylabel=Gain, xmin=1, xmax=20000, ymin=0, ...
7
votes
0answers
131 views

How to create vertical Bullet Graphs with PSTricks? [duplicate]

I was looking for a package to create bullet gauge graphs, but I couldn't find any. A good person in this forum show me how he would make it in TikZ, with a little options. I was waiting any moths ...