{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

23
votes
1answer
332 views

How to get a Waddington landscape?

The idea is to make a plot like this Source: http://figshare.com/articles/_Waddington_s_8220_Epigenetic_Landscape_8221_/620879 But only with 2 wells in the front, not 4. Also the colors don't ...
1
vote
0answers
40 views

Plotting a signal along with its harmonics in one figure [duplicate]

I would appreciate it if someone could help me plot a figure similar to the following picture. I want to draw the fundamental signal along with a few first harmonics using pgfplots.
5
votes
1answer
72 views

LuaLaTeX - Linux libertine (math and pgfplots)

I have some problems using Linux libertine font within equations or pgfplots and tried this answer but it doesn't work. \documentclass{article} \usepackage{fontspec} \usepackage{pgfplots} ...
5
votes
1answer
44 views

Fillbetween library has different effect based on plot contents

I'm trying to get fillbetween to fill the area of two graphs in two seperate plots: I've set the same domain for both fillings, but it seems to be filling different domains. (quite frankly I'm not ...
6
votes
1answer
38 views

Specify radius of an arc with pgfplots and axis direction cs?

I'm trying to draw an arc (the top half of a circle of radius 8, centered at (-8,0)) but I can't figure out how to specify the radius in pgfplots's coordinate system. Here's a MWE: ...
4
votes
1answer
34 views

Pgfplots ybar option draws tickmarks outside the plot area

I'm seeing x tick marks drawn outside the plot area when ybar is active. Is this expected, why, and how can it be prevented? Here's a MWE: \documentclass{article} \usepackage{pgfplots} ...
11
votes
1answer
126 views

Fractions in annotations

I want to use the \frac command in an annotation to a line \documentclass{standalone} \usepackage{pgfplots} \usepackage{amsmath} \begin{document} \begin{tikzpicture} \begin{axis} ...
4
votes
2answers
82 views

How do I make label (node) to appear in front of markers in pgfplots?

How do I make label (node) to appear in front of markers in pgfplots? For example in: \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} \addplot ...
3
votes
0answers
33 views

PGFPlots option to include/ignore data set when determining axis limits? [duplicate]

Is it possible to tell pgfplots whether or not to consider individual data sets when automatically determining axis limits, or call some sort of "maintain axes limits at their current values from now ...
4
votes
1answer
30 views

Iterating over pgfkey list - macros inaccessible

I have to draw a number of annotated number lines such as this: For this I adapt the pgfplots interface with a few extra keys. \begin{tikzpicture} \begin{axis}[ number line, ...
4
votes
0answers
81 views

pgfplots: howto read touchstone files (s1p, s2p, s3p,…)

With pgfplots you can simply create nice plots that seamlessly integrate into your tikz figure. As a high frequency engineer you will inevitably use a network analyzer to measure S-parameters. The de ...
2
votes
1answer
49 views

log scale plot and filter not interacting well in pgfplots

It looks like when I try to scale coordinate data in a pgfplots, I cannot do it in log scale simply, since the expression filter seems to be applied to the final point and not the table value. For ...
5
votes
1answer
63 views

plotting data from rows instead of columns in latex

How can I use the addplot table command to select data from rows to be plotted instead of columns? Thank you.. I tried that but still I got errors.. here is my script: \documentclass{article} ...
4
votes
1answer
665 views

Put numbers in legend using pgf pie

I would like to have the numbers that are inside the pie chart to be in the legend. How can I make that happen? Here is the MWE: \documentclass{article} \usepackage{pgf-pie} \usepackage{tikz} ...
17
votes
3answers
787 views

Fill area between curves

I need to reproduce the following plot: I tried the following code using pgfplots: \documentclass[8pt]{beamer} \usepackage{tikz} \usetikzlibrary{patterns} \usepackage{pgfplots} \begin{document} ...
2
votes
1answer
50 views

Move ylabel up/down in pgfplots

I'm creating a graph with pgfplots with two y-axes, one on the left and one on the right. I'm wondering how to move the ylabels up or down to vertically align with the middle of the tick marks: ...
1
vote
1answer
57 views

How can several boxplots be combined into a single figure as groups?

Currently I have the following MWE: \documentclass[a4paper]{standalone} \usepackage{pgfplots} \usepgfplotslibrary{external,colormaps,groupplots,statistics} \pgfplotsset{compat=1.8} \usepackage{tikz} ...
3
votes
2answers
97 views

pgfplots - Zero lines draw over anything else, especially node/pins

For adding zero lines to every plot produced by pgfplots, I used the code provided by percusse here. (A quick note after 2 replies were provided: this is a "global" solution. If one likes to add the ...
4
votes
1answer
44 views

Wrong ticks in colorbar using pgfplots

I'm using pgfplots and addplot3 to show a 3D function, provided by the following csv: 100,2.0,100 500,2.0,500 1000,2.0,1000 1500,2.0,1500 2000,2.0,2000 100,2.1,158.489 500,2.1,930.823 ...
2
votes
2answers
84 views

Wrong placement (and/or size) of picture / plot with groupplot of table (… and discontinuity)?

Consider this MWE: \documentclass{article} % \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.5.1} \usetikzlibrary{pgfplots.groupplots} \usepackage{pgfplotstable} ...
4
votes
2answers
144 views

Using tikzpicture or pgfplots to draw a uniform grid

I want to use pgfplots or tikzpicture to draw a uniform grid as illustrated in below. The grid size in the figure is 8×8. I want to be able to define a parameter that gives me the ability to draw ...
5
votes
2answers
51 views

Reduce vertical size of tikz plot

The following code generates a color mapped plot. I would like to reduce the vertical size however, and cannot figure out how. Can anyone give me a hint? \documentclass[a4paper,twocolumn]{article} ...
4
votes
1answer
63 views

Triangular mesh in PGFPlots instead of rectangular

Recently I had to reinstall my OS, and with it the LaTeX system also. Now if I compile the same code as before, on surface plots PGFPlots generates triangular mesh instead of the wanted and usual ...
7
votes
3answers
121 views

Tikz and pgfplot problem with plotting

I'm using pgfplots. The graph is clipped where it shouldn't, how can I fix it? \documentclass{article} \usepackage{tikz} \usepackage{siunitx} \usepackage{pgfplots} \begin{document} ...
2
votes
0answers
43 views

Histogram and nodes near coords [duplicate]

When using pgfplots's hist in combination with nodes near coords, the nodes are misplaced on the edges of the bars and the last node is shown twice. Is this a bug or is nodes near coords not meant to ...
4
votes
1answer
61 views

Usage of /pgf/number format/cd

I'm trying to fix the amount of digits the colorbar has, because the plot is shrinking in size and I wish to animate this plot, so a fixed height and width is mandatory. I still want LaTeX to do the ...
4
votes
0answers
82 views

Pgfplots histogram with density less than one

I want to plot two histograms over each other in order to compare densities of two different datasets. The problem is that the second dataset has less observations than the first one, and I want its ...
3
votes
1answer
76 views

PGF Math Error: Could not parse input

Trying to plot a BER vs SNR function using erf function. However I get an error saying " Package PGF Math Error: Could not parse input '' as a floating point number, sorry. The unreadable part was ...
3
votes
1answer
59 views

Align bar charts from different sources with one xlabel each

I have a pgfplot that reads from two files. I want a bar chart where the values (bars) of one file appear over one xlabel and the values from another file over another (A and B in this example). My ...
6
votes
1answer
237 views

scaling multi column groupplot while maintaining font size and node placement

This is a follow-up to two previous questions: 1: font size scaling and node placement issues using pgfplots and tikzscale 2: Scaling a multi-column TikZ/pgfplots groupplot to page width I would ...
4
votes
2answers
65 views

Weird undefined control sequence with \nextgroupplot (solved with “globalization”)?

Consider the following MWE: \documentclass{article} \usepackage{calc} %\widthof \usepackage{pgfplots} \usepackage{pgfplotstable} \usepackage{adjustbox} \usepackage{tikz} ...
6
votes
1answer
101 views

Graphing an astroid - parametric curves in pgfplots

So I am trying to create a plot of an astroid in pgfplots which has the parameterization x = cos(t)^3 y= sin(t)^3 and tikz is giving me an error that it is giving up on a path and wondering if I ...
12
votes
1answer
295 views

pgfplots: Coloring a Single Column in a Histogram Differently

I have a huge data file and want to visualize the data using histograms. I would like to color a single columns differently than the rest. Here's an example from the documentation (Section 5.11.2 ...
5
votes
2answers
114 views

Animating a plot with pgfplots

I'm creating a beamer presentation and I want to animate a plot with pgfplots. This is a MWE of the graphics: \documentclass{beamer} \usepackage{tikz,pgfplots} \begin{document} \begin{frame} ...
9
votes
1answer
89 views

Pgfplots grid not showing

I'm having trouble with setting up a grid for this plot using pgfplots. Here's my code. \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture}[ /pgf/declare ...
1
vote
1answer
104 views

Engineering notation (scientific) as tick labels with pgfplots (maybe via siunitx)?

I would like to have numbers on the ticks labels formatted in engineering notation -- but unlike in How to control pgfplots axis scaling for engineering notation (multiple of 3 exponent)?, I would ...
1
vote
0answers
47 views

pgfplots: Explicitly Setting 'Line and Mark Intersection' In Plot

Is there a way to specify where a line intersects a 'mark' on a pgfplot? MWE: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{figure}\begin{tikzpicture} ...
2
votes
0answers
75 views

How to scale both data and error bars in pgfplots

I am able to scale the data using the y filter option in pgfplots plot object (like here How to scale existing coordinates data in pgfplots?). However the error bars are not rescaled as expected. Is ...
3
votes
0answers
33 views

Independent coloring of contour and 3D plot in pgfplots [duplicate]

I have a problem with pgfplots where the addition of a contour plot at the bottom of a 3D plot changes the coloring of the surface plot. This is a simple example: ...
3
votes
3answers
134 views

Problem aligning multiple pgfplots due to different axis label sizes

I have two plots that comes back to back in my paper. One of these plots is generated from 1000 data samples while the other one from 320. The problem that I'm, facing right now, is that plots are ...
5
votes
2answers
244 views

pgfplots: Clipping Everything Outside a Specific Area

I want to add information to each column of a histogram. every node near coord is probably the best approach. It works well with bar plots but not with the histogram: \documentclass{article} ...
2
votes
0answers
39 views

Problematic rendering of mark=+ in pgfplots

Consider the following MWE: \documentclass{article} \usepackage{pgfplots} \usepackage{tikz} \pgfplotsset{compat=1.5.1} \xdef\doPlotCoords{} \foreach \r in {0,1,...,10}{% \xdef\tempCoords{} % ...
1
vote
1answer
94 views

String column tick labels and plotting selected samples on y axis with groupplots?

I have seen other relate questions (like Basic bar chart with text as x axis labels), but still cannot figure out where the problem is in my example. The MWE below contains a snippet of a .csv table ...
2
votes
1answer
62 views

plot points depending on x value?

Is there any options to replace each nth point={100} for something dependent on column value? My table is something like: x y 0 5 1 4 2 5 3 3 3 -3 2 -4 1 -1 0 0 I just want to ...
3
votes
0answers
42 views

My boxplot draws but the coordinates are NaN when I try to label the plot

I have been slowly getting my barchart with a boxplot to come together. My current project is to label the whiskers, quartiles and median. Using examples from the manual, no label is printed. This is ...
8
votes
2answers
120 views

pgfplots: Syntax of Piecewise Defined Functions

I read about piecewise defined functions today and saw this post which was actually about something else: Label plots in pgfplots without entering coordinates manually This is taken from there. ...
2
votes
1answer
43 views

Plot not plotted with pgfplots' \nextgroupplot and discontinuities?

I'm trying to do Multiple axis discontinuities with pgfplots, and so based on Axis break in pgfplots, I produced this MWE: \documentclass{article} \usepackage{calc} %\widthof \usepackage{pgfplots} ...
2
votes
1answer
61 views

Add single bar to a stacked bar plot

In order to show the difference between three measurements against a single one, I need to combine a regular bar plot and with a stacked one. However, once I use a stacked bar plot, the single datum ...
5
votes
1answer
85 views

TikZ “scale” key not behaving at all in the expected way when scaling tikzpicture

I am having difficulty with TikZ remembering node positions, or just reconciling things between different coordinate systems (such as nodes named within a given coordinate system and then refered from ...
3
votes
1answer
41 views

Placing node relative to legend

Sorry for the lengthy example but when I tried shorting it I just messed things up. Don't mind the overlapping bars. If used in the main document the lines are properly sized. I have been trying ...