{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

4
votes
0answers
21 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: ...
1
vote
1answer
24 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}[ ...
3
votes
2answers
51 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 ...
1
vote
0answers
29 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 ...
5
votes
1answer
53 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 ...
4
votes
1answer
43 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 ...
0
votes
0answers
32 views

How can i print the label of a subfloat inside a TikZ node?

I'm laying out a few tikzpictures side by side (made with pgfplots, but I think it should not matter). I'm trying to use the subfig package to be able to reference single subfigures. Everything works ...
2
votes
1answer
43 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
148 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 ...
3
votes
2answers
143 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 ...
0
votes
1answer
104 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 ...
3
votes
2answers
23 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} ...
3
votes
0answers
47 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 ...
2
votes
1answer
27 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
40 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 ...
3
votes
1answer
29 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
24 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 ...
4
votes
2answers
70 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, ...
5
votes
2answers
84 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 ...
1
vote
0answers
64 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
62 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, ...
1
vote
0answers
33 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 ...
4
votes
0answers
56 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
48 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
1answer
27 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
31 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 ...
2
votes
1answer
50 views

get caption/subcaption every plot using groupplot pgf tikz

Hello I want to have Under each plot (subgroup plot) its caption or label, so I can also reference it in my document. Here in my example I used (a), (b), (c) I can keep them but they are not well ...
1
vote
0answers
88 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. ...
1
vote
1answer
27 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 ...
9
votes
3answers
199 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} ...
1
vote
1answer
55 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
36 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; ...
1
vote
1answer
37 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
2answers
69 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} ...
5
votes
1answer
38 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
1answer
158 views

I am trying to draw a clustering Euclidean diagram

I am a biochemistry graduate student, and I have classified breast tumours using a Euclidean centroid-based approach with 437 up-regulated and 370 down-regulated genes (dimension = 807). I would like ...
1
vote
1answer
35 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} ...
2
votes
2answers
38 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, ...
1
vote
0answers
33 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 ...
2
votes
0answers
40 views

Positioning of named nodes and paths within groupplot environments

I am having issues with pgf, pgfplots and the groupplots library. The issue is best explained with an example \documentclass[tikz]{standalone} \usepackage{pgfplots} %\pgfplotsset{compat=1.12} ...
2
votes
3answers
57 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
42 views

How can I make legends colourful? And how can I put value in bars?

\documentclass[border=5mm] {standalone} \usepackage{pgfplots, pgfplotstable} \usepackage{xcolor, color} \begin{document} \begin{tikzpicture} \definecolor{SpecialYellow}{HTML}{F9DC21} ...
2
votes
0answers
34 views

Import data to smith chart?

I have data in CSV format (or I can make it tab-delimited ASCII) and I would like to import it to a smith chart using the pgf (edit: pgfplots) package. The data contains 2 columns with the real and ...
4
votes
0answers
31 views

Command \leqslant with pgfplots

How to use the command \leqslant with pgfplots ? \documentclass{standalone} \usepackage{pgfplots} \definecolor{mycolor}{cmyk}{0.00,0.18,0.29,0.02} \begin{document} ...
1
vote
1answer
39 views

Pgfplots asymptote handling

I'm trying to plot the function f : [0,1] -> [0, ∞] given by: f(x) = 0.5*(x^(-0.5)-1) using pgfplots. The asymptote at x = 0 is causing me some problems though. I've done some research and ...
3
votes
1answer
35 views

Add nodes with pgfplots

I was trying to add nodes inside axis environment but nothing came out. I actually tried several ways... Any help is much appreciated. \documentclass[11 pt, a4paper]{article} ...
0
votes
0answers
31 views

pgfplotsset error

I am running the following code \documentclass[% reprint, amsmath,amssymb, aps,onecolumn,showkeys, %pra, %prb, %rmp, %prstab, %prstper, %floatfix, ]{revtex4-1} \usepackage{graphicx}% Include ...
2
votes
1answer
51 views

Problem with forget plot in the 1.12 version?

If you comment the line \pgfplotsset{compat=1.10}of this MWE: \documentclass{amsart} \usepackage{tikz,pgfplots} \pgfplotsset{compat=newest} \pgfplotsset{compat=1.10} \begin{document} ...
2
votes
1answer
56 views

Plot file could not be opened

The following code is from the "gallery of examples in the manual - PGFPlots". \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \pagestyle{empty} \begin{document} ...
3
votes
1answer
53 views

LuaTeX, unable to read file in pgfplots

I am trying to switch to LuaTeX, but I am not able to compile any pgfplots figures with external data files, which used to compile with pdflatex. Here is the MWE: \documentclass{standalone} ...