{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

23
votes
2answers
15k views

How can I adjust the position of xlabel and ylabel with pgfplots?

I would like to have \sin x on top of the y-axis' arrow tip and x somewhere on the right of the x-axis' arrow tip. How can I achieve that? On top of that, I would like to know how I can tweak the ...
4
votes
1answer
959 views

Change Color of extra ticks grid

I got a nice an d tidy plot with the help of pgfplot using groupeplot. Now I want to insert some extra ticks with different color than the major grid...everything works pretty well except the color ...
6
votes
1answer
966 views

pgfplots stacked bar chart: remove spacing between bars

How can I completely remove the spacing between the bars in a pgfplots stacked bar chart? I've tried using code from this answer, but it doesn't produce a legend. Here's the example from the manual. \...
6
votes
2answers
3k views

PGFPlots: Mathematical expressions

Question Is there a way to include mathematical expressions in PGFPlots, for example, [domain=1/3:e^5/3]? PGFPlots is fairly useful, however the ability to put mathematical expressions directly into ...
3
votes
1answer
100 views

Too much transparancy in pgfplots

I try to embed pngs including transparancy into pgfplots. The problem is, that the transparancy is only around the main object of the png. However, as demonstrated by the MWE, it seems also to affect ...
4
votes
1answer
1k views

How can I integrate matplotlib plots with pgfplots?

The python plotting library matplotlib will by default add margins to any plot that it generates. They can be reduced to a certain degree through some options of savefig(), namely bbox_inches='tight' ...
5
votes
1answer
434 views

Array Alignment using TikZ Matrices; cell over a complete row

I want to align subplots in a pgfplot. with \matrix it is easy to align pictures. My problem is, that I need several rows with two columns/pictures and a last row with a picture over both columns. ...
2
votes
1answer
299 views

Patchplots not working recently?

While modifying some images that I created using the patchplots library from pgfplots I noted that the actual colors inside the axis are missing (I had not touched these images for a few weeks and ...
9
votes
1answer
3k views

How can I setup PGFPlots to work with gnuplot?

Notes: I'm using Windows 8 and TeXworks. Also, I have never used gnuplot by itself, so I am unfamiliar with it. I'm trying to use PGFPlots with gnuplot to graph functions. I have not been able to ...
7
votes
1answer
831 views

background for pgfplots and other tikz constructs

The answer to ybar stacked interferes with tikz background raises further questions I solved some of them. With the background commented out the MWE below produces this image: With the background ...
6
votes
1answer
9k views

PGFPlots: Make tick labels tiny

I want to make the tick labels tiny in size. Additionally, I need to hide the z-axis. Finally, I would like to suppress the y-axis tick labels. Update: Red was able to help with the tick label size, ...
4
votes
1answer
1k views

Tikz bar plot problem: Missing number, treated as zero \end

I have been trying to plot the figure: by using TikZ. However, the code does not compile and I get many errors on line 48, which is \end{axis}, as follows: Dimension too large Missing number, ...
2
votes
1answer
177 views

Ternary plot: points outside of the triangle

although my test data points are all inside the (0,0,1),(0,1,0),(1,0,0) triangle, my ternary plot unexpectedly plots some of them outside of the triangle. \documentclass{beamer} \usepackage{pgfplots}...
18
votes
1answer
260 views

Elements that looks different when printed with colours or in BW

Is there the possibility with LaTeX of having some element that change if it is printed with colours or in black and white? I was thinking about the rectangles around links with hyperref that are ...
7
votes
2answers
375 views

“Styles” for PGFplots table expressions

Is it possible to use a style, or something equivalent, to specify the column expressions for plot table? The objective is to be able to use the same expressions for a large number of different plots ...
7
votes
1answer
404 views

xshift of ybar plot

How can I xshift an ybar plot, so that number display will be aligned with the vertical left line of each bar instead of being in aligned to the center and the width of each bar to be exactly 25 (now ...
4
votes
1answer
464 views

How can the margin around externalized pgfplots crossrefs be set?

When using \usepgfplotslibrary{external} to externalize refs to labels in a pgfplot, the resulting .pdf looks cropped when the linewidth used for the line corresponding to the label is thick (or ...
2
votes
0answers
202 views

Custom intervals in x-axis [closed]

I'm trying to add a custom interval to the x-axis. In the image below, this is what I'd like to achieve (from Excel). . Latex is putting its own interval as seen below: My graph is defined as ...
1
vote
0answers
255 views

Shade background in pgfplots [closed]

I am using pgfplots package. I tried to use shade axis background. It is working in the .dvi output... But I don't see the shade when I convert it into pdf. Can anybody tell me the reason? I use ...
5
votes
1answer
763 views

Error in TikZ pgfplots with timestamps on axis

I get the following error message when I try to compile the attached code. I tried everything, but can't find the error. Runaway argument? \pgfplots@calender@ZEROSHIFT \relax \ifx \pgfplotstemptime \...
3
votes
1answer
113 views

Hiding Decimal Results from PGF Output

I have this \foreach statement which results in even numbers with decimals. I would like to omit or hide the decimal from the results. How can this be done simply? I have seen a few answers to much ...
4
votes
1answer
213 views

ybar stacked interferes with tikz background

When I compile the following code with ybar stacked option and the request for newsprint background the compiler tells me ! Extra }, or forgotten \endgroup. \endpgfonlayer ->\endgroup \hss \egroup ...
5
votes
1answer
122 views

Wrong plot in pfgplots

I want to plot a function in a LaTeX document. Usually I use either Mathematica, Matlab or Root. At this point I want to use pgfplots in order to keep my document in a complete LaTeX layout. The thing ...
5
votes
1answer
1k views

pgfplots - barplot with multiple bars on same coordinate, but labelled differently

I'm showing several data sets next to each other using multiple \addplot commands within a pgfplots axis environment. These are then further grouped into categories. The output of the graph per se is ...
6
votes
2answers
2k views

pgfplots markers and lines on different layers

When I draw some measured data with the tikzpicture and axis environment of pgfplots I have the problem that the lines and markers are not on the same layer. E.g. line 2 is drawn over line 1 but the ...
9
votes
1answer
466 views

Speed up the compilation of a document with a lot of tikzpictures made with pgfplots [duplicate]

I have a document with a lot of tikzpicture made with pgfplots, most of them take data from files so the compilation may be very long. In order to have only a draft I would like to have blank images ...
5
votes
1answer
249 views

String annotations to scatter plot coming from a different file

I am trying to adapt the setup to be found in this question. to the case where the names are in a different file. The main motivation is to have the same names for several plots and to be able to ...
1
vote
0answers
64 views

multiple labels in pgf plots [closed]

I have a box plot with 8 entries. Now I'd like to group them a little. The first four belong to Test1 and the last four to Test2. What I'd like is to Have two xlabels one with 2 ticks (Test 1 ; Test ...
5
votes
2answers
3k views

raw gnuplot in pgfplots

I have a problem with the gnuplot environment in pgfplots. I already set "--enable-write18" in the argument of pdfLaTeX and added the path of gnuplot.exe to the PATH-variable in the advanced system ...
4
votes
1answer
2k views

pgfplots: plotting data with gnuplot

I try to plot a data file (test2) which contains a header and 2 columns. My pdfLaTeX (argument: --enable-write18) gives me not the result I get with executing gnuplot.exe. This is the code: \...
2
votes
1answer
117 views

StrSubstitute not working nicely with pgfplots

This question is related to my older question here, but now slightly different. I now have a function that is supposed to take two multivalued arguments. One contains the columns i want to plot. If i ...
0
votes
1answer
686 views

pgfplots ybar glued to the y axis

My ybars are glued to my yaxis. How can I increase the horizontal space between the axis and the first bar, making them more condensed? I already tried setting x = 5cm for instance, but I just want ...
2
votes
1answer
624 views

Circuitikz works with ground but does not work for rground

If I try to plot the following circuitikz schematic it works: \begin{figure}[bth] \myfloatalign \begin{center} \begin{circuitikz}[american voltages] \draw (0,0) node[ground] {}...
2
votes
1answer
154 views

Footnote label in pgfplot

I can't find an answer to this problem. My problem is similar to this Footnote on graph title but I would like to have a footnote netxt to one of my x axis labels. Like this symbolic x coords={...
8
votes
1answer
667 views

Smooth pgfplots

I'm trying to draw the function $f(x,y) = -\log(x)-\log(y)$ as a surface with pgfplots. In order to get smooth level curves, I use a patch plot with patch type=biquadratic. \documentclass{standalone} ...
9
votes
1answer
1k views

Adding several labels (year/month) to a graph in pgfplots

I would like to add several labels to a plot in pgfplots: one label for the month and one for the year, just like in this graph: I tried to use the extra tick label, but I don't know how it is ...
9
votes
1answer
1k views

Drawing a ring around a torus (doughnut) using TikZ

I was trying to draw a 2-torus (a doughnut) using TikZ, based on the answer to my previous question Moebius Strip using Tikz, and got the following The result is impressive! However, the vertical ...
4
votes
1answer
2k views

Is there any good and complete tutorial for pgfplots

I'm working on converting matlab files to TiKz, and I wanted to do it as cute as possible... Can anybody help me to find a good and complete tutorial for "pgfplots" ?
4
votes
1answer
2k views

Label and ticks using pgfplots

I am using pgfplots to plot simple functions. For example, \begin{tikzpicture} \begin{axis}[grid=major,xmin=0,xmax=1,ymin=0,ymax=0.5] \addplot[color=black] coordinates { (0,0.2) (0.5,0.2) (1,0) }; \...
3
votes
1answer
901 views

Addplot3 with graphics / Image Offset to Axis

I'm currently working with tikz and pgfplots to set a few plots. It works marvelously for a lot of applications, add I have set a number of plots (especially surfaces from matlab) with help of the ...
6
votes
2answers
696 views

Plot basic complex transformation in LaTeX

I want to first draw a shaded region on a xy-plane: 0≤x 0≤y≤π and then the image of the above region mapped onto a uv-plane by the transformation f=exp(z), i.e. the shaded region: exp(0)...
3
votes
1answer
160 views

Persistent “hanging” tick label

I have sort of a strange problem. I produced a 3x2 plot array in Matlab, and removed all of the y-axis tick labels. The relevant code (for the problematic plot) is below \begin{tikzpicture} \begin{...
4
votes
1answer
236 views

Shading a strip between two intersection points of the curve with the axis

I wish to shade a small strip along the x-axis where the graph of a curve intersects the axis. I have used the following code \documentclass[12pt]{standalone} \usepackage{pgfplots} \usetikzlibrary{...
5
votes
1answer
912 views

Combine pgfplots on common background

This image is two tikzpictures side by side, each with a newsprint background (thanks to Background image for pgfplots chart). I want them combined, so they appear on the same torn sheet of newsprint....
3
votes
2answers
213 views

alignment of pgfplot's figures

I'm trying to put to put 2 graphs aligned, here is my MWE: \documentclass[11pt, letterpaper]{article} \usepackage{pgfplots} \usepackage{tikz} \usepackage{caption} \usepackage{subcaption} \usepackage[...
5
votes
2answers
754 views

Gradient colour in tikz pgfplot marker

I'm trying to replicate the dual colours of the circles in this graph: \documentclass[tikz,border={40pt 12pt}]{standalone} \usepackage{pgfplots} \usetikzlibrary{plotmarks} \begin{document} \begin{...
7
votes
1answer
2k views

Fitting a curve from a table! (Tikz/Pgfplots)

I ploted the data from the table below (first vs. fourth column), 3000 1.2970e+00 0.198956 0.258046 3100 8.6050e-01 0.18747 0.161318 3200 5.7970e-01 0....
5
votes
1answer
483 views

pgfplots pins in front of the axes

I wish to draw two pins on a plot: \documentclass{standalone} \usepackage{pgfplots,tikz} \begin{document} \begin{tikzpicture} \begin{axis} \addplot {x^2} node[pos=1,pin={[pin distance=0.5em, ...
18
votes
1answer
7k views

Remove the scientific notation which is unreasonable

From the original data, we know that they are nearly 0.087 rather that 0.087 x 10^-2. Why is there scientific notation (10^-2)? It looks ridiculous. Please help me figure it out. Thanks very much! ...
10
votes
1answer
621 views

pgfplots dollar sign in node, adjust space between bars

I'd like to format the nodes in this bar chart with $ signs (e.g $275). (The sets of bars could also be closer together; perhaps that should be another question.) The answer is probably out there ...