{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

3
votes
1answer
103 views

How to add one single legend entry for several plots?

How can I create a single legend entry for 4 plots at the bottom of the group of plots?. Something like this: Title Title -------------- ---------------- - ...
3
votes
1answer
112 views

Adding error bars to pgfplot with coordinate o

I'm just starting out with pgfplots, and am not overly steeped in Latex in general. I have the following, which isn't all the way there (I need to expand the width the accommodate the legend for ...
3
votes
1answer
137 views

When using pgfplots, I receive an error of “ Missing { inserted.” when using the fillbetween package. Why does this error show up?

I've been using pgfplots to generate images in my homework for a modelling course. I've been receiving the error below and I can't seem to locate it in my code. Missing character: There is no ; in ...
3
votes
1answer
78 views

Apply same options to multiple `addplot` in pgfplots

Can I apply the same options to all addplot's in a single axis environment in pgfplots? For example: \begin{tikzpicture} \begin{axis} \addplot[%plot 1 color = red, ...
3
votes
1answer
196 views

pgfplots won't plot from CSV

I have a file called 'dat.csv' that contains data in the following format: x,y,z -2.4,-2.4,0.00208966369454526 -2.3,-2.4,0.00245568047497186 -2.2,-2.4,0.00284901821144199 ...
3
votes
1answer
84 views

How to plot this histograms as a line graph?

Let's say I have this histogram plot: \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ symbolic x coords={a small bar,a medium bar,a large bar}, ...
3
votes
1answer
186 views

pgfplots + gnuplot: how to clean up the look of a contour plot generated from raw gnuplot data by using a colour bar?

Here's a MWE: \documentclass[12pt,letterpaper]{article} \usepackage{lmodern} \usepackage[T1]{fontenc} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.11} \begin{document} ...
3
votes
1answer
169 views

pgfplots, axis limits and axis equal

I would like to apply the axis equal option and scale the y-axis from 0 to pi. Unfortunately both is not working with the minimal example provided below. The output still contains white filled space ...
3
votes
1answer
158 views

adding single points to bar figure in pgfplots

I have a bar plot, in which I would like to add some single points overlayed on the bars. Those points are in another scale compared to the error bars. Below, I'm illustrating those single points in ...
3
votes
1answer
121 views

tikz, pgfplots and polaraxis

I found a nice template for a polar graph 1 and I adjusted it as follows: \documentclass[12pt]{standalone} \usepackage[x11names]{xcolor} \usepackage{tikz} \usepackage{pgfplots} \begin{document} ...
3
votes
1answer
216 views

Undefined control sequence: \pgfmath@multiply@thousand [duplicate]

After updating my MiKTeX distribution, I suddenly got a compile error with a .tex file that compiled perfectly fine before. After removing everything that did not contribute to the error, I ended up ...
3
votes
1answer
120 views

Appending arbitrary code to a pgfplots axis environment before curve and axes are drawn

There was some confusion about what I really wanted, so I include the actual use case here. The MWE plus corresponding picture is at the bottom of the post. I made some fancy looking graph, among ...
3
votes
1answer
48 views

Disable automatic subticks on semilogyaxis plot with pgfplots

I found many questions regarding why subtics do not appear on a semilogyaxis plot. But I actually would like to not have those subticks as this adds too many ticks so that my plot looks pretty full. ...
3
votes
1answer
61 views

Providing legend for pre-rasterized data

I have a plot containing several million data points (real-time sensor, 50 samples/s, multiple channels, 5 hours). To keep the file size of my document down, I made a bare PNG with the line graph in ...
3
votes
1answer
218 views

PGFplots: Can I do vector addition/substraction?

I'd like, in the following MWE, to draw a vector from P to P+v and to P-v for some given point P and directional vector v in the axis coordinate system of a pgfplot. Can it be done? ...
3
votes
1answer
235 views

pgfplot: centering the axis above the caption without trimming axes

is there a stable way to center the axis (without the axis label) above a figure caption without trimming the axis with \begin{tikzpicture}[trim axis left, trim axis right] ? Trimming the axis ...
3
votes
2answers
362 views

How to enable minor y ticks for a logarithmic axis

I am using pgfplots to create some plot with logarithmic axis. But Latex automatically shows minor y ticks for some of them and doesn't show them for the others. Here is an example (when I increase ...
3
votes
1answer
154 views

Combining surface plot, explicit colour and legends in pgfplots

This question is a result of this one. I would like to make a surface plot using tikz/pgfplots using explicit colour and including legends. Is this possible? I have gone through the entire manual for ...
3
votes
1answer
121 views

Choosing the bar size with symbolic x coords option

When I use both "bar width" and "symbolic x", pdflatex gives me the following error message: ! Package pgfkeys Error: I do not know the key '/pgfplots/bar width' and I am going to ignore it. ...
3
votes
1answer
69 views

Problem with plot using pgfplots

I'm trying to plot the exponential function using pgfplots, but no matter what I change, I get only a part of the plot. Here's the code (the code and the image were made using exp(0.25x) instead of ...
3
votes
1answer
116 views

Clipping plots to other plots in pgfplots

I'm plotting a convex frame as shown below, with the given MWE. Inside this frame, the idea is to plot additional functions to create an image. In order to avoid manually computing the domain ...
3
votes
1answer
278 views

\addplot3 in pgfplots plots data beyond axis limits

When using pgfplots for a 3D graph and reading the data from a table, is there a way to truncate the data at the axis limits specified in the axis environment ? Here is a MWE: ...
3
votes
1answer
233 views

How can I mark a point in a pgfplot and make sure its visible (on top of the plot)?

Recently, I have TikZ'ed the following image for Wikipedia (see file) I would like to mark the green dot like it was done here: I've tried a couple of different things, but no matter what I did ...
3
votes
1answer
111 views

Error cross-referencing when tikz mode is graphics if exist

I am getting the error "Undefined control sequence" when using \tikzset{external/mode=graphics if exists} and the label does not exist (It should produce a warning not an error, though because the ...
3
votes
1answer
163 views

pgfplots: Adding additional lines to a graph

I did an ANOVA with 4 tests. Result graph is shown here, original code comes from: TikZ: Replacing the values (labels) on x-axis with names \documentclass[12pt]{article} \usepackage{pgfplots} ...
3
votes
1answer
48 views

pgfplots@y@inverseveclength ->infty

I'm experiencing problems with pgfplots. The following piece of code was automatically generated by a piece of software I'm working on. \documentclass {standalone} \errorcontextlines 10000 ...
3
votes
2answers
86 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, ...
3
votes
1answer
159 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: ...
3
votes
1answer
745 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
1answer
220 views

Stacking plots in animation using fill between library (with dynamic calculation of intersection segments?)

As a followup question to Filling the area under a graph based on intersection with another graph, I'm looking to create the following effect: Fill based on the coordinates of the intersection ...
3
votes
1answer
177 views

Global pgfplotset messing up error bars

I have a plot with some error bars generated with this code, but the error bars are messed up. \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \pgfplotsset{ every ...
3
votes
1answer
290 views

pgfplots linear regression for the wrong column

The following MWE correctly plots the Y column when it is plotted directly (black points). However, a linear regression specified for the Y column actually fits to the Z column if the Y column is the ...
3
votes
1answer
173 views

pgfplots + animate + foreach: Starting with one plot

I want to generate an animation where the number of lines increases one by one. It works very well but the start image always has two lines. \documentclass{article} \usepackage{pgfplots} ...
3
votes
1answer
229 views

Add legend to the curve from \draw

I am a new user to PGFPlots so I have the following question: I draw a ellipse in TikZ and I want to add a legend for it. However, I found the \addlegendentry is only for \addplot. Then, how can I add ...
3
votes
1answer
135 views

Bar plot in PGF plots with no upper limit

I assesed particke size distribution using sieve analysis. Now I want to present the results using PGFplots. The largest opening was 1 mm. I can plot finite intervals (e.g. 0.25 mm -- 0.50 mm), but I ...
3
votes
1answer
326 views

ybar overlaps axis line (and xtick removal)

When I use the MWE below my bar plots are overlapping partly the black x-axis How is it possible that the bar graph starts exactly above the x-axis and not on top of it? And is there a way to ...
3
votes
1answer
191 views

Adjusting pgfplots

I am having trouble controlling the axes in pgfplots. I have defined an evironment for graphs \newenvironment{graph}[3][]{\begin{figure}[htp] \def\tempa{#1} %Saves caption since \end cannot take ...
3
votes
1answer
95 views

Same ymin in loglogscale

I want to obtain the same y axis for multiple plots. Here is a MWE: \documentclass[preview=true]{standalone} \usepackage{pgfplots} \begin{document} \begin{preview} \begin{tikzpicture} \begin{axis}[ ...
3
votes
1answer
620 views

Errors when plotting a bar chart

This is my crude attempt to create a graph from copied example. I want to plot the diseases on the Yy axis and QoL scores on x axis. It has resulted in errors. Could anyone be kind enough to point out ...
3
votes
1answer
60 views

calling an expression in the document in pgfplot

Say I have the following function which I would like to plot. $S(z)=\frac{p.(\alpha_H+z.\alpha_W)}{p.(\alpha_H+z.\alpha_W)+\beta_H+z.\beta_W}$ While I could specify it in the \addplot command, I ...
3
votes
1answer
212 views

filter coordinates for specific \addplot

I want to use \addplot twice and I want to filter the x values in one of them. However, x filter/.code={...} goes into the axis options and thus is applied to all \addplots. How can I select a ...
3
votes
1answer
354 views

Cyrillic text in symbolic x coords

I make bar plot with pgfplots: \documentclass{report} \usepackage[T2A]{fontenc} % Поддержка русских букв \usepackage[utf8]{inputenc} % Кодировка utf8 \usepackage[english, russian]{babel} % Языки: ...
3
votes
1answer
296 views

pgfplots - how to draw seconds from csv in hours:minute format?

I have data in a .csv file with seconds as x values. I'd like to tick the x axis in hours:minute formate e.g.: 0:00 , 0:30 , 1:00 , 1:30 ... How do I have to redefine the interpretation of values to ...
3
votes
2answers
282 views

Plot from scratch (without explicit data)

I'm trying to draw a plot which I've been given in a scan: What is the correct way to plot a custom shaped curve --- a freehand tool counterpart. I used quick curve but it's hard to tell extremum ...
3
votes
1answer
634 views

Plot with Min/Max bar and two average points

I am trying to stop using Excel charts in my academic papers and rather use something more LaTeX integrated such as Tikz. My current Excel chart looks like that: As can be seen, any combination from ...
3
votes
1answer
372 views

Pgf plots and a tabular legend

I have a plot where I want to add a legend which is the combination of lines and marks. For that I want to replace (or define a new) the original pgf plots legend type. As said before, in the ...
3
votes
1answer
150 views

Missing pictures when using pgfplots

When preparing an article I came across with a strange problem. To draw graphs I use pgfplots. Like here: \documentclass[twoside,11pt,a4paper]{article} \usepackage{daiostyle} \usepackage[all]{xy} ...
3
votes
1answer
282 views

Nested loops and conditionals in pgfplots

I have trouble in using nested loops and conditionals in pgfplots. I'm familiar with the \foreach and \ifthenelse commands, but do not work well with pgfplots. For example, in the following I want to ...
3
votes
1answer
946 views

Plot alignment using groupplot in pgfplots

I am using the groupplots library in pgfplots to create plot groupings. I am using the 2x2 sizing but only have 3 plots. How can I center the furthest right plot vertically, to make a triangle rather ...
3
votes
1answer
276 views

pgfplots memory overload

I want to plot 5x9000+ data points. I am already using: \usepgfplotslibrary{external} \tikzexternalize and -shell-escape -enable-write18 in PDFLatex. However, I still get the memory error. I ...