{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

9
votes
1answer
583 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 ...
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 ...
18
votes
2answers
1k views

How to minimize the ink-to-data ratio for pgfplots

Tufte advocates to "minimize the ink-to-data ratio" for charts. I am trying to style a multi data series bar chart, that can have a grid and axes as shown below (chart at the left is from the ...
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 ...
6
votes
1answer
9k views

How to configure axis on pgfplots?

How to configure axis on pgfplots? Similar for this. \documentclass{article} \usepackage{tikz,pgfplots} \pagestyle{empty} \begin{document} \begin{tikzpicture}[>=latex] %x axis \draw[->] (-5,0) ...
31
votes
2answers
13k views

number format in pgfplots axis

How can I change the type of the decimal/thousand separator from the american one to the european one? More precisely, I want: "1000" to be written as is, instead of "1,000" "0,1" instead of "0.1" ...
4
votes
2answers
1k views

Line break in datapoint label with pgfplot?

I have a bar chart, with labels for each column. I would like to break these labels over two lines. I'm not using nodes so the "align" trick doesn't seem to apply. Minimal example: (from Lyx) ...
8
votes
2answers
761 views

How to maintain the ratio between two axis in pgfplots

I have two axis environments both containing different plots. I do however want to maintain comparability between both, i.e. I want both plots to consume the same space on the paper for a coordinate ...
6
votes
1answer
2k views

How to use sin function in pgfplots?

How to use sin function in pgfplots? In this post Timing and integration with TikZ PGFlots i need [/pgf/declare function={f=sin(x);}] but generate a line, and [/pgf/declare function={f=sin(x r);}] not ...
10
votes
2answers
1k views

Timing and integration with TikZ PGFlots

How do I set intervals or integration with TikZ PGFlots? Something similar to the figure below, but I want to define the function, the intervals of integration and the partitions. ...
6
votes
1answer
2k views

Multi-line nodes/annotations in pgfplot

It would be great if I could get the annotation in the graph depicted below on two lines, but I can't seem to figure it out. Presently, I have: \begin{tikzpicture} \begin{axis}[ ...
4
votes
0answers
1k views

How can I export pdf files with tikz/pgfplots? [closed]

I am writing a long thesis and would like to source out some graphics, so that I do not have to in every run I am compiling the tex file. Here is a simple example: \documentclass[a4paper]{scrreprt} ...
9
votes
2answers
2k views

Asymmetric “enlarge x limits” in pgfplots

I need to specify different "enlarge x limits" for the lower and upper axis extrema. Something like enlarge x limits={{value=0.2,upper}, {value=0.4,lower}} does not work however. Any ideas? Using xmin ...
11
votes
1answer
964 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, ...
5
votes
1answer
2k views

How do I change font in pgfplots with plain XeTeX?

I have tried: \font\figfn="Myriad Pro:mapping=tex-text" at 8pt \input tikz \tikzset{font=\figfn} \input pgfplots \pgfplotsset{ width=\hsize, compat=1.3, every axis label={font=\figfn}, tick ...
24
votes
1answer
7k views

How to prevent pgfplots from using the 10^n notation for axis ticks

When creating a plot like this one \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} \addplot coordinates { ...
7
votes
1answer
3k views

Rectangle around data points in pgfplots

If I have some data points in a pgfplot, how can I draw a rectangle around them, with the rectangle using the same coordinate system as the points? I've included an example which does not work below. ...
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 ...
12
votes
1answer
4k views

Non-linear curve fitting with gnuplot

I am trying to use gnuplot with pgfplots in TexShop, following on from an example by Martin H in the comments here. I can get the data points in OK, and plot them but the fit (red line) does not seem ...
36
votes
3answers
12k views

Pgfplots: how to fill the area under a curve with oblique lines (hatching) as a pattern?

I want to hatch the area under a curve (graph of a function) with oblique lines on an interval (to illustrate the function's integral on that interval). This can be done elegantly in gnuplot... ...
3
votes
1answer
820 views

How to get the domain for the line of best fit w/pgfplots to be all real numbers?

Although I already worked around this problem by finding the x-intercept with the linear regression equation I calculated w/gnuplot, I'm still curious to know how pgfplots can do it without me ...
37
votes
3answers
3k views

Is there a package that provides graphing in the style of Ed Tufte?

I have recently started using the tufte-latex package for various science writing and, while I love the package generally, am dismayed that it does not include the ability to produce graphics (charts, ...
5
votes
1answer
4k views

Specifying a domain and pgfplots

I'm making a graph with pgfplots with a specific domain, but the graph's domain (both x and y) are not changing. I'm reading through the pgfplots manual and I think I'm doing the right thing except ...
9
votes
1answer
1k views

PGFplots skip the first row of a table on which there are NaN values. Why?

Suppose to have a file .dat like this: -4.8767000e+000 -2.9142000e-001 NaN NaN NaN NaN -3.9017000e+000 -4.1404000e-001 NaN ...
4
votes
0answers
1k views

Problems by enlarging tex memory [closed]

I have a problem with the tex memory while using pgfplots and a very huge dataset in Ubuntu. Under Windows with MikTeX I have the following settings and the texfile compile without any problems: ...
8
votes
3answers
2k views

Cut-off cone in TikZ

How would I draw the following cone using TikZ? I have no clue how to incorporate the "cut-off". I want to draw a picture of the cone given by the points (y, t) for y in R^d and t in (0, infty) such ...
15
votes
3answers
3k 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 ...
5
votes
1answer
344 views

pgfplots axis descriptions from file

I was wondering if there is any way to make pgfplots read the xlabel and ylabel from a file. This is similar to this question Using Labels from a File in PGFplot but I'd like to read the column ...
5
votes
1answer
1k views

How to fill area under plot using a color map?

I have one diagram showing a function f(x,y) like imshow does, and a second diagram that shows the probability distribution P(f). Find below an image of the situation. The code for the plot at the ...
1
vote
2answers
481 views

baseline of custom marks in pgfplots

I'm trying to plot some intervals with pgfplots and wanted to use a custom mark for upper and lower bound. I planned doing this by using a "V" for the upper bound and a "^" for the lower bound ...
4
votes
1answer
810 views

pgfplot: Pin drawn on top of ybar stacked plot

I need to label some components of a stacked bar plot in pgfplot, and I would like the pin to be visible to the center (rather than the edge). I believe it is currently being drawn to the center of ...
7
votes
2answers
370 views

How to emphasize within a listing two successive identifiers separated by a space?

I have this pgfplots code that I want to put in a lstlisting environment: \pgfplotsset{ every axis x label/.append style = { font = \small }, every axis y label/.append style = { ...
12
votes
2answers
5k views

Drawing curves and multiple y-axes in one plot with pgfplots

I'm aware of the possibility given by pgfplots to have two y-axes, one on the left and one on the right with two different scales. But I'd like to explore other ways to have multiple axes, e.g. ...
4
votes
1answer
830 views

pgfplots: stacked plots using absolute values instead of relative

I would like to use absolute coordinates instead of relative values when using a ybar stacked plot. Is this possible? I know I can just reformat my data to be relative, but it sounds like pgfplots ...
10
votes
1answer
9k views

Problem plotting histogram using pgfplots package

The following code plots a histogram using pgfplots. \documentclass[a4paper]{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \centering ...
1
vote
3answers
1k views

Tikz Axis with colormap bounding box does not align with other bounding boxes

My last question here was concerning tikz-axis aligned with centered other pictures. I received a very good answer. This question is similar but extends the question by a colormap as in the given ...
7
votes
1answer
6k views

How to create a bar chart in which the y-axis is expressed in percents?

Suppose there is a chart like the following: This chart was created using the code: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
4
votes
2answers
1k views

Rescaling ticks

I have created a simple 2D plot from a table (xy-data) and now I would like to both translate and scale the x-axis. (I would prefer not to scale the actual data only the axis). As an example, let's ...
6
votes
1answer
994 views

How to fix a contour plot at top of a 3D box

I want to fix a contour plot at the top of a 3D box. The following code sets the contour plot to the base: \documentclass{scrartcl} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=newest} ...
3
votes
1answer
2k views

smooth surface plot with pgfplots/gnuplot

i want to create a smooth surface plot with pgf-plots and gnuplot. The following code yields a graph, but i need much more gridpoints along y-direction. How can i reach this? The increase of samples ...
2
votes
1answer
1k views

Tikz Axis bounding box does not align with other bounding boxes. What can I do?

I want to place a lot of pictures and plots in a long document. By now, I am using figure-environment with center-environment, but the tikz-axis-plots didn't align well with included eps-pictures or ...
12
votes
1answer
6k views

Default color pgfplot

I noticed that when using pgfplots to make plots without specifying style, it automatically assigns the same color and line style to the first input and fifth input, which means the two curves would ...
1
vote
1answer
3k views

Pgfplots: Linewidth when using \ref in custom legend

I'm creating a custom legend for some pgfplots graph by drawing a node containing a shortstack. Inside the node I'm using \ref{} to insert correct line-styles in front of my text labels. The problem ...
5
votes
2answers
2k views

Fill area of curve above a line using pgfplots

This question is related to Fill between two curves in pgfplots. which started me of. However, I need to have just the area above the reference line filled. \begin{tikzpicture} ...
3
votes
1answer
731 views

When using pgfmathparse to offset plots, how can I remove the extra tick?

I plot a few data sets into the same chart using pgfplot and I therefore use \pgfmathparse to offset every plot a bit to the left or the right. I found out that the first plot will always be the ...
3
votes
1answer
2k views

pgfplots and figure centering

I'm wondering about a way to exclude the axis labels and axis graduation from how latex will center the figure with respect to the caption. Labels and graduation along the y-axis (assuming it lies on ...
0
votes
1answer
814 views

xlog scale with pgfplots for random x-values

in the code below, two things should be modified: xlabels and xgrid should appear for x=10^-0.1, x=10^0 and x=10^0.1 only the grid along the x-axis should reflect the logarithmic scale (ie, not ...
6
votes
2answers
5k views

Get default colored plots with “no markers” command in pgfplots

I want to plot several curves with a \foreach command in pgfplots. I don't want any markers, and I can't find a way to get colored plots without markers in a \foreach loop. Using no markers gets rid ...
1
vote
1answer
663 views

use the coordinates of an axis tip with pgf plot

here's a drawing I just made (the sine function are replaced by external datas) \documentclass[12pt]{article} \usepackage{pgfplots} \usepackage{tikz} ...
23
votes
2answers
8k views

How to combine fill and pattern in a pgfplot bar plot?

Is it possible to combine a TikZ pattern with a background of a chosen color? \addplot[black,fill=yellow,pattern=north east lines] ... yields bars which have black stripes on white (transparent?) ...