{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

6
votes
1answer
72 views

How to do a shift/offset of ycomb or ybar **in y-direction** without stacking in pgfplots?

I am looking for a way to shift the reference bars in an XRD plot in order to be able to compare two or more plots in the same axis environment but have the references only where they apply. This ...
2
votes
1answer
44 views

Pgfplots, Units and “Modify Number Data Scale”

I've got a question with tikzpicture in LaTeX. Data of Tikzpicture are in a external file. The y-axis scale is like: 100,000 - 150,000... (thousands). I need to put the scale of this axis like 100 - ...
7
votes
2answers
66 views

Pgfplots - ugly marks when using dotted or dashed line [duplicate]

Recently I spotted that applying the option dashed or dotted to a plot results in having ugly / distorted marks or marks with dots (when applying dotted) around them. Here is a MWE: ...
2
votes
1answer
72 views

How can I set the width of a pgfplot to fit that of a tikz matrix?

I'd like to be able to control the width of a pgfplots plot to that of a matrix. The plot should be below the matrix. Ideally the plot's dimension will depend only on the size of the matrix (so if the ...
1
vote
1answer
46 views

Loop through table for boxplot prepared

I am trying to produce figure with 2 boxplot prepared plots from an inline data file. I grabbed this code from here to use as a starting point. Given that the wrapper code allows the boxplot data to ...
4
votes
1answer
135 views

Metadata for different colours in PGFPlots

I would like to use PGFPlots to create a plot using three sets of metadata. I figure it would be best to have one set represented by the plot mark and the remaining two by the fill and draw colour ...
4
votes
1answer
91 views

Conditionally transparent surface in PGFPLOTS

I am plotting 3D bars using PGFPLOTS, following the example and using the script given by Anton in his answer (the second one) to this question: 3-dimensional histogram in pgfplots. My code is the ...
2
votes
1answer
47 views

Adding Confidence Intervals in Pgfplots

I am using pgfplots to generate the following MWE: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ xlabel=$x$, ...
3
votes
1answer
158 views

Deformed drawings in loglogaxis

I constructed a graph by means of a loglogaxis with xmin=5e0, xmax=1e4, ymin=1e-16, ymax=1e0 and am trying to make an annotation by means of a circle. For this, I use \draw[color=red] (axis ...
7
votes
2answers
311 views

How can I represent the curved shape of a surface?

How can I give third dimension to the green surface, with shadings of color or light effects, using tikz or pgfplots? The matter is that the green surface looks (is) flat as the red one, while I ...
1
vote
0answers
29 views

Pgfplots histogram with input data already counted

I have input data that looks like this: Age Count Cumulative Count Percent Cumulative Percent 24 1 1 1.4084507 1.4084507 25 1 2 1.4084507 2.81690141 30 2 4 ...
1
vote
0answers
71 views

Special decoration for TikZ pin feature

I try to achieve the curvy pin style I sketched below. It would help to distinguish pin lines from grid and other lines in the diagram. How can I realize a decoration that automatically draws such ...
3
votes
2answers
65 views

Using \foreach to generate functions

I wish to plot a function based on collection of simple functions. For instance, the maximum of some functions: \begin{tikzpicture}[] \begin{axis} \addplot[smooth, color=black] { max( 2*x, ...
2
votes
0answers
38 views

Barchart, Boxplot Data Table PGF Math Errors from mixed format inline data

My code for a horizontal bar chart with a summarizing boxplot is coming together, but I still have a nagging PGF Math problem if I try to plot the boxplot values, which are commented out at the bottom ...
11
votes
1answer
119 views

Pgfplots dynamic opacity

I'm trying to add multiple plots on one axis and I would like them to have different opacities (e.g. 0.1, 0.2 etc.). I have tried with different options: The only thing that actually compiles is ...
3
votes
1answer
58 views

pgfplots: node positioning

I want to place a node at the end of a curve. Since I did not find an automatic way to realize it I tried to place it manually. But the node does not appear at the expected position. It's placed near ...
1
vote
0answers
36 views

Stacking scatter plots with different y-axes in pgftex

I'm trying to create a stack of scatter plots with a common x-axis but different y-axes, alternating between left and right sides. I'm just learning pgfplots and while I've read up on using multiple ...
1
vote
1answer
85 views

Seeking an explanation for a tikzpicture code

I have found the following solution in stackexchange. It has been perfectly answered here by @Jake. \documentclass[border=5mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.8} ...
5
votes
0answers
133 views

Shell Scheme with pgfplots/gnuplot

I have a problem with pgfplots. I want to create a shell scheme from an E-motor characteristics. In the end it should look like this (well, with some more pleasing colours): The data is stored in a ...
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
80 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
48 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
42 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
39 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
129 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} ...
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
32 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, ...
1
vote
1answer
95 views

Make blue box appear after pause command in beamer presentation

I am trying to the following in a beamer presentation. Slide 1: This is Slide 2: This is a test Slide 3: This is BLUEBOXa testBLUEBOX (BLUEBOXa testBLUEBOX should be written "a test" with a blue ...
4
votes
0answers
93 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 ...
4
votes
2answers
89 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 ...
2
votes
1answer
51 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 ...
2
votes
1answer
53 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
61 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} ...
2
votes
1answer
126 views

Package pgfkeys Error: I do not know the key '/tikz/y error plus index'

I am having trouble compiling the attached mwe. I receive the following message: "Package pgfkeys Error: I do not know the key '/tikz/y error plus index' and I am going to ignore it. Perhaps you ...
3
votes
2answers
105 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
46 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 ...
4
votes
2answers
154 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
59 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} ...
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 ...
5
votes
1answer
66 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
71 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 ...
2
votes
2answers
90 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} ...
7
votes
3answers
128 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} ...
3
votes
1answer
83 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 ...
4
votes
0answers
86 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 ...
4
votes
2answers
69 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} ...
4
votes
1answer
64 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 ...
3
votes
1answer
60 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 ...
1
vote
1answer
110 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 ...
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 ...