{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

11
votes
1answer
950 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
6k 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
790 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
3k 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
336 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
471 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
801 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
366 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
815 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
989 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
975 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
716 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
811 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
655 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} ...
22
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?) ...
9
votes
1answer
5k views

PGFplot to occupy full \linewidth, and aligned y=axis across tikzpicture

How do I get the tikzpicture to occupy the full \linewidth, and also have the left and right axis aligned? I suspect that some \phantom spacing applied to the tick labels will do the trick, but don't ...
0
votes
1answer
825 views

PGFplot Dimension too large/TeX Capacity Exceeded after reduction in domain and range

In trying to graph the intersection of 3^x and x^3, I was shrinking the domain to properly show one of the intersections. However, once I reduce the domain, I get either Dimension too large, or TeX ...
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} ...
6
votes
1answer
327 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} ...
6
votes
1answer
977 views

tick removal with pfgplots

To remove the ticks of a figure (and not the tick labels), I could only find the opacity trick, that I find odd. Is there any better way? \documentclass[12pt]{book} \usepackage{tikz,pgfplots} ...
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 ...
5
votes
1answer
903 views

In PGFplots, how can I have arrows as markers for plots in order to have them appear in the legend?

In my plot, I want to indicate the direction of a graph with arrows. Usually, I would just create something like this: \begin{tikzpicture} \begin{axis}[ axis x line=center, axis ...
6
votes
1answer
1k views

Using 'semilogyaxis' with 'groupplot' in PGFPlots

Using groupplot library of PGFPlots, the command \nextgroupplot can take the parameters that \begin{axis} used to take. So giving it the option "ymode=log" should effectively make the plot a ...
16
votes
2answers
1k 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 ...
4
votes
1answer
327 views

More: Generalised: Accessing the logic values of a TikZ coordinate

This is a follow-up question to: Generalised: Accessing the logic values of a TikZ coordinate. In that question a PGFplot answer was suggested by jake. I took that answer and modified it to the ...
5
votes
3answers
2k views

A problem with “Tikz + Gnuplot”, set terminal table

When I use Tikz to plot a function. I followed the instruction to use gnuplot to do so. I did that half year before. But now when I recompile, the gnuplot has problem with the first line of its ...
3
votes
1answer
359 views

pgfplots ycomb width

Is there a simple way to control the width\thickness of the strokes in the ycomb/xcomb commands proposed in pgfplots? Or should I dive into the source code to clarify?
2
votes
1answer
1k views

How to correct for a xshift in the pgfplot legend?

Using the following example code: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{axis}[ xlabel=$x$, ...