{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
2answers
2k views

pgfplots: mark max/min value of a function

How can I mark the maximum or minimum value of a function like x^2 in pgfplots? \begin{tikzpicture} \begin{axis} \addplot+[mark=none] plot {x^2}; \end{axis} \end{tikzpicture}
4
votes
2answers
1k views

Combine cycle lists in pgfplots

Is it possible to combine two cycle lists? That is, is it possible to apply simultaneously several cycle lists to a common plot without the last list overriding the others (that is, getting a ...
6
votes
1answer
527 views

Nodes won't position as they should in pgfplots

When I use the example of the pgfplots manual it looks different from what is shown in the manual: \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
4
votes
1answer
1k views

pgfplots in combination with gnuplot requires additional semicolon

I have the following example which produces a klein bottle. Whatever I compile with the option --shell-escape and I get the following warning: "<file>.pgf-plot.gnuplot", line 2: ';' expected ...
5
votes
2answers
3k views

How can I fill the area where the boundary is given by functions?

I defined an area bounded by four functions. I found related answers like: "filling area between 2 functions, with shading", but I am not able to adapt this. solution. Here the example: % !TEX ...
4
votes
0answers
566 views

Creating a colored bar chart using MetaPost or pgfplots [closed]

Right now I have this: input graph input sarith beginfig(1) draw begingraph(3cm,2cm) gdata("data1.d", v, path p; augment p (v1,0); augment p (v1,v2); augment p (v1 Sadd ...
4
votes
1answer
731 views

Wrong scale in a stacked ybar logarithmic plot with basis 10 using package pgfplots

I want the plot described in the title. So I added options log basis y=10 and ybar stacked to the axis environment. The scale becomes wrong. If I add just one option, the scale is right. Is my ...
6
votes
1answer
3k views

pgfplot axis mark

This is my first try with pgfplots and I have two problems that I need help with. The code is the following: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \usepackage{verbatim} ...
6
votes
1answer
934 views

Add fancy design to pgfplots (shadows, rounded corners, reflections)

In our company we would like to run the client reportings in LaTeX, which works quite well, but we are struggeling with the design requirements for plots - we use pgfplots. Our aim is to get those ...
7
votes
1answer
1k views

Usage of longtable (or equivalent) and pgfplotstabletypeset

I'm a new user of TikZ pgfplots and pgfplotstable and have been stoked to discover how easy it is to go between Matlab (via matlab2tikz and writing to CSV) and LaTeX. I'm getting a little more ...
19
votes
2answers
2k views

Making overlay figures in TikZ

I'm trying to reproduce the following two figures in TikZ. My attempted code for Fig 1 is \documentclass{minimal} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw ...
2
votes
2answers
1k views

Changing circle to “-stealth”

I took an example from pgfplots % Preamble: \pgfplotsset{width=7cm,compat=1.3} % [See the TikZ manual if you’d like to learn about nodes and pins] \begin{tikzpicture} \tikzset{ every ...
7
votes
1answer
1k views

pgfplots dateplot: automated labels on full hours?

I have some data as a function of time. I plot it using dateplot from the pgfplots package. I would like to have x labels in hours and minutes. For every day, I would like to have an additional ...
8
votes
1answer
3k views

How to plot intervals and points in the real line?

I need to plot a series of sets of intervals (and points) in the real line. Intervals can be closed, left/right-open or open. (Open/closed ends are marked with empty/filled circles) and isolated ...
14
votes
2answers
7k views

Removing x and y ticks in PGFplot

I'm trying to disable the ticks from showing on this diagram: I've tried using x tick=empty as you can see, but it doesn't appear to change anything since I'm not actually plotting in the axis, only ...
32
votes
2answers
3k views

Drawing heatmaps using TikZ

Introduction I want to create a heatmap using TikZ. You can see the basic idea in the picture below: I basically have a table of values and each value is assigned a color. The picture is the result ...
8
votes
1answer
341 views

How to make barplots with text above the bars that always will be inside the axes?

I am making bar plots (xbar) in pgfplots and adding text/numbers on top of each bar by using the nodes near coords command in the axis environment. The x-axis is by purpose not given any value for the ...
3
votes
2answers
571 views

Pgfplots \closedcycle introduces unwanted slope

I'm trying to plot two graphs with the area between them filled. This works fine, except for the fact that the \closedcycle does not go down vertically, but rather at some (arbitrary?) slope, circled ...
4
votes
2answers
926 views

Choosing color mix for lines in pgfplots

I'm somewhat baffled by my apparent inability to choose a mix of colors in pgfplots. Here's a MWE: \documentclass[10pt]{article} \usepackage{pgfplots} \pgfplotsset{compat=1.4} ...
7
votes
1answer
2k views

pgfplots: log ticks with fixed point on one logarithm axis

I have a graph with two logarithmic axes but I wish to set the labels of one of them to display in fixed point format. Is this possible? Below is a minimum example of how to get both axes using the ...
6
votes
1answer
4k views

Plotting .dat file in pgfplot with multiple columns

I'm trying to use pgfplots with a .dat file to plot multiple data points on a graph, but for some reason it's plotting the same two columns over and over again, what have I done wrong?. The .dat file ...
15
votes
3answers
810 views

How to change only the last xticklabel?

I would like to set the last xticklabel to \infty. How can this be achieved without necessarily knowing the xtick value? \documentclass{article} \usepackage{pgfplots} \begin{document} ...
11
votes
2answers
644 views

How to add a jitter to a scatter plot with pgfplots

I have the following scatter plot: \begin{tikzpicture} \begin{axis}[ enlarge x limits=0.02, xmin=0, ] \addplot+[only marks,mark size=1pt] table[x=rmsd,y=seq_score_min] ...
2
votes
1answer
299 views

matlab2tikz for binary matlab figures

How do you properly use matlab2tikz for binary MATLAB figures? The figures are only black and white and when trying to generate the .tex file I get the error: Input argument 'color' is not a scalar. ...
6
votes
2answers
564 views

Uncover labels in pgfplots with beamer

I would like to uncover the labels of the y axis of a plot made with package pgfplots in a presentation made with package beamer. I tried several alternatives (\alt, \only, etc.) without success. ...
5
votes
1answer
367 views

pgfplots: using path names created with foreach in pgfplotsextra

This is a follow-up to naming paths inside a TikZ foreach loop I want to plot a series of plots with names generated for each plot (usingname path global) in a foreach loop and place a coordinate at ...
8
votes
2answers
1k views

pgfplots: post-processing data created with gnuplot

I have managed to use pgfplots' gnuplot option to solve an implicit equation: \documentclass{standalone} \usepackage{tikz,pgfplots} \begin{document} \begin{tikzpicture} \begin{loglogaxis}[ ...
17
votes
3answers
4k views

Making an arrow in a pgfplot figure from one point to another?

How can I make an arrow from one point in a tikz picture to another point? In the following example, I would like to draw an arrow from the word data--which is approximately the coordinate (1982, ...
4
votes
1answer
2k views

How can i create bar plot groups of different sizes in pgfplots?

One can easily create "groups" of bar plots using the ybar/xbar attribute for the axis environment. When multiple \addplot commands are issued using the same x/y coordinate, the entire group of bar ...
3
votes
2answers
933 views

pgfplots function which touches the edges of the plot

I need to plot the constant y = pi function with the plot touching both sides of the plot. I have had a search through the pgfplots manual without much luck. I have tried \addplot{3.141...} which ...
7
votes
1answer
4k views

Two y-axis pgfplot with ylabel and width=\linewidth badly aligned

I am trying to draw a pgfplot with to different y-axis with their respective label in a full line width and I can't get an alignment of the whole tikzpicture within the margins. The problem seems to ...
10
votes
1answer
3k 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 ...
5
votes
1answer
840 views

How to enforce printing the decimal part in pgfmath macros?

I have the opposite problem to this question. I want the decimal parts of an integer printed for consistency's sake. I already tried specifying the precision but without success. See below. ...
2
votes
0answers
53 views

custom function in pgf doesn't behave consistently [duplicate]

Possible Duplicate: Is plotting exponential graphs a known source of bugs in TikZ? I want to use a custom function in pgf plots and in text, like in this example: ...
12
votes
2answers
2k views

Reversing direction of x axis in pgfplots

I want to reverse to direction of the x axis in one of my plots. pgfplots offers the x dir=reverse key for this. However, this does not work as expected - not even in this example: ...
2
votes
1answer
554 views

How to order barplots in aligned rows and columns?

I am making xbar plots with pgfplots. Within different age groups ("Agen interval") of men a single winner is choosen (Winner), based on some test, and on this winner two different variables are ...
1
vote
0answers
530 views

Reproducing a 3dplot example from texample.net using pgfplots: drawing angles with pgfplots in 3d [closed]

I am trying to reproduce the 3dplots example from www.texample.net using pgfplots: So far, I did not come far at all, actually. One problem is that pgfplots does not allow to work in spherical ...
4
votes
2answers
2k views

How to make an xbar plot, with pgfplots, having different y tick labels on the left and right side y axis?

I am making an xbar plot with pgfplots. I want this plot to show the results from a test, where people in different age classes are given scores. For each of these age classes a single person is the ...
13
votes
1answer
8k views

pgfplots: Legends in multiple y-axis plot overlapping

I am trying to add a legend for two plots on two different y-axes, however they are overlapping each other and each one is being written in its own box. I would like for both of them to share a single ...
3
votes
1answer
1k views

3D plots with pgfplots

I am trying to plot 3D plots with pgfplots. I have started with an example from documentation: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usepackage{pgfplots} % ...
9
votes
1answer
1k views

How can I use “axis cs” of pgfplots with mathematical expression?

Inside the environment axis I can specify some points with axis cs. Up to now I am only able to use specific coordinates like 1,1. But I want to know how to use a mathematical expression like ln(3),2. ...
12
votes
1answer
2k views

plot within a plot: zoom into a plot so that the magnified part is framed by axis with ticks and tick labels

I want to zoom into a plot much like it is possible by using the spy library but I want the spy-in node to contain its own ticks and tick labels with a finer grid than the original plot. To clarify ...
4
votes
1answer
2k views

Change pin node style in pgfplots

With pgfplot, how can I change the style of a "pin node" to have a thicker line? I saw posts here how to change the "text label" part of the pin node.. but not this little line beneath it.
6
votes
1answer
600 views

3 dimension plots with larger z axis and all the values show up on ticks

I am trying to build a 3 dimension graph using the following code. \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{figure} [H] \centering \pgfplotsset{compat=newest} ...
5
votes
2answers
668 views

pgfplots: stacking plots in positive and negative y direction in the same diagram

I have several data files which I want to plot in the following manner: I achieved this with the following code: \documentclass{minimal} \usepackage{pgfplots,filecontents} ...
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 ...
15
votes
1answer
656 views

pgfplots: problem with “non-smooth” intersection of two lines' ends

I have a problem like the one in this question concerning a tikz drawing but for a pgfplots plot. I want to create a plot that has one region filled without opacity and a neighboring one filled with ...
9
votes
1answer
922 views

pgfplots: How to ignore the last line of a data file?

I need to plot data files which contain a comment in the last line, like this: 0 2 4 1 5 7 2 9 5 3 11 15 4 10 15 THIS WAS: TOTAL Now, pgfplots seems to have a problem with that giving me ...
9
votes
1answer
2k views

Draw in pgfplot axis before axis and grid are drawn

Is there a way to draw something using the axis coordinates (axis cs:x,y) before the axis and the grid are drawn? Namely I would like to draw rectangles with tikz to give different areas of the plot ...
6
votes
1answer
594 views

Locking the color (z) scale for multiple scatter plots

I am trying to show multiple scatter plots on one frame using Beamer's overlays and the \only command; see previous stackexchange question and answer. I wish to show the third (z) axis using a color ...