{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

19
votes
1answer
3k views

pgfplots: externalization and legend referencing

There are some issues when using the pgfplots option legend to name together with externalization. When I disable externalization, everything works fine. When I enable externalization, I get an error ...
2
votes
1answer
331 views

pgfplots: externalization and ifthen

I use pgfplots with externalization. When I try to include a macro that uses \ifthenelse, always the 'else' statement is being executed. When I switch off externalization, it works again. See this ...
9
votes
2answers
895 views

pgfplots: legendentrys are wrong

I'm using pgfplots to plot a lot of data as you can see below. For some of the plots I'v specified a legendentry, but the marks for these plots are not shown in the legend. does anyone know where the ...
8
votes
2answers
4k views

pgfplots multiple plots in one file

In pgfplots is it possible to have several plots in one datafile? The goal is to add about 20 plots, which has different number of points and not the same x-value, to the same axis. (app. 350 points) ...
7
votes
2answers
407 views

Axis background has missing draw/stroke

I want to draw a rectangle around an axis created using pgfplots. This is a minimal example: \documentclass{minimal} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
5
votes
1answer
2k views

pgfplots: nodes near coords only for one plot

Does anyone know how to set up pgfplots to print nodes only for one and not for all plots? For example, in 1 I would like to see the nodes only for the test-plot and not for the trend-plot. You will ...
2
votes
1answer
748 views

pgfplots hand-made legend (\label + \ref) fails with custom styles

In pgfplots, when I use a custom style to plot a line, \label the line and then \ref to this plot, I am unable to get the desired result. The desired result would be to get a little line where I am ...
7
votes
2answers
3k views

xlabel on top axis in pgfplots

I managed to get the x tick labels on the top axis of a plot, but the label of the x axis is still on the bottom axis. I couldn't find an option to get it to the top axis. Is this possible? Minimal ...
7
votes
1answer
342 views

Using \ref in a ylabel of a pgfplot

When I use \label and \ref to distinguish two y axes the marks drawn by \ref are no longer on the lines after rotating it together with the rest of the label (see example below). Any ideas? ...
3
votes
2answers
919 views

title of sub plots with ybar groupplots

I tried to use groupplots to arrange several bar plots but the titles are drawn on top of the axis labels of the plot above. Am I doing something wrong here? \documentclass{article} ...
2
votes
0answers
990 views

pgfplots - subplots with common legend [closed]

This is a followup question of this one. It uses the same MWE but about a different issue so a separate it here. I used Tikz node to create the custom legend but used absolute positioning to place it ...
3
votes
1answer
957 views

Strange behavior in smooth pgfplot with sudden changes in the slope

I'm trying to plot some points with sudden changes in the slope. But I get some strange behavior like this: as you can see in the peaks, there is no smoothness in there. However, I think the ...
6
votes
1answer
1k views

How can I use \foreach in an axis environment of pgfplots?

I'm having a pretty weird issue with TikZ and pgfplots. I want to have a legend driven by a \foreach variable, but TikZ won't let me do that. I tried a couple of different stuff and realized that ...
24
votes
3answers
9k views

Aligning subplots in a pgfplots figure

I have the following figure (a very, very stripped down version of a figure I created using matlab2tikz) My problem is that the subplots are not aligned correctly due to the fact that the y axis ...
18
votes
1answer
6k views

How can I change the font family in pgfplots?

I am using the classicthesis package in LyX to typeset my thesis. I have a plot produced with pgfplots. It uses math fonts same as elsewhere in the text, which is inconsistent with other plots of mine ...
6
votes
1answer
326 views

ytick=\empty not working with semilogyaxis

see what's below. I can't compile it. It works with xtick=\empty though. \documentclass[12pt]{book} \usepackage{tikz,pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} ...
4
votes
2answers
2k views

pgfplots: Numbers along the x-axis

I'm trying to recreate some Chromatograms (have the tab-separated data) but I need to get numbers along the x-axis with some vertical separation (lines/boxes) as can be seen below The image was ...
7
votes
3answers
370 views

Which plotting tool is more likely to stay stable in the basics: MetaPost, PStricks or pgfplots?

I have been looking at the three (major ?) tools---MetaPost, PStricks or pgfplots for plotting data together with LaTeX. My experience is this: MetaPost code can demand lots of lines for simple ...
13
votes
1answer
3k 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 ...
6
votes
3answers
6k views

Axis limits in user-defined style

(related but unequal question: Using Macro Defined Lists in TikZ/PGFplots) I'm having several axis-environments inside the same tikzpicture. I would like to have some (but not all) share the same ...
14
votes
1answer
3k views

geographic maps with TikZ/pgfplots

I have recently discovered pgfplots and I love it. I'm converting the figures from my thesis to pgfplots, or at least the ones I have made myself. One of my figures is a map that I created using the ...
1
vote
1answer
365 views

Use pgfplots and a custom length to define global width when inputing the plot

I'm trying to set the width for all my plots, that are defined in other files and imported into the main document, using a custom width, \sz. I'm trying to set this length because I want to change it ...
3
votes
1answer
4k views

PGFPLOTS: figure and table formatting

Just after an hour spending browsing through the pgfplots manual, I am trying to have a figure and a table side by side (both the figure and the table use the same data). So I still have lot to learn! ...
10
votes
1answer
4k views

pgfplot: accuracy of tick labels

the y-axis of my diagram uses small numbers like 0,005. I don't want to use a multiplier like 10^-3 which appears by default. If I remove it with scaled x ticks = false, x tick label ...
10
votes
1answer
2k views

pgfplots from file: search path, looking for \graphicspath equivalent

I have recently discovered the wonderful pgfplots package and I've started coding my Python code to output tabular data of whatever is plotted (at least for simple plots). In my LaTeX source code, I ...
3
votes
1answer
2k views

PGFPlots: Axis dashed

How to configure axis dashed on PGFPlots? \begin{axis}[grid=major] %need grid=dashed \end{axis}
6
votes
2answers
3k views

Bar plot labels and grids

\documentclass[a4paper,11pt]{report} \usepackage{tikz} \usepackage{verbatim} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ title = {Optimalization based upon co-occurences}, ...
9
votes
2answers
3k views

Remove rows in a \addplot table command

Is there any way to adapt Show last N rows from input datafile only in \pgfplotstabletypeset to a \addplot table command ? This doesn't work: \documentclass{article} \usepackage{pgfplots} ...
11
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 ...
9
votes
2answers
1k views

pgfplots: two labelings for a single 3d plot

I am trying to add a second labeling to my 3d plot, but I can not figure out how to do it correctly. The idea is to add a second axis without any grid, ticks, lines and nothing but labels and overlay ...
8
votes
1answer
2k views

error bar colors in scatter plot

A data file contains four columns: x, y, error on y, class. class is an integer which I feed to scatter src so i get a graph that has different colors for different classes. However, the error bars ...
5
votes
2answers
2k views

Set a colormap to fill a bar plot using pgfplots

I'm trying to change the default color of the bar plot with a a colormap without success. The thing is that I don't like the default color sequence. However, I was wondering if there is a way of ...
3
votes
1answer
790 views

Debugging Advice: TeX Capacity Exceeded with TeXLive2011 (but not with TeXLive2010)

I have a feeling that this is going to be rather embarrassing when I eventually get to the bottom of this problem, but since I have been struggling with this for some time I am posting this question ...
16
votes
1answer
1k 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 ...
8
votes
1answer
4k views

Spacing in pgfplots bar plot

I've been trying to plot an xbar graph using pgfplots within a tikzpicture. I want to be able to only show the yaxis on the left and the x axis on the bottom. When I set axis y line=left and axis x ...
1
vote
1answer
2k views

Some simple surface drawing using addplot3 for pgfplots won't compile

I am having trouble compiling even some very simple surface drawing using pgfplot and addplot3, for example please see the attached code, I keep getting error saying \begin{axis} on input line 8 ended ...
11
votes
1answer
2k views

Consistently specify a Function and use it for computation and plotting

I would like to be able to specify a mathematical function and be able to use that for multiple purposes including: Computation of values (see bullet points below) Graphing using pgfplot Graphing ...
4
votes
2answers
504 views

PGFplot producing “noise” (incorrect graph)

Update: This has problems if the samples are one of these: {19,21,23,28,30,31,32,34,36,38,39}, so I think something else is going on. I can get this example to work fine if I reduce the number of ...
2
votes
1answer
467 views

Styled or fixed color line-segments in PGF

When I want to plot coordinate data, I know that I can color individual scatter points using defined colors using point meta=explicit. The line segments between two points seem to be colored by an ...
11
votes
1answer
945 views

Draw Pareto chart with pgfplots?

I've been following the pgfplots documentation to make some basic bar charts, mostly following this example: \begin{tikzpicture} \begin{axis}[ ybar, ymin=0, width=12cm, height=3.5cm, ...
9
votes
1answer
572 views

Using pgfplots with a0poster

I want to use tikz/pgf to plot some graphs in a poster done with a0poster. That is the code: \begin{tikzpicture} \begin{axis}[xlabel=lambda, ylabel=int] \addplot[blue] table [mark=none, col ...
2
votes
1answer
776 views

Consistently specify function to be graphed with or without gnuplot

I would like to be able to specify a function and then graph that with with pgfplot only, or use gnuplot to compute the coordinates. As far as I know there are two main differences in how the ...
7
votes
1answer
905 views

dropping ticklabel on pgfplot axis

I've just started to play with pgfplot. I'm trying to prepare a plot like to following \begin{figure}[h] \centering \begin{tikzpicture} \begin{axis}[minor tick num=1, axis x line=middle, axis y ...
2
votes
1answer
384 views

pgfplots and final size of the externalized pdf image

I have the following piece of code: % command: pdflatex --jobname=try-f1 try.tex \documentclass[12pt]{book} \usepackage{tikz,pgfplots} \pgfplotsset{compat=newest} \pgfrealjobname{try} ...
10
votes
1answer
1k views

How to generate templates for charts

Most of us create charts that have to be repeated a number of times with only the data varying. Applying DRY (do not repeat yourself) programming principles to such problems is not an easy task. To ...
2
votes
1answer
3k views

usepgfplotslibrary - undefined control sequence

I have problem with following example code: %& --shell-escape --enable-write-18 \documentclass[a4paper,10pt]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{polski} ...
13
votes
1answer
2k views

Adding values to pgfplot legend

As a follow-up to my earlier question (here), here is a question that is perhaps a little more latex than gnuplot. having used gnuplot and pgfplots to generate a fitted curve, is there an easy way to ...
7
votes
4answers
1k views

How to create pgfplots cycle list from a table?

I know that a pgfplots cycle list can be created with \pgfplotscreateplotcyclelist. However, the examples given in the pgfplots manual explicitly list all the items. I am wondering if it is possible ...
4
votes
1answer
698 views

pgfplots: “nodes near coords” on xbar chart is off

I am trying to make an xbar chart using pgfplots, and I'd like to add the bar's value to the bar. Simply using "nodes near coords" positions the value for a ybar chart, which isn't correct here. ...
12
votes
2answers
6k 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 ...