{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
499 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
492 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
702 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 ...
24
votes
1answer
6k 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
453 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
11k 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
868 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
3k 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
838 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 ...
11
votes
1answer
3k 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
7k 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 ...
6
votes
3answers
3k 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
323 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 ...
10
votes
1answer
3k 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'); ...
18
votes
3answers
5k 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 ...
12
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} ...
8
votes
2answers
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
726 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
2k 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 ...
9
votes
2answers
4k 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
917 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 ...
19
votes
1answer
7k 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 ...
9
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
414 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} ...
2
votes
1answer
340 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 ...
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 ...
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
768 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
355 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
957 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
1k 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
990 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 ...
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 ...
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 ...
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 ...
42
votes
4answers
14k 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 ...
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
7k 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 ...
7
votes
3answers
372 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 ...
7
votes
1answer
3k views

Center nodes near coords in a stacked ybar plot

I'm trying to center the node values, at the middle of each bar, in a stacked plot. However I can only put those nodes in the top of each bar. Is it possible to move those down? To the center of each ...
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 ...
8
votes
1answer
792 views

pgfplots ticks are not applied

I am trying to create a 3D plot with custom z-ticks. However I can not create them with starting negative number. It works however as expected when the ticks start at 0. My code is this one ...
1
vote
1answer
381 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! ...