{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
1answer
32 views

Fail to produce valid PDF from pgfplots sample code

I use the following the pgfplots sample code: \documentclass[varwidth=true, border=2pt]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ ...
2
votes
2answers
43 views

PGF-Plot not at centre

I would like to plot some circles with pgfplots inside a diagram, however, they are always off-centered. \pgfplotsset{width=7cm, compat=1.12} \pgfplotsset{compat=1.5.1} \begin{tikzpicture} ...
5
votes
1answer
60 views

Key names of the axis limits when not set explicitly

In the minimum working example below I use the keys xmin, xmax, ymin and ymax for calculations of coordinates for annotations. However, this only works when the axis limits are set explicitly in the ...
2
votes
1answer
86 views

Why am I getting those pgfkeys errors?

Suddenly, most of the figures don't appear in the document and the first error is ! package pgfkeys error: choice '1.8' unknown in key '/pgfplots/compat/anchors' Another error: ! package pgfkeys ...
4
votes
0answers
38 views

Setting Folder for Data pgfplots in LyX

I'm trying to get a figure in my LaTeX document, but I struggle to set the search-path I use \addplot[blue] table {invcum.dat}; from the example, however it keeps saying ! Package pgfplots Error: ...
3
votes
2answers
72 views

Why does adding multiple addplots shift my axis?

I was trying to define an axis environment within a node. Upon adding multiple addplots I observed a shift in the axis position, shifting further for more addplots. Below is an example to recreate the ...
4
votes
1answer
51 views

Plot instance missing in PGFplots

I have written a small macro to draw triangles with slope in PGFplots axis environments. I try to draw two of these triangles. However, the first one is missing for some reason. How can I resolve ...
11
votes
4answers
793 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) = ...
2
votes
1answer
42 views

Subfigures are not bottom aligned

I'm trying to bottom align two pgfplots figures (both have width=95\textwidth set) and also have a bounding box drawn. The relevant code that sets up the two subfigures: \begin{figure} \centering ...
3
votes
2answers
39 views

tabular doesn't give two equally-size figures

I have produced two boxplots. Amplification.tex: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \usepgfplotslibrary{statistics} \begin{document} \begin{tikzpicture} ...
2
votes
0answers
20 views

pgfplots: tik labels missing and axis labels are inside plot [duplicate]

I am having major trouble in getting pgfplots to work on my Ubuntu 14 System. I am running the minimum example from http://www.texample.net/tikz/examples/pgfplots/ and the result looks like the ...
11
votes
2answers
2k views

How to access \xmin, \xmax, \ymin, \ymax from within PGFplots axis environment

In the MWE example below I have the values specified twice, but would prefer not to have to do that. Furthermore, it is possible to allow PGFplots to automatically select these end points so I would ...
5
votes
2answers
50 views

adding nodes to line segments

I have the following code: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \usepackage[active,float]{preview} \usetikzlibrary{calc} ...
3
votes
1answer
48 views

TeXstudio - get output of pgf externalize in log Window

I like the functionality of TeXstudio to show me errors concerning my latex-code in the Log-window. If I use pgfplots and externalize all externalized pictures are compiled in a separate call. So I ...
1
vote
0answers
47 views

pgfplot mesh with end arrow decoration

Inspired by this question I tried to decorate my pgfplot mesh with an end arrow. However, this end arrow is not properly positioned so that the end of the line shows behind the arrow tip. Here is a ...
3
votes
0answers
56 views

PGFPLOTS Graph with many x values for the same y label

I am trying to create a diagram with PGFPLOTS like this: This is my data file: SN STAR PLANET R RU RL 1 51 Peg b 0.0521068 0.000868447 0.000868447 2 55 Cnc b 0.113377 ...
3
votes
2answers
160 views

Monte Carlo Method Drawing

I would like to produce a Monte-Carlo-Plot with tikz and pgfplots, similar to this: I've already tried to adapt from this thread: Filling specified area by random dots in TikZ I've tried defining ...
2
votes
1answer
61 views

Ticks vanish in pgfplots if groupplot is combined with set layers and axis on top

