{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
146 views

Problem with xticks when importing Matlab figures using matlab2tikz

When importing the following figure using the Matlab2Tikz, I obtain the following output , with the xticks strangely exported . Does any one have an idea how I can prevent this? Maybe by passing ...
3
votes
1answer
56 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 ...
4
votes
1answer
50 views

pgfplots externalize with hyperref

I'm using pgfplots with externalize because my document has a lot of plots which causes problems with memory limitation in LaTeX. In one of my plots I have a reference to an equation. In the file ...
4
votes
2answers
86 views

Ticks for Chart with odd style

I am trying to plot some data where the X axis is somehow in bytes. The values grow exponentially, so I scaled them by hand to obtain a better chart. However, I don't want to show the log but the real ...
7
votes
2answers
107 views

Tightly packed and differently colored bars with pgfplots

I have CSV data representing the time in nanoseconds for calls to my custom malloc(), realloc() and free() implementations. The data looks like this: function,time malloc,331 malloc,386 malloc,326 ...
4
votes
1answer
96 views

Pgfplot second intersection point

As it can be seen in the figure i added a line from the first intersection (y=2x and y=6-x) to x(2). But i couldn't add a line from second intersection (y=x and y=6-x) to x(3). i tried intersection-2 ...
7
votes
3answers
175 views

Plotting Multiple Normal distributions with pgfplots

Output MWE \documentclass[border=5mm]{standalone} \usepackage{pgfplots} \begin{document} \pgfmathdeclarefunction{gauss}{3}{% \pgfmathparse{1/(#3*sqrt(2*pi))*exp(-((#1-#2)^2)/(2*#3^2))}% } ...
3
votes
1answer
59 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
64 views

Tikz legend cannot be added?

I thought I can add a legend to a tikz picture by \addlegendentry{...}. But as soon as I uncomment the command the compiler complains about missing }. But when I comment the lines again, then it ...
3
votes
1answer
59 views

Opacity of a legend fill in pgfplots

I am forced to make rather small plots that need to have a legend. This means that it is unavoidable that part of the plot gets covered by the legend. To retain legibility of the plot, I would like ...
4
votes
2answers
59 views

How can I place an external image of given dimensions at the center of a pgfplot?

Let's say I would like to place a certain picture at the center of my plot, such that it matches some given dimension on the scale of my pgfplot. I was thinking at first that I could include an ...
4
votes
1answer
66 views

problems “xtick”,“ytick”, add legend… in Gaussian with pgfplots

I have the following code: \documentclass[12pt,a4paper]{article} \newcounter{conto} \setcounter{conto}{\time} \usepackage{lmodern} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} ...
2
votes
1answer
98 views

Problem with pgfplots/pgfkeys: “I do not know the key '/tikz/use units'”

Problem in short: I'm using pgfplots but I can't use units in the labels. I tried this minimal example (from http://pgfplots.sourceforge.net/gallery.html) and get an error message: ...
1
vote
1answer
73 views

Can I make an xbar plot based on an external file?

I'd like to use the, imho, most common value alignment of x- and y-values in an external file and then produce an xbar with it. It shall look like the examples here (the better example because there ...
12
votes
2answers
106 views

Question on interpretation of a pgfplotsset

I am trying to understand the following code: \pgfplotsset{ discard if not/.style 2 args={ x filter/.code={ \edef\tempa{\thisrow{#1}} \edef\tempb{#2} ...
5
votes
1answer
120 views

How to read a specific portion of a data file in pgfplots

I have a data file which contains all the experiments that have been conducted for different cases. Is it possible in pgfplots to only read specific portion of the file and plot the results? Let's ...
3
votes
1answer
51 views

How to refer to parts of a single externalised graphic, such as multiple pgfplots (similar to subfloat/subcaption)?

I am looking for a way to refer, from within normal text or captions, to parts of TikZ graphics which I have labeled myself with (a), (b) etc. With subcaption and multiple separate figures I'd use ...
5
votes
2answers
101 views

Recreate default colors

How is it possible to specific the colors shown in the sample plot here: The code is below and copied from the site! \begin{tikzpicture} \begin{ternaryaxis}[ ternary limits relative, ...
6
votes
1answer
44 views

Adjust markeredge style independent of line style in pgfplots

I'm struggling to get a NICE line plot with a dashed line and markers at the moment. I boiled it down in the following bit of code. There it seems that the line style (dashed) is used for the ...
5
votes
2answers
81 views

Nodes near coord overlapping…how to shift up

I am using nodes near coords but as you can see the values on the bottom are overlapping. I have tried placing them manually but that hasn't worked either...How to just shift up the nodes so they do ...
2
votes
1answer
49 views

pgfplots: options for marks do not apply

I try to modify the marks but the options do not seem to change anything?! \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \usetikzlibrary{plotmarks} ...
1
vote
0answers
65 views

pgfplots - How can I increase TeX's capacity for plotting large datasets? (TeX Live on Windows)

There are several questions and replies on this topic, yet so far I haven't found one which reliably details the steps for TeX Live and TeXstudio on Windows. Of course the editor might be an ...
2
votes
1answer
65 views

pgfplots - Is there an equivalent to 'cycle list name=color list' for custom lists?

I defined my own cycle list mycolor, which equals the vanilla color one except for 2-3 different colors and I added two more items to the cycle. The manual says on page 176: The cycle list ...
2
votes
1answer
92 views

How to programmatically coax pgfplots to recognize nan within surface as matlab does

I came across this post after wondering why nan's did not appear to be handled by pgfplots as they are by matlab when working with the matlab pcolor function. My typical workflow in this context is: ...
6
votes
1answer
115 views

Using PGFPLOTS to make vertical barchart with labels from data file

I have a version of this working with LaTeX Writer and PGFPLOTS 1.5.1 on my iPad. Moving over to Linux and TeXLive 2013 with PGFPLOTS 1.10 sees the Y AXIS LABELS disappear after the first. The bars ...
1
vote
0answers
47 views

Why these thin lines on a PGFPlot doesn't appear on some PDF readers?

I remember reading about PDF reader issues on this StackExchange, but I cannot find the links. The following TikZ picture has some thin lines in light green that doesn't show up on some readers (e.g. ...
2
votes
0answers
65 views

Can pgfplots perform nonlinear regression? [duplicate]

Can pgfplots do nonlinear curve fitting? In Excel, the fitting option is called log(agonist) vs response. I couldn't find an option in the regression section of pgfplots.
14
votes
1answer
292 views

TikZ Plotting: Braces between tickmarks

What is the best way to draw braces between tick marks? It would be convenient to assign nodes at tick marks, is this doable? The best method for placement that I have right now is a guess-and-check. ...
3
votes
1answer
51 views

PGFplots: no mark is showing up

I have standard deviation bars but there is no symbol mark. How can I get one to appear? I took the statistical code from TikZ: How to pass a specific table to \pgfplotstableset if used for ...
5
votes
1answer
136 views

Axis background shading overriding legend

This code in MATLAB: hold on h(1) = area([0 2.5], [125 125]); h(2) = area([2.5 5], [125 125]); set(h(1),'FaceColor',[1.0 0.8 0.6],'EdgeColor',[1.0 0.8 0.6]); set(h(2),'FaceColor',[1.0 0.8 ...
4
votes
0answers
63 views

Grouped overlay bar chart in LaTeX? [duplicate]

I have been trying to create a grouped overlay bar chart in latex using pgfplots, much like this one (not actually mine, found randomly on Google): What I'm trying to achieve is not a stacked bar ...
3
votes
1answer
84 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
77 views

Set samples in tikzpicture from macro value

I'm trying to use set the amount of samples per tikzpicture globally: \documentclass{standalone} \usepackage{pgfplots} \pgfmathdeclarefunction{gauss}{2}{% ...
3
votes
1answer
152 views

2D Bar Chart in 3D Space

I have a graph in 3D space and I'd like to add a histogram along the vertical axis. The bars are supposed to be spaced equally along the vertical axis. I am, however, unable to get the positions of ...
3
votes
3answers
163 views

pgfplots + animate: complicated line-by-line animation

I want a retangle with 80 diagonal lines: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ %------------------------ %% Options ...
3
votes
1answer
128 views

Changes in pfgplot barchart

I found many, many helpful things on tex.stackexchange for pgfplots - thanks for that! But i can't figure out how to: insert a new line after "without" or "with" hide value 0 or the whole bar ...
2
votes
0answers
41 views

Change unit from a read in data table

I use pgfplots to create a graph from a csv file. The column that I use for the x-axis contains time values measured in ms. As my timelapse is a bit more as a min I therefor have values between 1000 ...
4
votes
1answer
137 views

TikZ: How to pass a specific table to \pgfplotstableset if used for tikzpicture

I have created the following code that appears to do what I want it to. Namely add an additional row to the table \IDA that is the average of four values. This row can then be used for a plot in ...
3
votes
1answer
124 views

plotting the graph of hyperbolic tangent

Can someone help me to plot the graph of tanh in latex. I know I have to use pgfplot but I do not know actually how to use it. Any type of help is appreciated.
0
votes
0answers
56 views

Stacked Barplot inside Table in Latex [duplicate]

I would like to plot stacked bar plot inside table in latex. I have code which plots two different bar plots inside table. But i want to plot single barplot with stacked bars. How can I do it in ...
0
votes
1answer
63 views

\label \ref pair in pgfplots does not work on running latex command second time

I am preparing a long document with Latex on Linux. The document uses lots of plots including 3D plots. Without externalizing the plots, latex gives me a message of memory problem. After much ...
2
votes
1answer
105 views

How to plot stacked bar plot inside table?

I have following code in Latex. Which plots only one data series (data2). I would like to plot staked bar plot inside table for both data1 and data2 with different colours. Any ideas.? Many thanks. ...
4
votes
1answer
125 views

\addplot graphics: maintaining image's aspect ratio despite different scaling of axes

I have created a plot using a sophisticated program and would like to put the content of that plot into pgfplots' axis environment. Naturally, \addplot graphics is the way to achieve this. The Image's ...
1
vote
1answer
109 views

PGFplotstable: using a csv file with 4 columns

Suppose I have a csv file with no titles in it just data. The first column is time (x axis) and the next 3 columns each construct a different set; that is, plot(t, col1) is one set of data, plot(t, ...
4
votes
1answer
77 views

PGFplots: using the table feature

I have 4 sets of data that all have the same t values (x axis). Can all list be read in at once? \documentclass[tikz]{standalone} \usepackage{pgfplots} \pgfplotsset{compat = 1.10} \begin{document} ...
7
votes
1answer
151 views

pgfplot groupplot fillbetween

I am trying to use the fillbetween package with combined with groupplot and I am having serious troubles. Basically, what I want to have is the error plotted around my curves with a filled area. I am ...
3
votes
2answers
99 views

title in graphic with pgfplots

I have the following code: \documentclass[12pt,a4paper]{article} \newcounter{conto} \setcounter{conto}{\time} \usepackage{lmodern} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} ...
5
votes
0answers
57 views

pgfplots using Time Series in .txt [duplicate]

I have the following Time Series data Date S 2010-01-11 7260 2010-01-12 7270 2010-01-13 7440 2010-01-14 7430 2010-01-15 7460 2010-01-18 7500 2010-01-19 7580 2010-01-20 7470 Where S is the ...
1
vote
0answers
112 views

Incomplete parametric curve, ''written letter e'' [closed]

I have tried plotting some parametric curves like (x^3-3*x,3*x^2-9), and it works fine. The following, however, does not work: (x-x/(1+x^2),1/(1+x^2). I have tried several ways of plotting it but the ...
6
votes
4answers
160 views

How to get multiple plots of particular functions?

I'm trying to understand how I can get multiple plots from a set of functions to be plotted in the same window without the clutter; i.e., border, axes, grid, whatever... For example, say I want the ...