{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

3
votes
0answers
122 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
102 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} ...
5
votes
3answers
2k 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
1answer
599 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
203 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
136 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: ...
2
votes
2answers
393 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
203 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} ...
4
votes
1answer
173 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
500 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
151 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
192 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
151 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
543 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
170 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
284 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
326 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
433 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 ...
5
votes
3answers
417 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
170 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
96 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
49 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
214 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 ...
1
vote
1answer
179 views

Overlapping transparent impulses (ycomb) with pgfplots?

Consider the following MWE: \documentclass[% 12pt, journal, twoside, draftcls, letterpaper, ]{IEEEtran} \usepackage{pgfplots} \usepackage{pgfplotstable} \usepackage{tikz} ...
0
votes
1answer
175 views

Aligning .tikz pgfplots with semi custom styles

Previously I was helped with how to align and position graphs in a table with optional subplots in this question: Overlay two .tikz files from input It worked great, but I was not happy using scaling ...
2
votes
1answer
82 views

Custom style just for width and height?

I have some pgfplot graphs in .tikz files and I want to define a custom style to them that only overrides some entries, and uses whats in the .tikz files for the rest. Example: In my .tikz file I ...
6
votes
1answer
176 views

Why doesn't a \foreach variable work in \draw in an \axis?

I'm finding some weird behavior with TikZ's \foreach within an \begin{axis} environment. This works: \foreach \x in {-2,-1,...,2} { \addplot[thick, domain=0.05+(\x*2-1)*pi/2:+(\x*2+1)*pi/2-0.05] ...
1
vote
1answer
294 views

how to add annotation to ybar pgfplots with symbolic x coords

I would like to add an annotation, or better, an arrow to a particular ybar in a plot, but I am struggling with the symbolic x data. I've used \pgfplotsinvokeforeach to read in variable data, and so ...
7
votes
1answer
289 views

Tufte style range frames for three dimensional plots

This question is a follow up to this question, that allowed me to solve the two dimensional case. For example this plot is created by the following code: \documentclass{minimal} \usepackage{tikz} ...
2
votes
1answer
148 views

How the plot in \groupplot could be moved horizontally and vertically?

This is my code: \documentclass[tikz,12pt]{standalone} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{mathptmx} \usetikzlibrary{pgfplots.groupplots} ...
2
votes
1answer
414 views

Simple Line-Plot with date on x-axis

I need to do a really simple line plot and my data is looking like this: Date Value Apr2013 0.06 Mai2013 0.08 Jun2013 0.1 Jul2013 0.2 Aug2013 0.4 Sep2013 1.5 Okt2013 2.0 Nov2013 4.1 Dez2013 8.1 ...
3
votes
1answer
144 views

Convert PGFplot to html?

I'd like to convert a simple piece of LaTeX code which is basically some text with some centered graphs in between. This is a dummy version of the code I'd like to convert to HTML: ...
2
votes
1answer
162 views

Adjusting pgfplots

I am having trouble controlling the axes in pgfplots. I have defined an evironment for graphs \newenvironment{graph}[3][]{\begin{figure}[htp] \def\tempa{#1} %Saves caption since \end cannot take ...
5
votes
3answers
432 views

Fill the area under minimum of two functions using tikz and pgfplots

I am loading two curves from a file and plot them with \addplot table [...] {the table.txt}; I have managed to fill the area under a single curve, but I want the minimum of the two curves filled. What ...
3
votes
1answer
301 views

define manually the position of a pgfplots plot inside the TikZ picture

I just started using matlab2tikz for the graphics in my thesis and got stuck with a probably simple problem: I have a plot of a function and an inset (zoom-in) on it. Both the main plot and the inset ...
2
votes
1answer
359 views

PGFPlots and gnuplot: How to add asymptote, a xtick that isn't a number, and can intersection be used?

\documentclass[tikz, convert = false]{standalone} \usepackage[utf8]{inputenx}% http://ctan.org/pkg/inputenx % Euler for math | Palatino for rm | Helvetica for ss | Courier for tt ...
1
vote
1answer
734 views

! Package tikz Error: missing semicolon [closed]

I have found this sample of code from here: Block diagram generation in LaTeX. Initially I had some problems while I was compiling the code and I solved them due to copy paste features some of the ...
4
votes
1answer
160 views

Grouped BarChart

I would like to have all 4 graphs on one page (one panel) by using minipage. Also is it possible that I can have my graphs standing vertical instead of horizontal? Thank you. \documentclass{article} ...
2
votes
1answer
189 views

particular prominent yticklabels

Since the paraview legends look horrible when they appear inside a latex document, I want to replace them using Python's matplotlib and Nico's matplotlib2tikz package. So I have compiled a python ...
4
votes
1answer
180 views

pgfplots axis multiplier \times symbol

Similar to this question, I want the scientific \times symbol instead of the * symbol for pgfplots' multipliers. However, I need it for the whole axis-multiplier and not for every tick like in the ...
1
vote
1answer
118 views

How can I resolve the side effects of AddEverypageHook to external pgfplots?

I have quite a huge document with many pgfplots, which I would like to externalize. Well I can externalize them, but my \AddEverypageHook command from the everypage package affects this externalized ...
2
votes
1answer
200 views

PGF Plot correlation table shade negative/ positive values gradient

I am trying to extend the results from Parametrize shading in table through TikZ for negative values. I searched extensively for the absolute value function but could not find one. I tried abs(), but ...
4
votes
4answers
3k views

Pgfplots: how to fill bounded area under a curve using addplot and fill?

I am looking shade the bounded area under the graph of f(x)=x^2 from 0 to 1. For my other plots I was fine using the shading with coordinates because they were all polygons. I've come across a bunch ...
10
votes
1answer
170 views

Adding a “passive” plot in pgfplots

I would like to add a plot to a pgfplots figure, but such that it doesn't change the automatically computed limits. for example: \documentclass{article} \usepackage{tikz,pgfplots} \begin{document} ...
1
vote
0answers
127 views

Last version of pgfplots, error with LuaLaTeX [closed]

I have just installed the last version of pgfplots (version 1.10) in my local texmf directory but when I try to compile a file with LuaLaTeX I get the following error: ...
1
vote
0answers
550 views

! I can't find file `pgfutil-common-lists.tex'. \input pgfutil-common-lists.tex [closed]

I've recently run into the following error message that I have no idea on how to resolve: ! I can't find file `pgfutil-common-lists.tex'. \input pgfutil-common-lists.tex It occurs when I use the ...
7
votes
1answer
292 views

Overlay two .tikz files from input

I have some plots generated from matlab2tikz which I would like to overlay. Each plot is a seperate .tikz file which I input using \input. My code currently is: \pgfplotsset{ every axis/.append ...
3
votes
1answer
214 views

How only one x tick label could be changed in pfgplots?

I'd like to have this x axis using pgfplots: , where only number 4 has + as tick label. I could easily make all numbers have + tick label by adding xticklabel=\pgfmathprintnumber{\tick}\,+, ...
4
votes
0answers
392 views

Decorating a PGFPlots bar graph with Tikz decorations

Update :- This appears to be a problem in which nodes near coords are handled by PGFPlots and incompatibility with Tikz decorations and fading library. I simply commented the nodes near coords line ...
1
vote
0answers
173 views

Problem with PGFPlots and Tikz fading library with disappearance of nodes near coords and irregular fades

It seems like whenever I turn on Fading from Tikz Fading library, the nodes near coords parameter to the axis environment is not processed by PGFPlots correctly. I am attaching the code and the image ...