{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

1
vote
0answers
92 views

Error using lualatex and tikzexternalize to compile document with PGFPlots

I have a fairly large document with a number of pgfplots diagrams and due to memory capacity limits in PDFLaTeX I am now using LuaLaTeX to compile. While this works well, it takes forever to produce ...
3
votes
1answer
91 views

Area restricted by three functions

I am trying to shade the area restricted by the functions y \sin x, x = \sin y and y = 2pi + x. Now my problem is that I do not have access to Pgfplots 1.10so the libary fillbetween is not accessible ...
3
votes
1answer
92 views

Bar plot in PGF plots with no upper limit

I assesed particke size distribution using sieve analysis. Now I want to present the results using PGFplots. The largest opening was 1 mm. I can plot finite intervals (e.g. 0.25 mm -- 0.50 mm), but I ...
7
votes
2answers
90 views

Linear and non-linear functions inside \addplot to get a unique legend

I have functions which have two intervals, a linear and non-linear. I want to have these inside the command \addplot in pgfplots, to get only one legend. I tried it with them in a separated write, but ...
2
votes
1answer
60 views

Using \foreach to manage ticks in axis, Tikz

I want to add minor distance between y ticks. The default distance is 0.5, I need to set for 0.2. It seems easy to set different space for ticks according to pgfplots, in 4.15, page 271. I add the ...
6
votes
3answers
158 views

Grid dots in pgfplots

How can I generate a multi-resolution dot grid (see image) in pgfplots? The dot grid does not necessarily coincide with the axis ticks. edit: The above plot was created using \addplot[only ...
3
votes
0answers
75 views

pgfplots: unable to affect cycle list name while using \pgfplotsinvokeforeach

I am unable to use custom colors from cycle list name with pgfplotsinvokeforeach. Some pointers could be gauged from this post, which discusses execution of various steps in a plot function. In the ...
2
votes
3answers
78 views

Different xlabels for same x values on different plots

I have two tables that hold different values for the same x values. To compare them, I want to plot both of them in the same plot but with different xlabels. The tables should remain the same, i.e. I ...
10
votes
4answers
259 views

Plot the cusp catastrophe surface

I'm trying to draw (plot) the Cusp catastrophe surface into latex using any software logic. I am completely stuck because I'm definitely not a mathematician. The surface has the potential: V(x) = ...
3
votes
1answer
49 views

ybar overlaps axis line (and xtick removal)

When I use the MWE below my bar plots are overlapping partly the black x-axis How is it possible that the bar graph starts exactly above the x-axis and not on top of it? And is there a way to ...
4
votes
2answers
72 views

Align axis of separate plots in pgfplots

I am preparing a talk using plots generated in pgfplots' axis-environment. I want the plots' axes to be of the exact same size and position. Unfortunately, plots with different axis- and plot-labels ...
2
votes
1answer
55 views

Pgfplot axis and axis label cutomization

Well, simply, my code gives the graph below. But what I want is something like Fig. 30 (p. 56, Advanced Engineering Mathematics, 9th Ed. by Irvine Kreszig). \ssfamily font for the tick label, ...
4
votes
2answers
95 views

How to have two x parallel xtick labels in a single pgfplots plot?

I want to have this effect: The first set of xtick labels are exactly the first column in this table (is there such a command?); Then, under this first set of label, there should be another xtick ...
9
votes
2answers
105 views

pgfplots 3d cylindrical coordinate system

I am trying to plot a cylindrical coordinate system using pgfplots. The idea would be to plot the r,theta plane similar to what polaraxis provides, see here. I don't know how to translate something ...
7
votes
1answer
171 views

How to retrieve color from a specific location and use it?

Please save your time and energy on this question, this is not an important one. What's the color in the middle (or anywhere else) in these pictures? How to retrieve/compute that color to be ...
6
votes
1answer
53 views

Automatically convert colored PGFPlots in the appendix to grayscale

My document contains a lot of colored PGFPlots, which are generated from external data files. In order to save costs when printing, I would like to automatically convert the color of every PGFPlot in ...
5
votes
2answers
69 views

How can use pgfplots to fill below for a semilogy axis?

I am plotting my y axis on a log scale, and many of the y values are less then one. Using the following code: \documentclass[12pt]{article} \usepackage{tikz} \usepackage{pgfplots} % drawing plots ...
3
votes
2answers
130 views

TikZ, PGFPlots, or GNUplot: plotting a curve without the known function

I would like to make a plot of a function that has an overshoot of 25% and then settles with subtle oscillations at 100%. I would like to create it in one of the listed packages or in gnus case add ...
2
votes
2answers
99 views

PgfPlots column name with multiple words

I have a simple data file consisting of two columns (x and y coordinates). I would like the first row of the file to be the names for the columns. I would like the user to have the option to specify ...
2
votes
1answer
149 views

Peculiar tikz-external, pgfplots, tikzscale combination problem

I want to use \tikzexternalize and tikzscale with pgfplots' \addplot graphics command and \clip=false option. I am using three files: A.png, A.tikz and A.tex. A.png can be any graphics file. A.tikz ...
9
votes
2answers
158 views

create a stacked histogram with tikz

I try to create a stacked histogram. Like this: My data consists of classes (0-4) and a float value for each class. I already have a histogram for all mean values. But I would like to color the ...
5
votes
1answer
55 views

pgfplots “Dimension too large” returned when plotting rational function

I've been using pgfplots for graphing for a while, now, and have recently run into a situation where I need to graph rational functions. Most of these have worked out fine, but one has caused me to ...
2
votes
1answer
103 views

How to plot a normal curve with proper y-values

Follow-up question to Plotting bell shaped curve in TikZ-PGF I'm new to LaTeX, and I'm typesetting a document for my stats class, and trying to use LaTeX to produce a normal probability distribution. ...
4
votes
1answer
80 views

Opacity for pst-3dplot object

How can the opacity of a pst-3dplot object be set to be transparent? I have an example where using opacity or strokeopacity options do not work. I am trying to make an image similar to the following: ...
6
votes
1answer
72 views

Strange Vertical Grid in TiKZ bar plots

I've trying to make a set of bar plots using TiKZ and pgfplots but for some unknown reason, the plot displays a vertical grid in X = 1, even when there is no grid added to the graph. Is there a way ...
1
vote
0answers
21 views

Adding legends to tikzpicture [duplicate]

I have tikzpicture (with 3 graphs from my data files. I want to add legends to data1, data2 and data3 to my picture, is it possible? \documentclass[english]{article} \usepackage{tikz} ...
0
votes
0answers
40 views

PGFPLOT Externalization not working

I am trying to externalize PGF Plot to be saved as EPS file using latex and enabled shell-escape. \documentclass[a4paper]{article} \usepackage{lipsum} \usepackage{tikz} ...
3
votes
0answers
70 views

External PDF from pgfplots contains several pages when with floatrow

Plotting with pgfplots and the external library creates the single PDFs for every plot as wanted. But every of those PDFs contains several pages, each showing the same plot. Sometimes there are three ...
2
votes
1answer
61 views

Exclude certain plot points from smoothing

How do I exclude certain coordinates from being smoothed by the "smooth" option in a PGF plot? How do I avoid that \closedcycle jumps to zero? Here is my example: \documentclass{minimal} ...
4
votes
3answers
112 views

Positioning pgfplots axis in tikzpicture

I want to put a pgfplots plot beside several other pdf images that I import into my document, but I can't figure out how to position the pgfplots axis in the larger tikzpicture: ...
1
vote
0answers
53 views

Plotting Multiple Time Series plots in LaTeX using PGFplots and txt files - Relativity Issues

I have a problem with plotting multiple time series plots in a single graph in Latex. Background: I have three products - Potatoes, Apples, and Oranges. Each products' historical price and ...
7
votes
1answer
137 views

How to interrupt a plot?

Please consider the following example code: \documentclass{article} \usepackage{pgfplotstable} \pgfplotstableread{ 1 19.178 26.027 8.219 6.849 39.726 1 2 54.795 21.918 4.110 6.849 ...
3
votes
1answer
40 views

pgfplots bar chart: single symbolic x coord results in “! Package pgfplots Warning: Axis range for axis x is approximately empty; enlarging it”

How to avoid the error "! Package pgfplots Warning: Axis range for axis x is approximately empty; enlarging it" when there is only a single symbolic x coord in bar chart. Please see the following MWE: ...
1
vote
2answers
123 views

Inserting graphics into asymptote or pgfplots

How another graphics can be inserted into Asymptote or pgfplots? The following is a MWE in pgfplots that creates three figures in the document. The main figure which I want to insert graphics in is a ...
5
votes
1answer
61 views

Nested ifnum conditional groupplots with pgfplots?

I want to use groupplots, and set a variable to conditionally plot the plots. Here is the minimal non-working example: \documentclass{article} \usepackage{pgfplots} \usetikzlibrary{calc} ...
3
votes
1answer
40 views

Plot legend without line break

I am having a plot with legend entries. The entries are not really long, it would be nice to have them in a single row. The default behavior adds a line break after each entry. Furthermore, the are ...
2
votes
1answer
47 views

Add label to bars in bar chart

I am trying to get labels over the bars in my bar chart. I found \node [above] at (axis cs: 1, 810) {$Q1$};, but this one centers itself in the middle between two bars. I want the value from the ...
2
votes
1answer
82 views

Uniform appearance of tick marks in 3d pgfplot?

In the default configuration the tick marks in a 3d plot from pgfplots are looking nicely when using a box but in my opinion not really uniform when the axis lines are in the center. Is there any ...
2
votes
1answer
37 views

Apply shift to (current axis.left of origin)

I was trying to improve the solution at Drawing lines in a plot and give them a label? by using Jake's answer at How to access \xmin, \xmax, \ymin, \ymax from within PGFplots axis environment. So, ...
5
votes
1answer
57 views

pgfplots with nonlinearly scaled color maps

This here is a question which came on the pgfplots mailing list; I answer it here since this allows an answer of higher quality. I have a picture that uses a diverging color map. In this case, ...
5
votes
1answer
129 views

Line graph superimposed on “Grouped Stacked” bar graph with pgfplots?

I need to superimpose a line graph over a stacked grouped bar graph (similar to answer to the question: Two level labels in bar plot). I have to superimpose a line graph for each group (it breaks at ...
3
votes
1answer
107 views

Draw a surface from scattered curves

I have a few curves determined by some points. I need to plot the surface that they determine. That is, I have this \begin{tikzpicture}[scale=0.8] \begin{axis}[% width=12cm,height=12cm, xmin=0, ...
6
votes
1answer
56 views

pfgplots: axis with empty range

With the following MWE (I want to plot a bar chart with symbolic coordinates using pgfplots) I get an error that I have no idea how to fix: Package pgfplots Warning: You have an axis with empty range ...
7
votes
1answer
125 views

Color and legend for 3d surface

I'm trying to plot a 3d surface using pgfplots and this is what I have done so far: \usepgfplotslibrary{patchplots} \begin{tikzpicture} \begin{axis}[% width=12cm,height=12cm, xlabel={$J_1$}, ...
10
votes
2answers
286 views

How can I produce such a graph of my piecewise function?

I am writing my thesis in behavioural economics and have to draw individual discount functions, I did the following graph with stata, but would love to have it with tikz. I played around in tikz ...
4
votes
3answers
171 views

pgfplots: Plot inverse function (function of y)

I am trying to plot the Ramberg-Osgood-relationship for a specific material with pgfplots. The relationship describes the stress-strain-curve, that is the stress as a function of the strain. The ...
5
votes
2answers
119 views

Is it possible to extrapolate data for a 3d-plot in pgfplots?

I am having several measurements to plot and would like to use something like a 3d surface from pgfplots. I am having a frame as outer border and a grid as measurement raster. The measured values are ...
2
votes
1answer
50 views

PGFPlots: Plot regression line and 45 line for a range of values

I have a regression that has the following simple format: ln(Y) = C + lf(X). It's estimated as ln(Y) = 0.62 + 0.81. I want to plot it for a range of values for X (0 to 50) and compare it with a 45 ...
2
votes
1answer
25 views

Import tex graphics to my main tex document

I want to create various plots with tikz package. I don't want to have the code for the plots in my main tex document because it's pretty messy. Is there a way to keep the tex code to different ...
4
votes
1answer
75 views

Preserving styles while changing axis y line in pgfplots

The code for the MWE generating this image is given below (click for full-size): Basically, I had some graphs like on the left, until I realized I need to shift the x axis - this also forces me to ...