{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

4
votes
2answers
95 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
235 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} \usepackage{url}...
5
votes
2answers
3k 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: \documentclass{...
1
vote
1answer
256 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
242 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} \...
8
votes
1answer
1k 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 ...
4
votes
1answer
159 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
373 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
206 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 ...
8
votes
2answers
917 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 ...
3
votes
1answer
170 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} \...
3
votes
0answers
473 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
439 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 name=...
2
votes
1answer
310 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
385 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
125 views

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

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
68 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.
17
votes
1answer
1k 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
148 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
417 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 0.4],'...
4
votes
0answers
70 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
667 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
179 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}{% \pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#...
4
votes
1answer
467 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 ...
4
votes
3answers
561 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
588 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 ...
3
votes
0answers
89 views

Change unit from a read in data table [closed]

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
423 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
915 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
57 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
222 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
314 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. ...
6
votes
1answer
2k 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 ...
2
votes
1answer
4k 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, ...
5
votes
1answer
210 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} \...
9
votes
1answer
700 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
181 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} \usepackage{url}...
5
votes
0answers
60 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
170 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 ...
9
votes
5answers
531 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 ...
4
votes
1answer
668 views

Linear regression in a loglog-plot with fixed slope

Goal: create a plot to compare the empirical convergence rate of a numerical method with the one expected from the theory. Accordingly, given a loglog-plot, I would like to add the line which has a ...
3
votes
3answers
508 views

Highlight a coordinate in a tikz / gnuplot graph

I want to place a coordinate on my tikz/gnuplot graph. How to do this? Preferrably I want the graph to overlap the little red dot, and I'd like the dot slightly larger. \documentclass{article} \...
6
votes
1answer
392 views

Centering dot in a tikz picture with specified coordinates

I’m trying to annotate the plot by drawing this dot on it. I specified the exact coordinates the center of the dot should be at, but apparently this isn’t the dots center... Is there a way to change ...
9
votes
1answer
298 views

Multi-Line/Wave Generator Package for LaTeX?

I'm looking at my professors slides now: http://www.math.ucla.edu/~virtanen/40a.1.14s/schedule/lec1.pdf The first slides always have these intricate wave lines. If you Google search for "wave lines,"...
2
votes
1answer
1k views

Axis break in pgfplots - Large box around plot

I had the same problem as TSGM: Axis break in pgfplots I wanted to break the y-axis in a plot. I have tried the solution, which Michi had suggested on Axis break in pgfplots. It worked fine for me, ...
10
votes
1answer
880 views

Draw a spiral on a sphere

My goal is to visualize damped magnetic precession. Wikipedia features an image, but it doesn't quite capture one essential constraint. Namely, that the magnetization M should be normalized. So the ...
4
votes
2answers
286 views

Converting unit to coordinate works for x-coordinate, but not for y-coordinate

By Jake's help I received a solution (in principle) for an "older" version of this question here, i.e. to extract/convert units in the data to local measures. It works for x, yet unexpectedly fails ...
5
votes
1answer
340 views

TikZ/Pgfplots - Restrict error bars to domain

I would like to create a plot with error bars in which y is restricted to a given domain. Unfortunately, restrict y to domain does not seem to work with error bars. \documentclass{article} \...
3
votes
1answer
199 views

Extracted coordinates have wrong value

I am unable to get the right coordinate values for (A) and (B) in the following axis. Did I misunderstand some conversion step or is it because of the data? Picture MWE \documentclass[ a4paper ]{...
3
votes
1answer
158 views

Wrong linear regression computing

I've just started to use pgfplot and I'm actually trying to get the equation from a plot, with the linear regression. However, I'm working in a loglog plot, and the resulting regression equation is ...