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

When using decorations, how can I calculate with \pgfdecoratedpathlength?

I would like to draw a picture with tikz and use 'decorations' to show a single pulse on a line. Correct: A -- B As you may see my code won't work for more than one segment ( A--C--B ). ...
1
vote
1answer
109 views

Composite plot in PGFPlot

I am trying to get pgfplots to do produce a plot like the following: i.e. a scatterplot with a second scatterplot below the x-axis. I am having a hard time figuring out how this kind of plot is ...
4
votes
1answer
356 views

Pgfplots: How to fill area under a curve in a 3d plot similar to \closedcycle in 2d

How can I fill the area under a curve in a 3d plot, similar to the \closedcycle command in ordinary 2d plots? Applying this command does a filling which is not rotated. Minimal working example: ...
4
votes
1answer
349 views

pgfplot xbar legend ordering

when I am drawing a xbar chart, I have troubles with the legend entries. They appear to have the opposite ordering as I suppose they should have. \begin{tikzpicture} \begin{axis}[xbar] \addplot ...
4
votes
1answer
227 views

output-directory and shell commands

Let's use a small example to use gnuplot to draw a nice function using tikz. \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw plot[domain=-3:3,samples=100] ...
1
vote
0answers
24 views

tikz legend with only 1 bar, not 2 [duplicate]

I have bar graphs made with tikz picture and pgfplots and the legend has two bars shown for each item. If this were printed in black and white I can see it being confusing given that I have multiple ...
6
votes
1answer
111 views

pgfplotstable: fixed precision, switch-case?

I tried using pgfplotstable to format an external txt file, but some problems arrived. My goal is to show the numbers with fixed, fixed zerofill, precision two and with the presign, which should ...
3
votes
1answer
239 views

tick mark separation

My graphs have two ticks on the x-axis. I'd like to have 3 graphs across a page and include y-axis labels. Right now that wont fit. Is it possible to move the x-tick marks closer together so the ...
6
votes
2answers
310 views

Annotate grouped bar plot

I'm trying to draw a grouped bar plot, but with added dots "on top" to signify outliers in the results. Currently I have: \begin{figure}[] \begin{tikzpicture} \begin{axis}[ ...
9
votes
4answers
335 views

In pgfplots, how to apply enlarge * limits to axis but not to grid?

I need to plot a pgfplot where the axis arrows “overshoot” the grid by 10pt. Using enlarge x limits I can enlarge the arrows, but then the grid gets enlarged too. \documentclass[]{standalone} ...
2
votes
1answer
358 views

Setting gnuplot-like colormaps with pgfplots

I would to use the gnuplot default colormap with pgfplots. This colormap is defined in gnuplot with set palette rgb 7,5,15 where the numbers refer to a function for the red, green and blue colours ...
5
votes
1answer
207 views

Add background pattern to tikzpicture vertical bars

How do I replace the blue backgrounds as indicated in the picture with a diagonal and grid pattern respectively? I currently can't find a neat solution for my kind of graph. Code ...
0
votes
1answer
312 views

How to correct problem with ybar plot: bad axis and too many labels in x axis

I need a bit of help here with the axis... Any suggestions would be always welcome. I have got 2 extra labels at the x axis... \documentclass{scrreprt} \usepackage{pgfplots} ...
2
votes
1answer
350 views

Pgfplots: Horizontal colorbar on top

I found on pgfplots manual ho to have an horizontal colorbar (simply specifying the colorbar horizontal option) but how can I put it above the axis? By default pgfplots puts it below the axis.. Here ...
0
votes
1answer
172 views

Nearest-neighbour surface plot from matlab2tikz fails with colormap

I load an external custom colormap with \input{coolwarm_.map} I have a range of complex surface plots created with matlab2tikz which use this colormap and compile successfully. One does not. It ...
5
votes
1answer
168 views

Coons patches in pgfplots

The current method of drawing Coons patches in pgfplots requires four cubic Bézier curves along with point meta values for each corner point. This closely follows the format used in the PDF ...
4
votes
1answer
164 views

Includepdf causes an error message from pgfplots externalization

I have a file test.pdf which I include in a document containing also an externalized pgfplots picture. When I compile the following code, I get the error message Sorry, the system call pdflatex ... ...
1
vote
1answer
99 views

Position of colorbar with multi plots without using groupplot

I have 6 plots (2 rows, 3 columns) with the same colormap and I want to put only one colorbar on the top of the plots. Using anchor and at does not give the expected result, I think this is because ...
2
votes
1answer
292 views

legend in Unequal upper and lower deviation in PGFplots error bar!

I want to set different lower and upper deviations for error bars. It seems that PGFplots does not support unequal +,- error bar length. I have come up with a solution, that is to draw + and - error ...
5
votes
1answer
80 views

Precision for one row only

I have an array with three rows and I would like that the last row has a specific format. There is a command every row no/.style, but it wouldn't work in our context because the processing is applied ...
2
votes
2answers
147 views

How do I group curves in 2-D plots with pgfplots

In the above image, you can see that there are 4 curves. I have two techniques (black and red). I test them on two different experimental scenarios. So corresponding to each scenario, I get one red ...
4
votes
1answer
163 views

pgfplots axis clipping large markers

In the example below the large markers at the axes are drawn over the axes. \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \begin{document} ...
3
votes
0answers
41 views

Pgfplots bar chart - One plot, different colors [duplicate]

