{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

2
votes
1answer
28 views

arcsin x function in pgfplots with normal axis

This is my code for asin x (picture on the left): \begin{tikzpicture} \begin{axis}[domain = -1:1, samples = 500] \addplot[color = red] {asin(x)/180*pi}; \end{axis} \end{tikzpicture} ...
3
votes
1answer
39 views

PGFplot multiple histograms using CSV file

I have tried to draw a comparative graph using histogram and taking data from different CSV source files. I can draw the two histograms but the resulting graph is not what I want: I don't want the two ...
3
votes
1answer
42 views

Interaction between “scope + shift” and “fill between” from pgfplots

I am trying to draw a picture using tikZ and pgfplots. The following is a minimized example of what I am doing. \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} ...
2
votes
0answers
30 views

Why does pgfplots scale dimensions differently in a polar plot

I am using pgfplots to draw two images with polar coordinates. Even though I specify the same value that represents the 100% value (radius of a 100 for both red circles, they are the last plots in ...
2
votes
1answer
75 views

How to draw a graph from CSV with TeX?

I am a complete beginner with TeX, I would like to draw JMH benchmark graph using TeX. Since I have output results in CSV format. This is my actual code: \documentclass{article} \usepackage{pgfplots} ...
2
votes
1answer
83 views

Pgfplots: Placing legends individually to the end of lines

I have a few days of experience with LaTeX. It seems almost everything is possible if you just find out how. So, here is a challenge... If a plot has many lines it is much more readable to have ...
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 ...
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
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}[ ...
2
votes
2answers
37 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
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 ...
2
votes
1answer
41 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
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: ...
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 ...
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 ...
11
votes
4answers
745 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
31 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
37 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
32 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
42 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
30 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
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 ...
3
votes
2answers
144 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
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
45 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
152 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
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 ...
1
vote
0answers
95 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
630 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
100 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
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} ...
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, ...
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
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 ...
5
votes
2answers
86 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
50 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
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, ...
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} ...
9
votes
4answers
220 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
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} ...
1
vote
0answers
34 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
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
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} ...
1
vote
1answer
28 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
33 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 ...