{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

18
votes
2answers
356 views

Pgfplot - Cross section of a 3D line plot (Poincare Sections)

I have plotted a 3D line using this following data: p p1t p2t -65.79 -210.81 137.73 -124.76 -182.7 189.67 -170.78 -141.97 233.17 -206.39 -96.42 257.48 -226.99 -40.212 268.45 -231.57 20.337 255....
18
votes
1answer
351 views

Enlarge limits to nearest tick

I'm using pgfplots to auto-plot a number of datasets. The x-axis is in this case not to be enlarged. I'm using enlarge y limits, to get a clearer view of the data, but I would like it to scale to the ...
18
votes
2answers
1k 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 ...
18
votes
1answer
21k views

How can I change the legend's location in a pgfplot?

For a report I am preparing several figures that I exported from Matlab using the matlab2tikz script. However, the location of the legend does not please me. Here is an example plot: I want to move ...
18
votes
1answer
260 views

Elements that looks different when printed with colours or in BW

Is there the possibility with LaTeX of having some element that change if it is printed with colours or in black and white? I was thinking about the rectangles around links with hyperref that are ...
17
votes
6answers
1k views

Draw a smooth surface

I would like to draw a smooth surface like http://mathematica.stackexchange.com/questions/20912/how-to-draw-a-higher-genus-surface but using Asymptote, TikZ, Metapost, PStricks, or other TeX friendly ...
17
votes
3answers
4k views

Fill area between curves

I need to reproduce the following plot: I tried the following code using pgfplots: \documentclass[8pt]{beamer} \usepackage{tikz} \usetikzlibrary{patterns} \usepackage{pgfplots} \begin{document} \...
17
votes
3answers
4k views

\pgfmathsetmacro - dimension too large (biggest value allowed?)

I want to import some data with parameters to parametrize some plots. After importing a table, I assign specific variables of the table to a placeholder by using \pgfplotstablegetelem. And it works ...
17
votes
1answer
2k views

Surface of Revolution

how to draw using surface of revolution tikz or pgfplots? \documentclass{article} \usepackage{tikz,pgfplots} \begin{document} \begin{tikzpicture} \end{tikzpicture} \end{document} I am not able to ...
17
votes
1answer
2k views

How can I draw a chart in the economist style with pgfplots?

I am trying to draw a chart with "The Economist" style. With tikz, I draw this chart clumsily, so I would like to know is that possible to draw this chart elegantly with pgfplots. \begin{...
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. ...
17
votes
2answers
2k views

Use first row of a table as legend entry in pgfplot graph?

I'm using pgfplots extensively and I'd like to avoid having to write legends every time, since all the text files I want to plot have explicit headers. As a comparison, \pgfplotstabletypeset makes a ...
17
votes
1answer
14k views

Where is the pattern list gallery for pgfplots?

Where is the list, or gallery of the patterns available for pgfplots?
17
votes
1answer
4k views

Plotting Normal distribution in pgfplots

I'm trying to reproduce the following diagram in TikZ and pgfplots. My MWE with regenerated graph is below: \documentclass{standalone} \usepackage{pgfplots} \begin{document} \...
17
votes
1answer
2k views

Intersection of two surfaces

I'm trying to create a signed distance function S(x), where I want to intersect S(x) = 0 with a plane. The problem is not to get the two functions into a plot, but to get the two functions to visual ...
17
votes
3answers
4k 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 ...
17
votes
2answers
7k views

pgfplot: plotting a large dataset

I try to plot a dataset which is large using pgfplots. Since I'm aware of problems with large files, I used the external mode. I additionally increased main_memory from 3000000 to 6000000. It crashes ...
17
votes
1answer
3k views

Is it possible to create overlays in beamer inside pgfplots graphics?

When working with pgf-tikz, I can create overlays in beamer presentations with \path<overlay specification> ... However, I could not get this to work in pgfplots graphics. It would be nice ...
17
votes
1answer
3k 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 ...
17
votes
1answer
2k views

Waterfall Chart

For displaying the total effect of a series of values, a waterfall chart can be useful. For example this chart, taken from The Economist, illustrates estimated efficiency potentials in the UK public ...
17
votes
1answer
9k views

Customizing legend in pgfplots

I am trying to customize the legend for this graph. First of all, I would like the legend width to be equal to the x-axis width. At the moment, I am setting the width of the legend via /tikz/...
16
votes
2answers
7k views

Using a pgfplots-style legend in a plain-old tikzpicture

I am using a plain-old tikzpicture to produce a pie-chart-like plot. Now, all other plots in my paper are handled using pgfplots (which doesn't do pie charts) and have their legend typeset by pgfplots....
16
votes
2answers
8k views

Need to do some changes to pgfplots axis

I am still in the habit of learning TikZ, barely started using pgfplots to create my images Although I am still not sure what the best way to do so is, I need to create the image below. My problems ...
16
votes
2answers
5k views

How to select a finite number of samples from the file when plotting using pgfplot

I have a datafile containing thousands of points of which I need to plot only the first 100 points. How to do this using pgfplots? I tried the following with no effect. \begin{axis}[
xlabel=k,
ylabel=...
16
votes
1answer
2k views

How to rotate a pgfplot?

I'm trying to create a plot like this: So far, I arrived here: With the following (minimalized) code: \documentclass{report} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \begin{document} ...
16
votes
1answer
7k views

pgfplots bar plot: spacing inbetween bars

How can I increase the spacing between the bars in a bar plot from pgfplots? \documentclass{minimal} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{...
16
votes
1answer
4k views

Dos and Don'ts of \pgfplotsset{compat=newest}

Question I just upgraded to 1.9. Christian recommends against the \pgfplotsset{compat=newest}, but that leaves one having to come back and update compat=x.y in one's projects, several times, over a ...
16
votes
2answers
7k views

Dimension too large while plotting with pgfplots

I have the following pgfplots code: \begin{tikzpicture} \begin{axis}[domain=-8:2] \foreach \i in {-10,-9.8,...,10} {\addplot+[smooth] {-x/\i+\i};}% \end{axis} \end{tikzpicture} I need several line-...
16
votes
1answer
3k views

pgfplots: dimension too large when reading data from file

Based on the following data table data.dat x a b c d 0 284.15 69.18 284.15 70.26 0.03 284.15 70.20 284.15 70.04 0.04 318.15 70.20 284.15 ...
16
votes
1answer
4k 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, ...
16
votes
2answers
2k 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 ...
16
votes
1answer
2k views

Tikz: intersection of line and plane

I am struggling with drawing a plane and a intersecting line. I would like to have the line C,P',P in the image, disappear if it is "behind" the plane and have it reappear if it is not behind the ...
16
votes
1answer
4k views

How to use a string column with pgfplotstable to label datapoints in a pgfplot?

I have a comma-separated list of data points. They should be plotted as a scatter plot, and should be labeled using data from the .csv file. Having specified the first column of my file as string type,...
16
votes
1answer
3k views

Defining a Piecewise Function for PGFplots

I want to define a piecewise function q(x), and attempted to adapt the solution to this question on using pgfmathdeclarefunction to create a unit pulse function, and this works fine. However, when I ...
16
votes
1answer
4k views

Declare nodes in pgfplots as overlays

The Background In pgfplots, it is possible to make plot elements such as axis labels, ticks and legends overlay, which means they will not be considered when determining the bounding box of the plot. ...
16
votes
1answer
2k views

PGFplot Axis Labels Detaching From Graph

Update: Aug 04, 2013 With the current version of TeXLive 2013, the second MWE below still exhibits the same behavior if the \todo[inline] is commented out after the first run. Furthermore, the ...
16
votes
1answer
1k views

TikZ datavisualization or pgfplots? [duplicate]

I want to create a few plots that should have the same style as my main document and it seems tikz is more than capable of achieving that. Now while browsing the current tikz documentation (2.10 CVS)...
15
votes
4answers
892 views

How can I hatch the areas delimited by two intersecting Gaussian distribution curves?

This is a follow-up to one of my earlier questions: Fill area between curves. I want to color three regions delimited by two curves and a vertical line. Each should have its own shading and color. ...
15
votes
1answer
6k views

Two columns in legend in pgfplots

I know how to create a legend in a pgfplots plot. See Legend in tikzpicture and Using a pgfplots-style legend in a plain-old tikzpicture. But I do not know how I can create a legend with two ...
15
votes
2answers
2k views

Not recompile unchanged pgfplots graph

I'm writing a document with many graphs containing a lot of data points. Many graphs are finished and I don't need to change them anymore. Since I am improving and correcting the text, I need to ...
15
votes
2answers
3k views

Fill a contour-plot

I did some calculations in Mathematica that gave me a contour plot: To include the output I wanted to however draw it with pfgplot. But there I don't get it to work, first of all the y-axis doesn't ...
15
votes
3answers
3k 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: ...
15
votes
2answers
9k views

Change linestyle within a plot to add dashed trendline?

I'd like to add a dashed line to the end of a plot to indicate a future projection as opposed to real data. I can do this by adding a second plot, as in the example below. However this isn't really ...
15
votes
2answers
807 views

quiver plot on hyperboloid surface

Using pgfplots, I'm trying to create a quiver plot on a hyperboloid surface something like this. I was able to generate the hyperboloid surface using parametric equations. I could'nt find out how ...
15
votes
1answer
2k views

Smooth option sometimes produces incorrect arrow tips in PGFplots

It seems that the smooth option applied to lines sometimes effects the arrow tips and produces incorrect results. No problem with vertical lines, but any other seems to have a problem. Is this a ...
15
votes
2answers
3k views

Reduce vertical size of tikz plot

The following code generates a color mapped plot. I would like to reduce the vertical size however, and cannot figure out how. Can anyone give me a hint? \documentclass[a4paper,twocolumn]{article} \...
15
votes
2answers
470 views

Is it possible to detect the “current color”? (for example in a pgfplot drawing?)

Is there a code to deduce the current color of a PGF plot to which a node is associated? Better yet, is it possible to get the RGB decomposition as well? ... addplot coordinates{ (0,0) (1,1) } node{ "...
15
votes
1answer
2k views

TikZ, 3d library and circle fading

I'm using the 3d library to put a circle on the z=0 plane, and other things. I'd like to fade this circle radially, but the result isn't as I would expect because the fading is not proportional to the ...
15
votes
1answer
3k views

Quiver scale in pgfplots (unit scaling)

Quiver plots can be made within pgfplots. Here is a minimal example which is a vector field of [1, x-y]: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{...
15
votes
1answer
821 views

PGFPlots % in ticks labels

Hi i want to put this simbol "%" in the tick labels only in the x axis how can i do?