{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

11
votes
1answer
258 views

Criteria for deciding how best to specify coordinates with tikzpicture with or without pgfplots

Conclusion The original question, as Christian has pointed out, was far too broad and basically a result of being overwhelmed by the size of two main manuals for tikz and pgfplots and how they ...
11
votes
2answers
820 views

Add variable tick in axis

Consider the following code where I detect the crossing of a function to a given threshold. I am plotting the line from the intersection to the x-axis, and storing the intersection in \p1 I would ...
11
votes
1answer
284 views

Presumed error of pgfplots in the “cutting” of a surface

I'm struggling with a 3D representation through the use of the package pgfplots. I'm faced with an alleged error in pgfplots (from my point of view). Consider the txt file (which is attached here) and ...
11
votes
2answers
2k views

How to maintain consistency with TikZ and Pgfplots?

I would like to maintain some consistency between TikZ and PGFplots, and have run into numerous difficulties. Here is an example of two of them: I would like to be able to use something similar to ...
11
votes
1answer
74 views

Rotation transformation of a parametrized plot

I'm working on this plot with pgfplots: The image is from our sister-site Mathematica.SE and there's also a nice explanation how to do it with Mathematica. I follow these steps: Parametrize the ...
11
votes
1answer
223 views

How can I draw 25 horizontal lines instead of these 25 marked samples?

Instead of the samples which were marked via mark=-, I would like to have horizontal lines that fill the entire axis from left to right. Had the idea to tune the dashes via mark size=6cm but I did not ...
11
votes
1answer
593 views

how to draw interrupted bar charts in pgfplots

Is there a way to interrupt the bar charts in pgfplots? More specifically, I have a plots with bar charts and one chart has extremely high values, so that you can hardly see the others in a scale. ...
11
votes
1answer
159 views

Climographs (climate diagrams) with pgfplots

I'd like to create climographs (climate diagrams) with pgfplots, but these graphs have some special rules (defined by Walter and Lieth about 50 years ago) for axis scaling which I have absolutely no ...
11
votes
1answer
273 views

Polar Plots - layout and extraction of crucial parameters

Let S be some sort of function, depending on direction and frequency, for example: envir. background noise. I have S defined on a rectangular grid and I wanted it plotted on a polar grid. So far I ...
11
votes
0answers
490 views

XeLaTeX and TikZ - how do I ensure my PDFs are using the CMYK color model?

The place I want to print my document at needs the PDF to be provided in CMYK. The document is mostly text, except for a few graphs and plots which are done in TikZ or pgfplots. As suggested in this ...
10
votes
3answers
1k views

Label a single coordinate (pgfplots)

I have the following plot: \begin{tikzpicture} \begin{axis}[grmin=-5:5 -5:5] \addplot[mark=none] {x^2/4}; \addplot[mark=none] {-1}; \addplot[mark=*] coordinates {(0,1)}; ...
10
votes
2answers
709 views

pgfplots quadrics

I wonder whether it is possible to draw the three following quadric surfaces (cone, hyperboloids) x^2+y^2-z^2=0 x^2+y^2-z^2=1 x^2+y^2-z^2=-1 (and the axis) using pgfplots 3d or TikZ as it is ...
10
votes
2answers
3k views

Pgfplot axis labels

I'm trying to adjust the position of my axes labels and I'm having some trouble: \documentclass{article} \usepackage{float} \usepackage{pgfplots} \usepackage{graphicx} \begin{document} ...
10
votes
2answers
525 views

Not recompile unchanged pgfplots graph

I'm writing a document with something like 30 graphs with a lot of points in each. The graphs are almost ok and I don't need to change them for now. I'm improving the text, so I need to recompile ...
10
votes
4answers
990 views

Plot inverse function in pgfplots

pgfplots is not quite comfortable plotting sqrt(x) near x=0. The graphic can be improved by setting samples=2000 (not less), but this seems overkill to me. Is there a way to plot x as a function of ...
10
votes
3answers
387 views

Filling in the area under a normal distribution curve [duplicate]

I'm trying to fill the area between the two $z$-scores but I'm not having any luck. Could someone please help me with this? \begin{tikzpicture} \begin{axis}[ no markers, domain=0:6, ...
10
votes
2answers
577 views

plot 3d graphs of functions defined implicitly

How can I plot 3d graphs of functions defined implicitly (quadratic forms, for Linear Algebra course notes -- I'd like to include lots of examples)? As far as I can see it is not possible with ...
10
votes
2answers
192 views

Decorating a path's edge with a hatch pattern in TikZ

Problem I would like to indicate an infeasible region in one of my pgfplots by manually drawing a path in the canvas. This should be a hatched pattern that is decorated on the path, something like ...
10
votes
2answers
4k views

How to stack and align multiple plots with same x but different y axes?

I have several series of datapoints from each of several sites. I would like to produce a series of stacked plots, close together as in the attached example, to allow comparison both within and ...
10
votes
2answers
483 views

How can I plot two lines in the same style (using cycle lists) with pgfplots?

I am using cycle lists and the \addplot+ command to plot lines in different styles. I would like to plot several things using each style, however, like this: % Plot using style 1 \addplot+ ...
10
votes
3answers
1k views

Disabling the arrows that appear in pgfplots on the axes

By default in PGFplots, when axes are only shown in the bottom left corner, arrows appear at the end of the ends of axes lines. How can I change the defaults so these arrows do not appear? Edit: ...
10
votes
2answers
335 views

How can I produce such a graph of my piecewise function?

I am writing my thesis in behavioural economics and have to draw individual discount functions, I did the following graph with stata, but would love to have it with tikz. I played around in tikz ...
10
votes
1answer
3k views

pgfplots - number format on axis

How can I force pgfplots to draw my axis ticks labels consistently? I mean instead of 0 a 0.0, instead of 1 a 1.0 in the below image. EDIT: Code \documentclass[a4paper,10pt]{scrartcl} ...
10
votes
2answers
281 views

How can I draw a pretty population pyramid graph with pgfplots?

I'm trying to plot a graph population pyramid. I wrote this MWE. \documentclass{article} \usepackage{pgfplots} \usepackage{pgfplotstable} \begin{document} \pgfplotstableread[col sep=comma]{ ...
10
votes
1answer
1k views

Is it possible to “transform” a histogram into a density plot in pgfplots?

I just figured out that there is the pgfplots package with the hist feature, that allows to "draw" histograms based on an external data table. What I'm looking for is a possibility to transform a ...
10
votes
2answers
1k views

“pgf Error: No shape named i-0 is known”, but only upon 2nd run

Update 2012-01-31: This seems to be a version (and/or OS specific) problem. It breaks on my latest TeXLive2011 on a Mac, but I can get it to run on my PC version of MiKTeX 2.8, and @MarcvanDongen ...
10
votes
1answer
2k views

Axis with trigonometric labels in PGFPlots

How do I make the axis labels use multiples of \pi in PGFPlots?
10
votes
1answer
3k views

Chart with long x axis text labels looks ugly

Thanks to Caramdir and Alan Munn I am now able to create basic bar charts that use text as x axis labels. Functionally they are perfect, but some of them look kind of ugly. See for yourself: ...
10
votes
1answer
383 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 ...
10
votes
1answer
1k views

PGFPlots: Change the color of axis lines

I want to change the color of the axis lines only without changing the color of the axis labels, tick labels etc. MWE: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} % ...
10
votes
2answers
1k views

Intersection of 2 surface plots in pgfplots

My question is pretty much a duplicate of this one. I'd like pgfplots to display the intersection between tho surface plots properly. Unfortunately, my function is quite different from the one in the ...
10
votes
1answer
3k views

How to change label and ticks of a pgfplots colorbar?

I have a 3d plot with colored surface and a colorbar made with pgfplots. My probably related questions are: How can I set the label of the colorbar? What are the equivalents of zticks (positions of ...
10
votes
1answer
2k views

Scaling colormaps with pgfplots

I have two surface plots, which I would like to have to same color for the same height. So, as the first plot is dark blue for f(x,y)=0, the right plot should also be dark blue for f(x,y)=0. However, ...
10
votes
1answer
2k views

Using Labels from a File in PGFplot

I am using LaTeX, TikZ and PGFplot in order to automatically generate several series of diagrams, one of which is comprised of bar charts. Each bar in each bar chart may have a unique label and height ...
10
votes
1answer
405 views

pgfplots line colors

Is it possible to make pgfplots use a predefined color map while plotting multiple lines, I currently have 9 samples that I want to plot, but don't want to type different colors for each one. Right ...
10
votes
1answer
358 views

align also ylabels in a TikZ matrix

I am aligning many pgfplots with the TikZ \matrix. The axes are automatically aligned correctly. How can I also align the ylabels automatically (because I am changing plotted data very often)? ...
10
votes
1answer
2k views

PGFPlots how can I hide extra y tick marks?

simple question (I hope) Using pgfplots 1.5.1, miktex 2.9 on Windows 7 32 bits. I'd like to hide the tick marks at the right and top side of the plot, but without losing the lines (e.g. keep the ...
10
votes
1answer
698 views

How to scale existing coordinates data in pgfplots?

I have a plot with its data, for example \documentclass[]{article} \usepackage[]{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[] \addplot+[%multiply x data by a factor here, multiply y ...
10
votes
3answers
2k views

PGFPlot - Missing values in table data

I am using PGFPlot with external table data. However, some values are missing for some plots. This causes data in column 2 does not exists error. Is there a way to solve this. The value does not ...
10
votes
1answer
541 views

Tabs in output file written by xelatex and pdflatex are different

I'm trying out pgfplots with gnuplot to generate the data. This works by having pgfplots write some stuff to an external file, run gnuplot on the file, and then use the generated data to plot the ...
10
votes
1answer
288 views

Draw a line between data points in two different pgfplots (subfigures)

I have two different pgfplots in two subfigures. I want to draw a line between the red circled data points and the blue ones. I added lines manually with LibreOffice Draw to show you what I mean. My ...
10
votes
1answer
155 views

Adding a “passive” plot in pgfplots

I would like to add a plot to a pgfplots figure, but such that it doesn't change the automatically computed limits. for example: \documentclass{article} \usepackage{tikz,pgfplots} \begin{document} ...
10
votes
1answer
3k views

Grouped bar chart

I'm trying to construct a grouped bar chart and have three questions I can't seem to find the answer to: 1) How do I modify the spacings between the groups? Or at least make sure that no bars are ...
10
votes
2answers
2k views

tikz/pgfplots advanced z-order axis/grid

Is it possible to have both the axis on top and the grid on the very bottom (or somewhere in between some other planes/lines/...) of a plot? Example figure with axis on top=true but the grid on top ...
10
votes
3answers
5k views

Restrict function plot to a range of x values using pgfplots.

I want to create a plot of two functions using pgfplots and LaTeX. I want one of the functions only in a certain interval, I'll give an example: \begin{tikzpicture} \begin{axis}[ axis x ...
10
votes
2answers
136 views

Convert from physical dimensions to axis cs coordinate values

In answering PGFPlots: Howto draw a label at a zero of a function?, I got stuck on converting a length in pt to the actual coordinate value in the axis cs system. Here I only need the x value, but ...
10
votes
1answer
307 views

Compiling a tikzpicture including \ref

I've been reading and gathering material from multiple sources online about what steps are required to externalize a document that contains TikZ pictures which store a reference to their legends using ...
10
votes
2answers
530 views

Create x and y label which overlaps for multiple plots

I have a groupplot of 5x3. Now I want to be able to 'overlap', so to speak, the ylabel over all the plots vica versa for the xlabel. This enables me namely to make the groupplot smaller. Currently I ...
10
votes
1answer
1k views

pgfplots how to nicely place nodes

The picture produced by code blow, there are two problems I have. (1) the number above point overlapped (2) the precision of number is not right, eg. I want 0.913, not 0.91 For the first problem ...
10
votes
1answer
2k views

pgfplots and calculations; without fpu 'dimension too large', with fpu 'Illegal unit of measure (pt inserted)'

I'm trying to multiply some numbers that will end up in the legend of a plot. I can't get it to work: If I naively try \pgfmathmultiply, I get a dimension too large error, with the code in MWE 1 ...