{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

8
votes
1answer
241 views

pgfplot change label from axis

I have created this plot with tikz \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture}[scale=0.9] \begin{axis}[ xlabel=$\alpha$, ...
3
votes
1answer
184 views

Why do I get an incorrect graph when I plot a function with multiplication expressed by parentheses?

When plotting certain expressions with pgfplots it seems to give the wrong result. Consider the following \documentclass{article} \usepackage{pgfplots} \pgfplotsset{ compat=1.7, no marks } ...
22
votes
2answers
5k views

Fill the area determined by two pgfplots graphs

I need to fill the region determined by two (Gaussian) curves and the right red line (the region is brushed in green in the figure below). I also wonder what is the best way to draw vertical line ...
3
votes
1answer
294 views

pgfplots: marks in table as ellipse with size of error bars, area of uncertainty?

Is it possible, and if yes how, to plot a table with pgfplots where the marks are ellipses with the major and minor semiaxes being the size of the error? Such that a data point is displayed as its own ...
5
votes
1answer
1k views

How to specifiy xticks in log-axis mode (tikzpicture) to be written in non-exponential format?

I want to specify some xticks in a log-log plot (tikzpicture). This works fine, but they are always printed in exponential format (with basis 10). In general this is fine, but for one plot I would ...
3
votes
1answer
132 views

Make the label surrounding line disappear

Referring to How to plot the graph below? Is it possible to make the label surrounding lines, and the top and right lines for the coordinates disappear?
5
votes
2answers
390 views

How to plot the graph below?

May I know how to draw the graph as shown below? below is a code I have try but with look and feel that is quite far away from the example: \begin{tikzpicture} \begin{axis}[ legend pos=north ...
7
votes
1answer
15k views

Put legend (pgfplots) below the plot

I have a pgfplot where the legend is right to the plot. I create the plot as follows: \begin{axis}[ scale only axis, xmode=log, ymode=log, width=7cm, legend cell align=left, ...
2
votes
1answer
463 views

pgfplots: fill the volume under a 3d surface

I have a very simple 3d graph. \begin{tikzpicture} \begin{axis}[view={60}{20}, %axis equal image=true, xlabel=$X(T)$, ylabel={$D(T)$}, zlabel={$V(T)$}, zmin=0 ] \addplot3[surf,shader=flat,z ...
6
votes
1answer
802 views

Common scale for pgfplots groupplot

The groupplots environment allows global values of xmax to be set. Is there a way to automatically select a common value for all plots in a group? For example, with the code below, the 4th plot does ...
8
votes
2answers
805 views

Strange error bars problem

I'm trying to get error bars to show correctly on my plot using pgfplots. I am wanting explicit relative error bars in both directions for my y-data, and what I am getting is perplexing. The error ...
7
votes
3answers
507 views

Calculate function with integers as input and plotting

I'd like to plot the function 1/2*x(x+1) in for integer values ranging from 3 to 20 and in particular I'd like the function to be plotted in those points. I have managed to create the following graph ...
11
votes
1answer
753 views

how to draw interrupted bar charts in pgfplots

Is there a way to interrupt the bar charts in pgfplots? More specifically, I have a plots with bar charts and one chart has extremely high values, so that you can hardly see the others in a scale. ...
21
votes
1answer
10k views

Option clash for package xcolor

I'm writing a report, and have a rather large table in my appendix. I'd like to emphasize some specific values by coloring some single cells. I'm trying to do it with xcolor. But receiving the error: ...
8
votes
1answer
2k views

How to vertically align two pgfplots in subfigures?

I want to have two subfigures in a figure. Each subfigure contains a simple pgfplot. Here is what I have: \documentclass[12pt]{article} \usepackage{subcaption} \usepackage{pgfplots} ...
3
votes
0answers
355 views

pgfplot gives an error despite using the latest version v1.7 [closed]

I keep getting this error every time I compile using the pgfplot package "! Package pgfkeys Error: I do not know the key '/pgfplots/error bars/ .cd' and I am going to ignore it. Perhaps you ...
1
vote
0answers
58 views

PGFPlots fixed number formatting fails on small numbers [duplicate]

Possible Duplicate: How do you remove the axis multiplier? I have a problem getting fixed (as opposed to scientific) number formatting on my axes in PGFPlots. The following example: ...
5
votes
1answer
262 views

Plot weighted frequency matrix

I wish to create this plot preferably in pgfplots or tikz. I have actually got a version plotted (with help from SO), but I have used R and exported the plot using tikzDevice. I can't post the ...
5
votes
1answer
445 views

pgfplots: \thisrowno{} is an undefined control sequence?

A lot of code about pgfplots I found (also here on tex.stack) was using \thisrowno{} to address specific rows of a table. All of these had no additional pakages loaded than I do in the following ...
6
votes
2answers
3k views

pgfplot column chart legend shape

I have the following code in Latex using gpfplot. The legend in the generated graph always looks like the image attached. There are two boxes instead of one for each entry. Why this is happening? How ...
18
votes
1answer
1k views

Drawing timeline

I have a dataset which consists of repeating events over time. Each event takes an arbitrary amount of time. I could plot this using gnuplot but am unable to produce correct keys because of the ...
7
votes
5answers
796 views

How to create this image (graphing)

I want to create a graph with only the first quadrant. The values of x can only go from 0 to 9 and the values of y can only go from 0 to 9. In this graph, I want dots for (2,5), (3,3), (5,2) and ...
6
votes
1answer
267 views

Plots only logarithmicly spaced samples

I have a data file with many entries, order of 10000. I want to plot them all with lines, and a small subset of them with points and error bars (can not plot error bars on 10000 samples). Plotting ...
6
votes
1answer
777 views

Improve pfgplots precision with gnuplot

I have measured the execution time of two algorithms (a naive, and an optimized one), and I would like to display measured data with pgfplots plus a trend line for the naive algorithm. I have used ...
3
votes
1answer
773 views

pgfplots: scatter plot with interpolation

Today I have a question about scatter plots: Is it possible to interpolate scatter plots? In my work I often use "intensity plots" (that's how we call them). In these plots x and y are positions, ...
7
votes
1answer
1k views

Compiling CircuiTikZ with -shell-escape (pdflatex)

I'm trying to use both CircuiTikZ and pgfplots. In order not to overflow LaTeX memory, I use the TikZ externalize library with -shell-escape command in pdfLaTeX. It compiles the pgfplots nicely, but ...
9
votes
1answer
422 views

Adding a legend header

I would like to add a legend header to one of my pgfplot. So far I get that \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ ymin=0, ...
6
votes
2answers
282 views

I need to provide a duotone pdf, what do I need to do with my figures?

I need to provide a duotone pdf (say black and cyan). My figures are made with tikz, pgfplots and asymptote (3D but no prc), some with opacity effects. I compile with pdftex and luatex. What do I ...
5
votes
1answer
3k views

error bars with pgfplots in foreground

I am plotting with pgfplots a plot with error bars with the following code: \documentclass[12pt,twoside, a4paper]{report} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.6} ...
20
votes
1answer
6k views

What does “running in backwards compatibility mode” mean and what should I fix to get rid of it?

I was typesetting a Tex file, but I got this warning: ! Package pgfplots Warning: running in backwards compatibility mode (unsuitable tick labels; missing features). Consider writing ...
9
votes
3answers
1k views

pgfplots: Use \times symbol for scientific notation in plot axes

When creating a plot like this one \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ scaled y ticks=false, yticklabel style={ ...
2
votes
0answers
386 views

axis discontinuity in bar chart [duplicate]

pgfplot provides the possibility to insert a discontinuity on the axes (see MWE 1 & first srceenshot). However, it seems as this discontinuity is only applicable from the value 0 to ymin/xmin. I ...
3
votes
1answer
550 views

Histogram fill with logarithmic scale

I face a "filling" problem when I run one of the pgfplots example but with y-log scale. Here is the MWE \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
2
votes
1answer
1k views

Minor ticks not showing when using matlab2tikz

I am using matlab2tikz to import MATLAB figures into TeX. However I can't seem to get the x or y minor ticks to show in the document compiled by TeX. The MATLAB figure I have converted to .tikz have ...
3
votes
1answer
1k views

PGFplots and boxplots: How to tune width and separation of boxes?

I would like to use pgfplots to draw boxplots. This minimal example works fine for me. But I would like to display more data in this form \begin{filecontents}{testdata.dat} 0 1 1.2 0.4 1.5 0.2 1 2 ...
8
votes
3answers
3k views

pgfplots with symbolic x coords and error bars

I am trying to plot explicit error bars like this: \begin{tikzpicture} \begin{axis} [symbolic x coords={Lighting,Computers,Total}] \addplot+[only marks] plot[error bars/.cd, y dir=both, y explicit] ...
9
votes
1answer
4k views

set minor grid values in pgfplots

I have a weibull plot (at least I try to create a decent one), based on the code shown here. However I do want to have a minor grid as it typically appears in log plots. Here however the y axis tics ...
2
votes
1answer
153 views

How to inline tikzexternal.sty

I am preparing a document, which uses pgfplots, for submission. I externalized figures etc. successfully. Though, now I'm facing a serious problem: On the target system the tikzexternal.sty file may ...
6
votes
3answers
767 views

Adding a Known Trend Line to a tikz plot rather than connecting the points

The graph below is currently plots a point at each value of x that is an integer between -10 and 10 and connects them. What I'd like to do instead is more like this: First, I'd like to add a red, ...
3
votes
1answer
436 views

Filter by value when reading and calculating data using pgfplotstable

I am trying to plot data from a file, using pgfplots for the plot and pgfplotstable to read in the data and calculate a new column (cummulative values from another row), which is plotted as well. My ...
6
votes
2answers
1k views

Plot in TikZ: f(x) = 1/(x – 2) + 3

I am trying to plot the function f(x) = 1/(x-2) + 3 using TikZ, however I get that the domain is undefined. What code should I type?
1
vote
1answer
192 views

Move ylabel with pgfplot

My ylabel is to far from ticks and I would like to make it closer. Especially ylabel of the right plots. \begin{tikzpicture} \begin{axis}[% view={0}{90}, width=5.5cm, height=4.5cm, scale only axis, ...
8
votes
1answer
4k views

Two columns in legend in pgfplots

I know how to create a legend in a pgfplots plot. See Legend in tikzpicture and Using a pgfplots-style legend in a plain-old tikzpicture. But I do not know how I can create a legend with two ...
9
votes
2answers
169 views

Identification of an empty macro from pgfplots using \ifx

Consider following MWE and the output thereafter. I have defined an empty macro and used \ifx to identify it as such. However, when an empty macro is received from \pgfkeysgetvalue, \ifx doesn't work. ...
1
vote
1answer
212 views

Pgfplots and round-off error

Hi have a graph that must demonstrate the oscillation of energy of a numerical scheme. The problem is that the energy is something like this: -9.99999994950000e-01 and I have oscillation after 8 ...
2
votes
1answer
291 views

Graphing linear probability model using pgfplots

So, I am attempting to use pgflots to draw a sketch of a one-independent variable linear probability model in the form of the equation I have below, which shows the implied relationship between E(Yj) ...
8
votes
1answer
2k views

Different color for individual bar in bar chart & adding bar labels

Please consider the following MWE. There are three things I would like to do: Individual colouring For the last element ("not rejected") I would like to fill the bar with another color (e.g. ...
1
vote
1answer
823 views

Marker color in legend

Since I updated to TexLive2012 yesterday, I can't get ant colored markers in my legend. Where as first I could put the following in the \addlegendentry options, it now won't work. ...
7
votes
1answer
456 views

Does the pgfplots manual crash your Preview and/or Skim app on OSX?

The pgfplots manual consistently crashes both my Preview.app and my Skim.app. A quick google search yields a closed bug report on the pgfplots Sourceforge page and a related question on ...
8
votes
1answer
466 views

Draw only regions of a hyperboloid in pgfplots

I'm interested in the hyperboloid u^2 + v^2 - w^2 = 1, which can be parameterized as u = cosh(x) cos(y), v = cosh(x) sin(y), w = sinh(x). This parameterization can be used to draw the hyperboloid ...