{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

7
votes
1answer
672 views

Simplest example from pfgplots documentation not working

I get a lot of errors when I try to compile even the simplest examples with pgfplots. The following is taken from the documentation of the package: \documentclass{article} \usepackage{pgfplots} ...
4
votes
0answers
297 views

Artefacts in 3D-Plots when z-values exceed z-axis limits? [closed]

When plotting an expression using pgfplots, there are strange artefacts in places where the z-values are too big for the current axis. How do I fix it? Is there an equivalent to y domain for the ...
9
votes
1answer
2k views

pgfplots: Add/subtract whole columns of data files with one another?

I want to analyze data files with the following format 0.01 1.00 11.00 21.00 0.02 2.00 12.00 22.00 0.03 3.00 13.00 23.00 0.04 4.00 14.00 24.00 0.05 5.00 ...
6
votes
1answer
2k views

How can I use two x axes in pgfplots?

I would like to draw two x axes with ticks and legends in the bottom and top axes where one axis is a linear transformation of the other for the same y range. There is a similar application described ...
9
votes
2answers
571 views

LuaLaTeX:PGFplots can't read data passed by Lua

I wanted to give a LuaLaTeX answer to this question Here it is the listing I wrote: % !TEX encoding = UTF-8 % !TEX program = LuaLaTeX % !TEX spellcheck = en_GB \documentclass{standalone} ...
1
vote
0answers
200 views

Pgfplots: How to get the data to be shown by hours instead of days? [duplicate]

Possible Duplicate: pgfplot: Datafile format for datetime field The solution to the following problem is probably very straightforward, but I've yet to find the right solution. I'm trying ...
7
votes
2answers
2k views

pgf(plots) node shadow/opaque pin

Is it possible to place a shadow/fill/opaque setting on text of a node pin? I know I can do that with the actual node, but I am using \node in pgfplots to mark some stuff on graphs, and it would be ...
4
votes
1answer
882 views

References in externalized pgfplots

I was writing on an document with a lot of pgfplots in it. Because of the memory limitation in LaTeX and in order to save some compiling time I tried out the externalize command. With most of the ...
7
votes
1answer
466 views

Use tikz macros in pgfplots?

Since the axis environment is within a tikzpicture I thought that you could use the usual \draw commands within the axis environment. I am confused as to why the code below produces the red line ...
5
votes
1answer
410 views

pgfplot will not plot past a x value, plot is cut off

I tried plotting the following functions; however, they are cut off at x=[-5,5] and I cannot figure out why. Any help would greatly be appreciated. \documentclass{article} \usepackage{pgfplots} ...
5
votes
1answer
605 views

pgfplots: Using a column header as the plot title [duplicate]

Possible Duplicate: Use first row of a table as legend entry in pgfplot graph ? I am creating a number of very similar plots using pgfplots. The raw data for these is provided in a single ...
22
votes
1answer
5k views

TikZ: How to get a few smooth grid lines for surface plots

I want to produce smooth surface plots with smooth grid lines using TikZ/pgfplots. Usually, this can be achieved using e.g. [samples=100], but this also draws 100 grid lines. I basically want that ...
7
votes
2answers
428 views

Comparison of pgf plotting packages

I know three ways to do function plots based on the TikZ/pgf package: TikZ/pgf directly pgfplots tkz-fct Which of those options is the most powerful? Why? Can you give typical cases where one ...
10
votes
1answer
8k views

pgfplots axis scaling

Is it possible to define in pgfplots that y should correspond to Y cm in my plot? I know how to do this in tkz-fct, so let me add an tkz-fct example to make more clear what I want: ...
3
votes
1answer
796 views

pgfplots: shadow for markers

I was wondering if it's possible to add shadows to markers within pgfplots. I tried the circular drop shadow option (from TikZ) which unfortunately had no effect at all. I also read that one can ...
8
votes
2answers
2k views

Change color of plots in pgfplots globally

In pgfplots I can change the color of plots locally as in the example below. However is there a way to change the color for all plots in a document globally? \documentclass{article} ...
2
votes
1answer
699 views

Plotting area in the plane where two inequalities in two variables hold

I would like to plot the area in the plane where two inequalities hold, both involving two variables. I would like to do it the way Wolfram Alpha does it, but within a LaTeX document. I have looked ...
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, ...
15
votes
2answers
5k 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 ...
5
votes
3answers
2k views

How do I set the aspect ratio of 2D (flattened 3D) surface plot?

I am trying to do a 2D surface plot, and the way to do this in pgfplots seems to be making a 3D surface plot, and then adjusting the view. And this works fine, until I try to adjust the aspect ratio. ...
2
votes
1answer
288 views

Wrong area plot

I'm trying to draw a plot from this table: ip Min Std 0 19.86764349 97.20356138 16 19.86764349 250.079659 22 19.86764349 168.2253117 23 19.86764349 169.2514577 33 ...
19
votes
3answers
3k views

TikZ externalize, pgfplots and animate

I gave a very fetching presentation written with beamer today. It included a pgfplot animated with the animate package, and the result was fantastic. The problem? One of my colleagues wants to borrow ...
7
votes
1answer
2k views

Multiple y axes in groupplot

I want to create a barplot with three groups. Compared are two criteria. To make it more comprehensive here the plot I already generated I approached this problem by using the example from Stacked ...
4
votes
1answer
2k views

Problem using matlab2tikz

I'm trying to get matlab2tikz to work. I want to use it for prettyfying output of Matlab's image() command. In Matlab I tried imagesc(rand(100)); xlabel('X'); ylabel('Y'); title('Random Colors'); ...
16
votes
3answers
4k views

Image with axis

I need to plot some data in a file (10000 records of 2 points each one) but PGFPlots is very very slow rendering it. So I'm trying to use MatLab to plot the data, capture the image without axis and in ...
11
votes
2answers
2k views

Coordinates of intersections

In axis environment I have a curve and a line intersecting it. How can I get components of intersection-1, intersection-2 etc. in axis units? \documentclass{minimal} \usepackage{pgfplots} ...
7
votes
1answer
1k views

import input pgfplots with relative paths

The package import makes it posible to \input (and \include) a .tex document which itself \input (or \includegraphics etc.) stuff using relative paths. I was hoping that this also would work with the ...
12
votes
1answer
2k views

Stacked barplots/groupplots with text labels in x-coordinate

I was trying to stack a groupplot, or was it grouping a stacked plot? However I was trying to get something like: The ybar stacked option works quite nice here. But when I try to adapt it to a ...
9
votes
1answer
595 views

Disable warning messages in pgfplots

When I plot a graph with pgfplots sometimes I got such warning message NOTE: coordinate (500,0) has been dropped because of the y-coordinate filter. However in may case such points are legal. How ...
6
votes
1answer
1k views

pgfplot consistent number format

I am trying to make a the number format in my pgfplots the same, as in the rest of my document. I am normally using the \num from the siunitx package to typeset numbers, and would like to use it in my ...
8
votes
1answer
3k views

pgfplots ticklabel format logarithmic scale

How do I disable exponent notation on logarithmic scale? I want ...,$10^0$,$10^1$,$10^2$,... replaced by ...,1,10,100,... I have tried to play with this default(pgfplots manual p. 209): ...
14
votes
4answers
2k views

Plotting the solution of inequalities with WolframAlpha or Maple

I want to plot the solution of two inequalities and include them in a LaTeX paper. I really like they way this looks: Wolfram Alpha. Unfortunately, I have no idea how to export this into a ...
8
votes
1answer
1k views

Contour plot labeling applied to ordinary 2D plots

I was trying to obtain the effect that I manually created below,shown with the letter n. Now, I know that this is customary to do in contour plots, hence I've checked the manual and saw that it is ...
9
votes
2answers
822 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 ...
16
votes
1answer
5k views

Colors and legend in groupplots/barplot

In order to compare three items I use the groupplot command. For each item I have n different criteria to compare. Is it possible to set the color for each criteria itself? Meaning the first bar in ...
7
votes
2answers
3k 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
383 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} ...
1
vote
1answer
291 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 ...
15
votes
1answer
2k 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 ...
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
636 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
1answer
289 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
727 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
859 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 ...
4
votes
1answer
1k views

pgfplots, custom legend and tikz library external

I try to create Tikz figure with several pgfplots subplots. I want to have one legend for them since they all have the same curves. I found out from this question that i can label and than reference ...
3
votes
1answer
842 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
2answers
2k 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 ...
17
votes
3answers
6k 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 ...
4
votes
2answers
1k 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 ...
38
votes
3answers
10k views

pgfplots: how can I scale to text width?

This question led to a new package: tikzscale When I try to scale a plot with: width=\textwidth there is some horizontal space between the start/end of the plot and the start/end of the ...