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

Add Whitespace Around Plot Marks

I have a simple graph in PGFPlots, where the marks of two different plots slightly overlap: Around 50 and 100 the graph gets a bit too busy, so I would like to add some whitespace around the marks, ...
3
votes
1answer
171 views

How do I apply “nodes near coords” to a single bar?

I want to change the position of a single node in a ybar plot. I know I am able to change the position of the nodes for a whole plot (by adding nodes near coords in the \addplot [...]), but in this ...
1
vote
0answers
22 views

pgfplots output shifted figures when plotting customized function

I'm plotting a function using pgfplot. But the output is has some extra white space on the left of the figure. It's really strange. Can someone shed some light on it? Code: \documentclass{article} ...
1
vote
0answers
46 views

Double y-axis in pgfplot for polar plots

Does anyone has a clue about how to "double" y-axis in polar plots using pgfplots? This question is related to this previous one: Polar plot using pgfplots/tikz Until now I only got the top part (as ...
4
votes
1answer
64 views

Multiplot pgfplots code not working properly

I have been trying to obtain this look with my code: So far I have been having a tough time. I put the group style as 3 by 3, but it appears that this may be the issue. Please help me get the ...
3
votes
1answer
43 views

pgfplots Plot moving down page with yrange

With the following: events.dat y mean lower upper 0 7.70234e-08 6.73448e-08 8.67019e-08 0.1 8.49244e-08 7.72264e-08 9.26225e-08 0.2 1.1735e-07 1.02559e-07 1.32141e-07 0.3 3.06841e-07 2.47066e-07 3....
6
votes
3answers
338 views

Plotting the graph for exp(cos(1/x))

I am having issues plotting the function exp(cos(1/x)) in the domain (0,1) with pgfplots and TikZ using a normal addplot command with the function exp(cos(deg(1/x))). It seems LaTeX is having some ...
3
votes
1answer
70 views

Define a systematic method to include pgf plots into jpg photos

I am including images into my LaTeX document and, overlapped to each image, I am adding a PGFplot, showing (a graph with) the environmental conditions when the photo was taken. I have the time-series ...
13
votes
1answer
234 views

Drawing the p,T-diagram with TikZ/pgfplots

I am trying to draw a p,T-diagram with TikZ using pgfplots as shown in the picture. All I have so far is: \documentclass[a4paper, 11pt]{scrartcl} \usepackage{tikz} \usepackage{pgfplots} \...
1
vote
0answers
62 views

pgfplot - keep legends widthin \linewidth when the are set outside

I'm using pgfplots, but i want to have my legends next to the plot. This is easy by setting legend style and anchor. But i also want the plot to be as big as possible. So if my labels are to long, ...
2
votes
1answer
39 views

Labels when using gaps between line and point in pgfplots

this is a follow up question to: Gap between line and point in pgfplots, like pointintervalbox in gnuplot. I would like to add a legend in the plot and maybe even on the y-axis. Unfortunatelly this ...
4
votes
1answer
777 views

Multi-line legend entry in pgfplots

In some of my plots the curve description in the legend is too long, making the legend going over the plot, even if the legend is placed as far away as possible. Therefore I want to have multiple ...
3
votes
1answer
70 views

Pgfplot Legend Type

I need a legend type given below. I want to write parameter values just once. How can i get this type legend. code example \documentclass{article} \usepackage{amsmath} \usepackage{amsfonts} ...
1
vote
0answers
25 views

Insert space after each second bar

I have a bar plot which shows 7 bars for one xtick. I want to group two bars by inserting some space after each second bar. I tried to use xshift in the \addplot command, but the color of the bar ...
3
votes
1answer
90 views

How to add multiple x axes with different scaling?

I am trying to plot the following graph (Standard Atmosphere) with pgfplots: What I currently have is: \documentclass[]{article} \usepackage{pgfplots,amsmath} \begin{document} \begin{tikzpicture} ...
2
votes
1answer
236 views

Same color for mark and label in scatter plot

I would like to obtain a scatter plot with marks and labels of the same color. I can get colored marks but labels stay stubbornly black: I would like 0's to be blue, 1's to be green etc. in the ...
1
vote
0answers
107 views

Multiple PGFPlots in single figure

I'm trying to remake these plots from an article about Nested Containment List by Alekseyenko: I have managed to do one plot: \documentclass{article} \usepackage[english]{babel} \usepackage{...
3
votes
1answer
87 views

3D surface mesh from external data with pgfplots

I have 5 Lines each with a varies values in y. The line in the middle (z constant = 30), The bottom two lines (left and right) are constant at z=0. The other 2 lines constant at z=15. For a give x-...
2
votes
2answers
131 views

pgfplots: annotate each bar in a group with custom values

how can I add custom annotations to each bar in a grouped bar chart? I know how to display the values from the the bars (with every node near...), but the values I need to display, above or below the ...
5
votes
2answers
230 views

Surface plus filled projection in pgfplots

Can something like this be done with pgfplots? It was generated with whe following gnuplot script: set view equal xy set view 72,32 set xyplane relative 0.2 unset key unset colorbox set samples 21 ...
1
vote
0answers
38 views

Protecting \@ifnextchar inside pgfplots

I'm having trouble figuring out what I need to do in order for my definition of \sin to be accepted by pgfplots. I've looked up stuff about using \protected but it's vague to me how I'm supposed to ...
1
vote
1answer
47 views

Using the tikzexternal.sty package together with legend to name feature

I am using the following TeX code (minimal example), which compiles fine, when running pdflatex then run make -f filename.makefile and repeat the procedure a second time to also include the referenced ...
2
votes
1answer
80 views

show last number in x-axis data on pgfplot

How can I get the last number on the x-axis (in this case 40^7) to show up on the plot also? Here is my code: \documentclass[11pt]{book} \usepackage{graphicx} \usepackage{tikz} \usepackage{float} \...
3
votes
1answer
165 views

Colormap with Tikz

What I have tried so far \documentclass[a4paper]{article} \usepackage{pgfplots} \begin{document} \pagestyle{empty} \begin{tikzpicture} \begin{axis}[view={0}{90}, colormap={custom}{...
2
votes
1answer
73 views

24h format in the x axis along a whole week

I want to show the evolution of a variable (var) along a week. My data is in a text file (available here). The time data is given in hours as shown in the following plot. Do you know how to show ...
2
votes
1answer
113 views

Using pgfplots to create 2-D parameterized parametric plot

I am attempting to create a parametric plot, actually two parametric plots on one axis. Nothing is coming out right and I think I need help. I admit to having less than an hour of time practicing on ...
6
votes
1answer
121 views

PGFPlots gnuplot contour … dimension too large?

I'm trying to make a contour plot with pgfplots and gnuplot, but I get the error "dimension too large". Why? That seems like a TeX error, I thought gnuplot was doing the calculations? \documentclass{...
1
vote
0answers
48 views

drawing a tangent on a graph in pgfplots [duplicate]

I need to draw a tangent to a graph at time = 4, 10, 16, and 24 on this graph. How would I go about drawing a tangent on it and measuring the gradient of the tangent? \begin{tikzpicture}[rotate=90] \...
0
votes
0answers
86 views

different line colors for intersectioned curve with pgfplots

I'm trying to use different line colors for a curve which is intersected by vertical lines. Everything works well if a \addplot[smooth,..] is used (solid,green/blue/orange curve), but for \addplot[...
4
votes
1answer
178 views

Specify ticks as micro seconds

I am trying to create a tick which uses e-6 as x axis. Now it automatically scales to e-5. \documentclass[tikz,border=10pt]{standalone} \usepackage{tikz} \usepackage{siunitx} \usepackage{pgfplots} \...
2
votes
1answer
58 views

PGFPlots cycle list skips first definition after every cycle

I got some problems with self-created cycle lists in PGFPlots. As you can see, the plots skip the first definition of my cycle list after every run through the cycle list. Are there any coding ...
3
votes
1answer
303 views

PDF file not printed

I am using MikTeX to compile the following code. Why isn't the pdf file printed? If I remove \usepackage{pgfplots} \pgfplotsset{compat=1.11} from the preamble of the code, a pdf file is printed. ...
5
votes
1answer
119 views

Multiple Gaussian curves in different locations in one Tikz figure

I want to have multiple Gaussian curves in different locations in one Tikz figure. I am unable to place each Gaussian curve on top of its intended point (2, 6 and 12 in the following code). Also, two ...
4
votes
2answers
237 views

How I can customize a legend on pgfplots?

I am trying to design a legend like picture. it has two column and each column has head text. Also, how I can control which item in first column and which one in second column? \documentclass{...
1
vote
2answers
154 views

the graph of f(x) = a + b.sin(cx + d), for d not null

I have a problem: the graph of $f(x) = a + b.sin(cx + d)$, for d not null do not work in tikz/pgfplot. Can anyone help, please. The problem, I think, is that I don't know how tikz/pgfplot convert to ...
1
vote
0answers
75 views

using pgfplotsinvokeforeach with addplot table

I have this minimal file: \documentclass[]{scrartcl} \usepackage{filecontents} \usepackage{pgfplots} \pgfplotstableset{ header=true, trim cells=true, col sep=comma, } \begin{document} \begin{...
5
votes
1answer
57 views

String concatenation macro to find file in pgfplots groupplots

I have a strange problem with pgfplots and using a macro to return a string to a file to be included. MWE Code: \documentclass[a4paper,10pt]{article} \usepackage{pgfplots} \usepgfplotslibrary{...
2
votes
1answer
75 views

Adding plots from large data files

I have the following "stardard file" for plotting data files from simulation results: \documentclass[tikz,border=10pt]{standalone} \usepackage{tikz} \usepackage{siunitx} \usepackage{pgfplots} \...
2
votes
1answer
107 views

tikzpicture[ ] and axis[ ] do not align

I would like to combine figures drawn outside of the scope of axis but inside the scope of \tikzpicture with figures inside the \axis environment. However they seem to leave in a different reference ...
5
votes
1answer
108 views

\addplot command fails to generate graph for function with rational exponents

I'm trying to plot the graph (x+2)^{1/2}(x-7)^{2/3}, using the code below, but after compiling the axis is present, but the plot is empty. Could anyone point out what I am missing? Any assistance ...
3
votes
1answer
99 views

Fix bounding box in pgfplots

I want to do the following: Do some draw or plot commands in pgfplots and then fix the bounding box. I.e. all plots which come afterwards shouldn't influence the bounding box. How can I do this? I ...
2
votes
1answer
78 views

Pgfplotstable: display numbers exact as written in file

My file is U(V) I(A) I/U 0.00 0.000 0 0.31 0.020 0.065 1.15 0.075 0.065 1.82 0.120 0.0659 2.73 0.178 0.0652 3.42 0.224 0.0655 5.08 0.333 0.0656 6.24 0....
3
votes
3answers
257 views

Draw a spline with pgfplots

Is it possible to simplify the code, that is to say not to use three times the command \addplot[] ? \documentclass[tikz]{standalone} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \...
3
votes
0answers
111 views

Doing surf plot with user defined colormap

I want to make pgfplot surf with my colormap rainbow. The funny thing is that I get error I do not know the key '/pgfplots/colormap/rainbow' and I am going to ignore it. Perhaps you misspelled it. ...
3
votes
1answer
46 views

pgfplot is joinint my first and last point

Here is a minimal working example: \documentclass[12pt]{article} \usepackage{amsmath} \usepackage{enumerate} \usepackage{tikz} \usepackage{xcolor} \usepackage{tikz-3dplot} \usepackage{hyperref} \...
3
votes
1answer
187 views

PGFPlots — custom colors for ticks labels

Is there any way to change a color of a single tick label? I need some labels to be black and others to be blue and red. \documentclass[png,border=4pt]{standalone} \usepackage{tikz} \usepackage{...
4
votes
1answer
124 views

I am trying to plot area vs volume

I am writing a lab report in chemistry discussing the surface of catalysts. I want to show that area doesn't increase proportionally to volume. I have been trying to plot a function vs against another ...
3
votes
1answer
46 views

bug in pgfplots+subcaption?

I'm using pgfplots (with the excellent matlab2tikz), pgfplotstable and subcaptionbox together, and for some inexplicable reason (at least to me), the command \pgfplotsforeachungrouped seems to break ...
1
vote
1answer
537 views

pgfplot axis title position

I would like to obtain the result that appear on the right (compiling the following MWE) by using title style: \documentclass{standalone} \usepackage{calc} \usepackage{tikz} \...
2
votes
1answer
117 views

Give a threshold value to automated ymin and ymax

In pgfplot, is it possible to give the automated scaling of your axis a minimal/maximal value? In other words; I want to have y=0 always on the vertical axis in a way like: ymin=min(0,...