{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

2
votes
0answers
60 views

Arrows with charts, labels, tkiz and pgf

I would like to draw an arrow from the K in the first chart to the E in the x-label of the second chart. Normal arrows are working but nodes in the axis labels don't seem to work. Do you have any ...
3
votes
1answer
30 views

Vertically align pgf plots with y-axis

I want to vertically align my two graphs, so that the y-axes are aligned. The problem is that the one y-axis has double digits and the other has single digits as the units. \documentclass[12pt]{...
2
votes
1answer
79 views

pgfplots boxplot first column as draw position

I have data like this in a file. 1 0.1 0.2 0.3 0.8 ... 5 0.3 0.5 0.6 0.9 ... 10 0.2 0.3 0.7 0.10 .. ... How do I tell boxplot to use the first column as draw position and compute the box for the ...
5
votes
1answer
63 views

xtick in polaraxis useless

As a followup question to my answer here, I have a problem with the polaraxis of pgfplots. When I try to define xtick, nothing changes compared to dropping the option. MWE \documentclass{standalone} ...
0
votes
0answers
24 views

TexShop 2.47 on iMac9,1 mac os 10.6.8 does not see the pgfplots package

I have just started to study pgfplots. I am using three macs: two MacBooks and an iMac, all running Snow Leopard (10.6.8). TexShop uses pgfplots without troubles on my MacBooks, but on my iMac it ...
5
votes
1answer
99 views

Adding wavelength co-ordinates to pgfplots Smith Chart?

I have currently been using the pgfplots smith chart \documentclass{standalone} \usepackage{pgfplots} \usepackage{amsmath} % Required for \varPsi below \usepackage{steinmetz} \usepgfplotslibrary{...
1
vote
1answer
24 views

Removing the line from a graph label in pgf

I've produced a graph with the following code: \begin{tikzpicture} \begin{axis}[ trig format plots=rad, axis lines = middle, enlargelimits, clip=false, ticks=none ] \...
2
votes
1answer
58 views

Individual Tick style for each Tick

I would like to raise the left Tick over the x-axis so it doesn't clip into the graph. However If I add a second "Extra x ticks" definition the first definition gets overwritten. How can I achieve an ...
1
vote
0answers
22 views

pgfforeachungrouped with three arguments

This is a follow-up to a previous question of mine, with a slight addition. I would like to loop over data in a file and give the plot styles as a list. In the old question I gave only a color and an ...
3
votes
1answer
83 views

Shading parts of a plot using pgfplots

I have the following plot that I need for my presentation. I have a minimal code for the same, however the shading is an issue. I am yet to be fully in grips over using PGFPlots. \usepackage{tikz} \...
1
vote
1answer
85 views

How to fill the parameters of `boxplot prepared` with data from table using PGFPlots?

I want to draw a boxplot using boxplot prepared@ Page 469 of pgfplots-manual; v1.13, with the values of lower whisker, lower quartile, median, higher quartile, and higher whisker from a data file. ...
3
votes
1answer
109 views

Prism with curved surfaces with pgfplots

How can I reproduce the 3D prisms shown below using pgfplots (even if they'll be a collection of surfaces is ok)? My main problem is the generation of the bottom and top surfaces. I also tried to use ...
3
votes
1answer
48 views

Positioning with `current axis` depending on limits?

I try to specify the x axis label position below the x axis arrow at the same baseline like the xticklabels. It works fine for most plots. However, when modifying the range of the y axis with ymin=...,...
1
vote
2answers
80 views

how to set plot box aspect ratio

How can I set the box plot (i.e. axis) ratio of a usual 2D plot to a given value, say 4:3. I don't want to use unit vector ratio since the quantities of the independent and dependent variables are of ...
3
votes
0answers
13 views

Undesired jitter in pgfplots when consecutive values are close [duplicate]

I need to plot data where some of the consecutive coordinates are very close to each other. There seems to be something weird jitter appearing when this is done using thick lines, as may be seen in ...
1
vote
1answer
45 views

pgfplots: how to make the axis thick?

I can't make the axis thick and with an arrow. This is my code: \begin{tikzpicture}[xscale=0.8,yscale=0.8] \begin{axis}[axis line style = thick, domain=0:1, samples=50, axis lines*=middle, xtick={0,1}...
4
votes
1answer
58 views

Plot composite functions using tikz

I'm trying to plot something which I thought was very simple: sin(ln(x)) But this exact line in my plot doesn't work: \addplot[draw=red]{sin(deg(ln(x)))}; The error that I receive is: Missing ...
2
votes
1answer
58 views

Strange behavior x tick label style versus y tick label style

I've made a graph with this code: \documentclass[11pt,a4paper]{article} % use larger type; default would be 10pt \usepackage{pgfplots} \usepackage{tkz-euclide} \begin{document} \begin{...
0
votes
0answers
63 views

Gaussian/Normal plots from a data distribution in scientific notation

I am new to Tex and trying to plot a gaussian distribution from a set of values. I have the following set of values and would like to plot a normal distribution for them. 2.9954E-09 3.1314E-09 3....
1
vote
1answer
33 views

offset triangle on log-log pgfplot

Every post I've seen where they use pgfplot for plotting a log-log scale usually use a triangle to give the slope of the curve, something like the following: \documentclass{article} \usepackage{...
2
votes
2answers
82 views

Exponent location of second y axis in pgfplots

A minimum working example for using a second y-axis in pgfplots is the code below \begin{tikzpicture} \begin{axis}[scale only axis, axis y line*=left] \addplot[no marks, blue] {x^2}; \end{axis} \...
2
votes
1answer
66 views

How I can change values on the Y-axis

\documentclass{article} \usepackage[sc]{mathpazo} \usepackage{pgfplots,amsmath} \usepackage{tikz} \usepackage{tkz-fct,tkz-base} \usepackage{tkz-tab,tkz-euclide} \usepackage[miktex]{gnuplottex} \...
3
votes
1answer
66 views

AIAA Latex template and tikzexternalize

I am using the AIAA class v3.8 from Texlive 2014 distribution for a communication paper. I try to use the export feature of Tikz, with tikzexternalize, as described in the documentation. For me, ...
1
vote
0answers
78 views

How to set a fixed bin width for pgfplots histogram?

I want to plot multiple histograms next to each other using pgfplots, and I found the nice statistics library. However, I can't find how I can set the bin width at a fixed size instead of the amount ...
2
votes
0answers
36 views

Control yticks using a mathematical formula

I am trying to define the yticks using a mathematical function of $ymin$ and $ymax$. Although the $y_{min}$ $y_{max}$ are known, I can't insert explicit values for yticks because I have to do this ...
2
votes
1answer
66 views

animated plot axis label werid moving

When I use the animate package the axis labels start to dance and bounce as the scale moves, how do I stop this from happening? Also: How do I make the animation smoother? Increasing the framerate ...
3
votes
1answer
49 views

Show tick labels on both edgess in groupplot

I would like to put quite many small plots in a groupplot environment and provide ticklabels on all adges of the groupplot (no labels at individual plots). In the following example, I've set the ...
6
votes
0answers
69 views

Barchart with Different Colors and Labels for Positive or Negative

I have a simple bar chart below and I'd like to change the color of the bars if the value associated with it is positive or negative. I'd also like to change the Y labels to use different labels ...
2
votes
1answer
41 views

pgfplots: minor tick num on one axis

I was just wondering if it was possible to use minor tick num on one axis only. \begin{axis}[ axis x line = bottom, axis y line = left, minor tick num=4, xlabel={$t(s)$}, xmin=0,xmax=5, ylabel={$x(m)$...
4
votes
1answer
50 views

Trouble with pgfplots ternary diagram

I've been trying to help my wife with a ternary diagram that she needs for her master thesis, but I'm having unexpected trouble with pgfplots. The following code, which I got from an answer from ...
4
votes
1answer
59 views

Adding number from text file to axis label

I have a bunch of standalone tikz images that I need to add a number to the axis label. The number that I add to each label is in a text file that may change depending on which dataset I use. Is there ...
3
votes
1answer
51 views

filter pgfplots data more than once (e.g. with discard if)

I want to filter a dat file more than once (i.e., filter on multiple columns), and the usual solution with "discard if" and "discard if not" doesn't seem to work. I.e., the following (were file.dat ...
5
votes
1answer
30 views

Discard values = 0 in pgfplots

In the code below, how do I go about removing all the enteries where the y1 AND y2 value = 0? Thanks for your help. Here is the original code that was masterfully written by Stefan Pinnow found here:...
0
votes
1answer
53 views

Straight lines from x-axis to markers in pgfplots part 2

This post is building from the post found here that has an elegant solution proposed by JMP. I wanted to append just red markers to the existing plot so that the plot looks like: In summary, I ...
1
vote
2answers
56 views

Straight lines from x-axis to markers in pgfplots

I am trying to get a plot where there are just lines from the x-axis to the markers like this: Here is a MWE that I have so far: \documentclass{article} \usepackage{pgfplots} \usepackage{...
1
vote
0answers
30 views

How to get only two `yticklabels` using `groupplots` library

Having several subplots generated using groupplots library, I would like to automatically detect the data range in each subplot, and specify two yticklabels only (ymin and ymax). Because the data ...
2
votes
1answer
30 views

pgfplots: calculating intersections and drawing arrows to the axis with foreach

I am trying to find the intersection points between two curves and draw arrows from each of them to the x-axis. I tried the following code: \documentclass{article} \usepackage{pgfplots} \...
2
votes
1answer
43 views

Put pgfplots axis on the margin of printable text area

In order to gain some horizontal space (e.g. to put two plots next to each other) and because this is the least ugly solution for that I would like to be able to put the axis line of a pgfplot exactly ...
3
votes
1answer
84 views

force \groupplot to start from the bottom left corner

Using \groupplot, subplots are generated starting from the upper left corner as shown in the following illustration: Is it possible to force it to start from the bottom left corner, i.e : Here is ...
3
votes
0answers
76 views

“scale only axis” only for one axis?

EDIT: I completely rephrase the question. Consider the following MWE: \documentclass{article} \usepackage{showframe} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[...
3
votes
1answer
67 views

Axis label positioning in pgfplots

Can someone please help me explain why label positioning in the following code does not work? It is not clear what I am doing wrong. I also tried axis description cs. That does not change the label ...
1
vote
0answers
42 views

reading inline table from macro

For a patch plot I need to read the patch table from a previously defined macro \mytable. However this results in an error: ! Package pgfplots Error: Sorry, the choice 'row sep=crcr' is currently ...
1
vote
0answers
46 views

Generating bar plot of sepearte colours

I am trying to plot a graph like below: Code that I have written already is: \begin{figure}[t] \begin{tikzpicture} \begin{axis}[ % symbolic x coords={$\tau =5$,$\tau = 10$,$\tau =15$,$\tau =20$, $...
2
votes
2answers
159 views

Using \tikzexternalize

I want to use tikzexternalize in my document, because the amount of tikz pictures is quite large. In general my tikz pictures are generated using matlab2tikz providing every tikz picture as a ...
1
vote
0answers
35 views

Grouping data with pgfplots

Right now I have some data year,0-19 years,20-39 years,40-59 years,60-79 years,80-99 years,100 years+ 2015,100,100,100,100,100,100 2016,99.13845985,100.6510799,100.3768131,101.6514052,102.1909752,103....
11
votes
1answer
245 views

foreach with colors leads to “undefined control sequence”

The following MWE works nicely when I remove the optional argument [\forcol] from the \addplotcommand or when I change it to red, for example. Though I would like the curves to have different colors ...
2
votes
1answer
72 views

Plotting data series with pgfplots [duplicate]

I have a csv file index.dat with data Year,0-19 years,20-39 years,40-59 years,60-79 years,80-99 years,100 years+ 2000,100,100,100,100,100,100 2001,101,102,101,102,101,102 ... I am trying to plot ...
3
votes
1answer
42 views

Box on pgfplot with X-axis at origin?

I am doing a plot where I want the X-axis positioned at the origin, which is accomplished with the code below: \documentclass{article} \usepackage{pgfplots} \tikzset{>=latex} \usetikzlibrary{...
2
votes
1answer
95 views

pgfplots: Scaling legend font size

There are a few posts that ask and answer how to scale the legend font size. For example, pgfplots: alignment and size of math in legend Resize font in legend below \tiny However, these rely upon ...
5
votes
1answer
87 views

mark size dependent on y-value or variable

I want to make a scatter plot and vary the mark size dependent on a variable. Furthermore, I want the mark color to be dependent on the meta value given in a file (which works in the given code). As ...