I am trying to use set layers to get the grid behind the tick labels and axis on top=true to get the axis on top of the plot lines. If I use these settings in a groupplot neither the ticks nor their ...
3
votes
2answers
234 views

Calculation of coordinates for TikZ annotations in PGFplots axis environment

I'm trying to do some annotation with TikZ in a PGFplots axis environment by means of nodes. However, the placement of the nodes is going wrong all the time, see the minimum working example below. How ...
0
votes
1answer
121 views

How to make a Minkowski Diagram [closed]

I just started using LaTeX and need some assistance creating a diagram like this. Except I don't need multiple hyperbolas, just one. My trouble is making the hyperbolas using \addplot. I was able to ...
1
vote
0answers
129 views

Error using tikz externalize: can't write md5 file

I tried to use the externalize library. It worked fine when all my files where located in the same folder. Usually I am using a subfolder as build folder, where all generated files should be stored. ...
16
votes
6answers
684 views

Draw a smooth surface

I would like to draw a smooth surface like http://mathematica.stackexchange.com/questions/20912/how-to-draw-a-higher-genus-surface but using Asymptote, TikZ, Metapost, PStricks, or other TeX friendly ...
5
votes
1answer
106 views

Draw the plane x+y=1 in three dimensions in pgfplots

I want to draw the plane x+y=1 in pgfplots. In this example, z is free and is not explicitly a function of x and y. So I cannot use \addplot3[surf, fill=blue, opacity=0.1, fill opacity=0.4] ...
3
votes
2answers
26 views

Align of the x coords in pgfplots

I have this code \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
4
votes
2answers
83 views

Problem with tikz foreach

I am using a foreach loop to add plots to an axis environment and want each plot to have its own color. To achieve this I tried the following: \foreach \x/\barcolor in {1/red, 2/green, 3/blue, ...
2
votes
1answer
28 views

Automated plotting with \input inside \addplot

I'm trying to draw some figures with externally generated data. I'd like to draw a simple line inside a tikzpicture using pgfplots like so: \documentclass{article} \usepackage{pgfplots} ...
3
votes
1answer
34 views

Number format for a node

In the following minimum working example, how do I change number format that is used for the node? For instance, cut off the number after 5 digits. \documentclass{standalone} \usepackage{currfile} ...
2
votes
1answer
35 views

Using math-mode in pgfplots axis unit

I want to apply a unit to my axis. Usually I use the siunitx package for that. However, this time I would like to use a Greek letter with a subscript \mu_\text{B} but my document won't compile. Here ...
5
votes
2answers
125 views

Setting all nodes to use \sffamily without overriding font size

In my document, I want all labels in tikz and pgfplots graphics to use sans-serif, so I use \tikzset{every node/.append style={font=\sffamily}}. This works. However, when I use this, inside my axis ...
2
votes
1answer
68 views

Same pgfplots within standalone for usage in elsarticle and revtex4-1

Suppose I have created a plot with pgfplots for a scientific paper. However, for usual reasons the targeted journal is not certain. Possibly the plot has to be adjusted to match different journals ...
1
vote
0answers
77 views

Crowded contour plot lines

Many thanks to Harish Kumar for getting me this far. He made an immense difference with a single character here :) I have a contour plot that is, to be frank, ugly. The surface it was generated ...
3
votes
1answer
93 views

Contour Plots in Groupplot

I am trying to produce a groupplot with two contour plots. I suspect I could work this out on my own given enough time to play with it, but I am up against a bit of a time crunch... As background, ...
9
votes
3answers
225 views

Make plot smoother in pgfplots

I'm trying to plot a function using pgfplots: \documentclass{scrartcl} \usepackage{pgfplots} \pgfplotsset{compat = 1.12} \newcommand{\param}{2.0} \begin{document} \begin{tikzpicture} ...
10
votes
4answers
238 views

How to point an equation to a curve