Is there a possibility to color bars of one plot in different colors? \begin{tikzpicture} \begin{axis}[ xbar, xmin=0, width=12cm, height=3.5cm, enlarge y limits=0.5, xlabel={\#participants}, ...
6
votes
1answer
418 views

pgfplots intersection with path

I am trying to find the intersections of a path with plots from pgfplots via the intersection library. The intersections found clearly do not match the visable intersections. It seems as if they are ...
5
votes
3answers
176 views

How can I Insert Additional label on the z-axis in ternary diagram?

I need help on how I can insert additional label X_{Bi} on the z-axis of the subfigure in my ternary diagram. In the example shown below I can only insert it at a location too far away from the middle ...
7
votes
1answer
108 views

Import a table with a specified format

Basically, I have a table (from a file) containing only numeric values. I would like to import in latex but it has to be formatted in a specific way, as illustrated by the picture. The ... should be ...
2
votes
1answer
302 views

tikzpictures positioning

I am having trouble trying to position tikzpictures in their correct position... I want to place the 3 plots with the green filling in a single line above (with the alpha/2 right below), and the 3 ...
7
votes
1answer
211 views

Breaks in tikzpicture graph

I have a graph drawn using tikzpicture and even though I've increased the resolution there are still gaps in the graph itself. \documentclass{article} \usepackage{tikz} \begin{document} ...
2
votes
1answer
162 views

axis lines=middle and axis lines=center

Is there a difference between axis lines=middle and axis lines=center options in pgfplots?
2
votes
1answer
147 views

Why do these two plot commands give different results?

Why the following two MWE codes, using pgfplots with and without gnuplot give different results (a phase shift)? \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
16
votes
1answer
696 views

How to rotate a pgfplot?

I'm trying to create a plot like this: So far, I arrived here: With the following (minimalized) code: \documentclass{report} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \begin{document} ...
2
votes
1answer
250 views

Specify directories to check by the PGFplots addplot command

When I produce a graph with PGFplots, I first test it, before importing it in my main document tex file. I have the file tikzpicture.tikz in which the tikzpicture environment data is included, and I ...
5
votes
1answer
206 views

Strange interaction between `addlegendentry` and `y filter` in pgfplot

From this answer How to scale existing coordinates data in pgfplots? I am using y filter to process data, all fine until I decide to put a legend entry in the plot. I cannot seem to simultaneously use ...
12
votes
1answer
903 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 ...
5
votes
1answer
753 views

Could not parse Input

I have a problem implementing a tikzpicture. I want to plot the Swiss Performance Index, which I was able to do time ago. Unfortunately I deleted the code from my thesis because I thought I will not ...
5
votes
1answer
418 views

TikZ graph not aligning

I am having two issues with TikZ pictures. I have three graphs side by side, and I am having issues, but only with some of them, which is very odd. First the x-axis is going out of alignment (some ...
10
votes
1answer
975 views

How can one plot in 3D a matrix with LaTeX?

I have a problem with drawing a 3d plot in TikZ. I have a matrix of size (n*m) n is the number of points in the x-direction and m is the number of points in the y-direction and the values in the ...
2
votes
1answer
158 views

How can one insert an arrow on the z-axis of a ternary diagram to indicate increasing order of the element on this axis?

I need help on how I can insert X_{Bi} and a rightarrow on the z-axis of each of the subfigures in my ternary diagram. X_{Bi} implies X subscript Bi while rightarrow is as in LaTeX to indicate that Bi ...
2
votes
1answer
80 views

Boxed pgfplots reference in the text

I want to make a reference to a pgfplots graph in the text. The reference should be surrounded by a small box. I have tried several things but it always looks ugly. How can I vertically align the ...
3
votes
2answers
174 views

How do I arrange diagrams in pgfplots vertically with labels?

I have two ternary diagrams I put side by side on the same page using pgfplots.How can I arrange them vertically and as well label them? An example of what I have is given below: ...
5
votes
1answer
5k 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
105 views

How to use the same linestyle for different isolines in pgfplots

I need assistance on how I can use the same linestyle in ternary diagrams where there is no need for using different colors, linestyles and legends.An example is given in the following programme which ...
2
votes
1answer
291 views

How to shift yticklabels vertically?

When plotting data matrices as done here and here, the tick labels get drawn at the border of fields. They should be drawn in the center. I've tried shifting them using hspace and vspace. This works ...
4
votes
1answer
420 views

How to automatically align subfloat captions to xlabel of PGFplots?

Subfloat captions are not usually aligned with their corresponding xlable in PGFplots. One way is to manually move the captions horizontally to align them. For example, (copied from here) ...
16
votes
2answers
676 views

Making the size of the arrow head proportional to the magnitude of a vector field in TikZ

Consider a scaled vector field v = (-x, 2x+y-1) living on the triangle at (0,1), (1,0), and (0,0): \documentclass{minimal} \usepackage{tikz} \begin{document} \begin{tikzpicture} \coordinate (A) at ...
6
votes
1answer
9k views

Customize legend position in PGFplots axis environment

I am trying to customize the position of the legend in the axis environment of PGFplots. A simple way to do this is by using something like legend pos=south west|south east|north west|north east ...
4
votes
1answer
1k views

TikZ images won't compile externally

I have a number of large plots which exhaust memory when I try to compile them with xelatex, so I am using lualatex instead, which is able to compile them without major difficulty. However, I am ...
8
votes
2answers
382 views

Setting the unit vector ratio gives a '! Dimension too large' error

I have a Delaunay-triangulated surface generated in MATLAB, which I would prefer to render in tikz. I use Nico Schlömer's matlab2tikz script to generate the standalone tex file. The MATLAB result ...
2
votes
1answer
89 views

How to remove all of ticks keeping the extra ticks

I want something like \begin{axis}[ y ticks=\empty, extra y ticks={-1,1}, extra y tick style={yticklabels={{name1},{name2}} ] ... \end{axis}
1
vote
2answers
463 views

pgfplots: How to place the legend box in the middle of an axis

I would like to have something like legend pos= west, %insted of north west, south east... because I don't wanna place it in the corner but vertically in the middle. How could I do this?