{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

5
votes
1answer
58 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
144 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
58 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
127 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
288 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
175 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
120 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
76 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
70 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
107 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
54 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 ...
5
votes
1answer
84 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
57 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 ...
6
votes
1answer
134 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} ...
1
vote
1answer
46 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
79 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
66 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
101 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 ...
4
votes
3answers
223 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
88 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
100 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
71 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
88 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} ...
1
vote
1answer
64 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
69 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
74 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
64 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 ...
2
votes
4answers
173 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 ...
6
votes
1answer
115 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
66 views

Last version of pgfplots, error with LuaLaTeX

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
127 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
199 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 ...
2
votes
1answer
70 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}\,+, ...
3
votes
0answers
162 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
76 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 ...
4
votes
2answers
88 views

Define exceptions from global pgfplotsset settings

I am using the following code in the preamble to set the position of my axis labels: \pgfplotsset{ every axis y label/.style={at={(-0.1,0.5)},rotate=90} } I have roughly 10 plots, where this ...
4
votes
1answer
95 views

Positioning Even or Odd x axis tick labels in PGFPlots

I am wondering if it is possible in PGFPlots to position separately only the Odd x-tick labels (or Even). The reason is that, my x-axis labels look congested. In Tikz datavisualization, I have noticed ...
1
vote
1answer
112 views

rectangle in 3d plane

I am trying to plot a 3d axis with a rectangle perpendicular to the x-plane using the following code: \documentclass[tikz]{standalone} \usepackage{pgfplots,pgfplotstable} \usetikzlibrary{calc} ...
1
vote
1answer
100 views

Modify tikzpicture plot outside .tikz file

I am not sure if my title gets through what I'm after, but basically I am using matlab2tikz to generate some plots for me and am wondering how you can do some modifications from outside the .tikz ...
4
votes
0answers
95 views

grouped bar colors in pgfplots

I have a simple grouped bar chart but would like to have all group bars the same color. Currently each bar in a group is colored, possibly because of the way I have used addplot. I've tried to use a ...
3
votes
1answer
82 views

How to add a 2d plot to a 3d axis drawing?

My task is quite simple. I want to add to my 3d axis drawing a 2d plot. My closes result is this: \begin{tikzpicture} \begin{axis}[ axis equal, view={45}{30}, ...
8
votes
3answers
259 views

Filling in the area under a normal distribution curve

I'm trying to fill the area between the two $z$-scores but I'm not having any luck. Could someone please help me with this? \begin{tikzpicture} \begin{axis}[ no markers, domain=0:6, ...
3
votes
1answer
74 views

Unable to read in text labels for pgfplots bar chart

I've started using pgfplots and can plot scatter plots where all data is numeric, but I'm having no luck at all with bar charts where the xlabel is text. I've tried to find a solution in the manual ...
2
votes
2answers
107 views

precision in xy axis in tikz

I have this code \begin{tikzpicture} \begin{axis}[% width=\figurewidth, height=\figureheight, scale only axis, xmin=0, xmax=1.5e-05, ymin=1.222e-07, ymax=1.224e-07 ] \addplot [color=red,line ...
3
votes
1answer
60 views

Dimension too large in pgf plot

I am trying to create a pgf plot which includes (among others) a constant function f(x)=1. My x-axis should be restricted to some range (see below), and there is also a restriction on the y-axis. This ...
2
votes
2answers
163 views

pgfplots surf plot: don't draw 'NaN'

I generated a checkerboard style suface plot using matlab2tikz. The data contains nan (not a number) values. I want the squares of nan values to be white (as in matlab). When I compile, I get the ...
4
votes
1answer
123 views

How to differentiate many lines in a chart? [duplicate]

I create a chart with many (actually 10) lines in different colors (see example). I want to make it as easy as possible to differentiate the different lines. Some possibilities I have in mind: ...