I have the following code: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.7} \begin{document} \begin{tikzpicture}[>=latex] \begin{axis}[grid=both, axis x ...
4
votes
2answers
81 views

Coordinate transformations: PGFPLOTS to and from PGF

How can I scale a calculated length to the appropriate axis scale? In this example I would expect 2. See below. \documentclass[tikz]{standalone} \usepackage{pgfplots} \usetikzlibrary{calc} ...
1
vote
0answers
45 views

How do I change the color of average in boxplot n pgfplots?

I have a simple graph using boxplot and I'm trying to customize the look. I'm part way there, but am having trouble with the average. where I have changed the color of the box and the median, but the ...
1
vote
1answer
45 views

Problem externalizing pgfplot figure with two parallel LaTeX distributions

I am getting errors when trying to compile this minimal example, using both externalize function in pgfplots and loading siunitx. \documentclass{article} \usepackage{siunitx} \usepackage{pgfplots} ...
4
votes
0answers
62 views

pgfplots skip hours

For my current project, I need to display a series of percentage changes in a plot. This is the code I have so far \documentclass[a4paper]{article} \usepackage{pgfplots} \pgfplotsset{compat=1.11} ...
2
votes
1answer
41 views

Pgfplots “set thousands separator” introduces errors for < 0.1

I don't want the comma as the thousand separator, so in the preamble I set \pgfplotsset{ x tick label style={/pgf/number format/.cd, set thousands separator={}} } This works OK, but when I try ...
2
votes
1answer
47 views

Skip “Inf” values when plotting data with pgfplots

I know that with pgfplots you can skip "unbounded coords", but latex only accepts "nan", "inf" and "-inf" (and actually different capitalization for "nan" also) as the unbounded coords. My data ...
5
votes
1answer
2k views

Draw a vertical line with filled areas and dateplot

I'like to add an vertical line with some text in a graphic, but i've not found the way. I tried something like \addplot coordinates { (2008-01-01,0) (2008-01-01,130)} node {some text}; but it ...
1
vote
1answer
32 views

pgfplots axis labels in wrong place after scaling

When using the scale key for tikzpicture, the axis labels of pgfplots are no longer in the correct place. In the example below, the first axis environment is not within a scaled tikzpicture ...
1
vote
1answer
67 views

Create a plot line with a gradient

TikZ allows you to have shapes with gradients like this \fill [ left color=red, right color=blue, ] (0,0) circle is the same possible for a plot line? Something like \addplot[very thick, ...
1
vote
0answers
58 views

Bar plot with y-error and nodes near coords

I have to plot some data as a bar plot. These data is processed with pgfplotstable, so I can plot the mean and the error for my data. Now I want to print the nodes near coords for each of the bars; ...
2
votes
2answers
43 views

Changing number precision on y-axes

When I try to plot this: \begin{tikzpicture} \begin{axis}[% scale=1.5, max space between ticks=25, ticklabel style={font=\scriptsize}, axis lines = middle, xmin=-8000, xmax=9000, ...
3
votes
1answer
151 views

How to pass a function defined in sagetex to pgfplots

Is there any way to pass a function defined in sagtex to pgfplots for plotting? See the following example. \documentclass{article} \usepackage{pgfplots} \usepackage{sagetex} \begin{document} ...
5
votes
1answer
58 views

Pgfplot/tikzpicture: modify ticks and labels

I would like to modify my tikzpicture: 1.) I added an extra tick at x=92, but this overlaps with the automatic tick x=100. How to solve this overlapping? Same problem for the second extra tick at ...
2
votes
3answers
63 views

Can I connect the end of an \addplot to the beginning of the next \addplot?

I'm using pgfplots to plot an implicit equation, but I'm running around using gnuplot by parametrizing the curve instead. The down side is that my parametrization necessarily comes in curve segments. ...
1
vote
1answer
38 views

Pgfplots stops plot

I'm trying to plot the function (0.5*x+1)^(-2) for x in [0,6]. Here's my code: \documentclass{scrartcl} \usepackage{pgfplots} \pgfplotsset{compat=1.12} \begin{document} \begin{tikzpicture} ...
1
vote
0answers
39 views

Why does my pgfplots scatter plot contain colours not in colour map?

This is a follow up to a previous post. My aim is to produce a plot that uses meta data to colour/shade data points. What I'm having trouble in understanding is how the colour map is applied at the ...