{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

6
votes
1answer
211 views

Not all tick labels are shown when using xtick=data

I'm trying to draw the following plot: \documentclass{standalone} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \begin{document} ...
4
votes
1answer
182 views

PGFplots: dashed lines

How can I do to draw vertical dashed lines which connect markers of one serie with the respective one of the other serie? X axes for both plot is the same. MWE: \documentclass[]{standalone} ...
4
votes
1answer
137 views

Create macro from fairly complex pgfplots code

I have this pgfplots code that takes data from a file mydata.tsv and creates a bar plot. Now I would like to transform it into a macro in order to use it for several files. \pgfplotstableread[col ...
2
votes
1answer
92 views

Math-type in y-label repeating; ghost line appearing

When I run the below code, my intended graph is created but with two issues: there is an odd grey line at the bottom which I can't track down and delete the math type from the y-label is repeated ...
2
votes
2answers
302 views

Reducing space in pgfplots xtick label number format?

With the following MWE: \documentclass{standalone} \usepackage{pgfplots} \usepackage{tikz} \usetikzlibrary{intersections} %% named intersections \usetikzlibrary{fit} \usetikzlibrary{calc} ...
3
votes
1answer
485 views

Trouble plotting arctan with pgfplots

I'm trying to plot arctan(x) with pgfplots but I don't get a good output. Here is my code: \begin{cfigur}\begin{axis}[ width=160pt,compat=1.5.1,grid style={ultra thin},every axis plot ...
6
votes
1answer
177 views

Random decoration of plot axis messes up direction of axis arrow

I've been experimenting with "xkcdifying" a plot I want to make, based on the information found here and some pasting from other sources (this is my first time using pgfplots). Everything worked fine ...
1
vote
0answers
116 views

Proper referencing to programmatic nodes in pgfplots axis? (no shape is known, ill-formatted floating point number …)

This is going to be a slightly messy/unclear question, but here it goes. Basically, I want to work with a plot in pgfplots, where I want to also generate programmatically some nodes (maybe as result ...
3
votes
1answer
441 views

missing tick labels for symbolic coords in second plot

I am attempting to draw two plots in the same axis environment. Both plots use symbolic X coordinates (and symbolic Y coordinates) but X values that don't appear in the first plot will not make it ...
5
votes
1answer
727 views

How to draw density estimate on histogram by pgfplots?

I know how to draw a density histogram using pgfplots from this answer: Is it possible to "transform" a histogram into a density plot in pgfplots?. But how can I draw an estimate line on ...
3
votes
1answer
89 views

No scientific in ybar of pgfplots

I'm wondering how to disable scietific notation in lables of ybar. here is the tex code: \begin{axis} [width=6cm, height=6cm, yticklabel style={/pgf/number format/fixed}, ybar=5pt, ...
6
votes
0answers
191 views

Move a pgf plot, after its drawn, (on a layer) behind another plot in same axis? [closed]

I have already seen Filling path in pgfplot and pushing into background? - that doesn't help me much because it's simply about axis on top. I've also seen Why does pgfplots package cause tikz layer to ...
0
votes
0answers
18 views

Get (obtain/print/typeout) the width of a (standalone) pgfplot? [duplicate]

I'm using the tikz2pdf script, which I think internally uses the standalone class, to compile my tikz and pgfplots figures. Say, I have this simple example: \begin{tikzpicture} \begin{scope} ...
5
votes
3answers
428 views

Bessel function with pgfplots

I want to plot a vibrating membrane and therefor I need the bessel functions. As I'm using pgfplots, I wondered if there is anything pgf-related that can be used to create a corresponding output. I'm ...
4
votes
1answer
194 views

PGFplot Histogram with Large Amount of Data over a Long Time Span

I'd like to plot data files with multiple values per x-coordinate using pgfplots, ranging over the time span of a month (max. 31 days) per file. The problem is, that if I don't plot these values ...
3
votes
1answer
299 views

Automatically get (ymin,ymax) and (xmin,xmax) in pgfplots

I am plotting some 2D data from a file using pgfplots. Is it possible to automatically get (ymin,ymax) and (xmin,xmax) from the file I am trying to plot? I don't want to keep changing these each time ...
9
votes
2answers
808 views

Tikz: function and node's position

With the following code I am able to create three normal distributions with different means. Although the graph looks good, I have some problems in placing the nodes in the right coordinates. It is ...
4
votes
1answer
100 views

shader=faceted interp does not compile in Xelatex

I am using pgfplots \begin{figure} \centering \begin{tikzpicture} \begin{axis}[width=\linewidth] \addplot3[surf, mesh/cols=41,mesh/ordering=colwise,faceted color=black,shader=faceted ...
3
votes
1answer
75 views

Same ymin in loglogscale

I want to obtain the same y axis for multiple plots. Here is a MWE: \documentclass[preview=true]{standalone} \usepackage{pgfplots} \begin{document} \begin{preview} \begin{tikzpicture} \begin{axis}[ ...
28
votes
4answers
2k views

Draw somewhat random function

I am trying to reconstruct this image here I am not very happy with the code, as it uses hacking and adding white boxes and alike. My problem is now how do I draw the somewhat arbitary function in ...
9
votes
2answers
127 views

Creating a new environment containing a tikz environment

I would like to create a new environment in order to ease the process of making plots. It should be able to something like this: \begin{graph} \addplot [domain=-10:10, samples=1000]{x)}; \end{graph} ...
2
votes
2answers
102 views

y label is stuck on the right side of the graph

I try to get y label on the right side of the figure, but the label is still stuck on the left side. Below is an example borrowed from another user here. It must be something very simple, but just I ...
2
votes
1answer
77 views

Trouble including graphics from csv file into Pgftable, commands are dissapearing (local maybe?)

I've been trying to add eps graphics with the filename in a csv file. Take a look at the CSV to get an idea of what I mean: ...
4
votes
1answer
136 views

Ugly two ordinates plot

For some reason the plot generated from this code looks extremely ugly. The two series look like they were hand-painted. I thought the smooth property would help but still the same ugly plot. ...
5
votes
1answer
612 views

pgfplots import data from table with comma as decimal separator

I am trying to plot data from data files which are using the comma as decimal separator instead of a point (as is normal in SI style (French version): ...
4
votes
1answer
194 views

Trim axis left in style

Whytrim axis left doesn't work in style command ? \documentclass{article} \usepackage{tikz,pgfplots} \pgfplotsset{% compat=newest, axeseul/.style={% tick ...
2
votes
1answer
94 views

Can \draw .. controls .. be found in pgfplots?

I just want to use something like .. controls .. in an addplot command. Unfortunately, the option "smooth" does not produce the image I desire. I haven't found it in the manual so far. The reason I'm ...
6
votes
2answers
316 views

pgfplots: plot line between two coordinates from file

I basically have a tab separate file with about 100 rows. In each row, there are three values: A, B, and C. I want to loop through each row in the data file, and plot a line between the coordinates: ...
5
votes
1answer
395 views

Plotting multivariable functions with dependent variables in domain

Trying to plot a hyperboloid with domain x^2+y^2 <= 50. For now I have set the domain to [-5,5], but this yields ugly plots, see below. Any advice on how to get around this? I tried setting the ...
0
votes
0answers
55 views

Writing pgfplots macros that take coordinates as input

Is it possible to write macros for pgfplots that take coordinates as arguments. I want to use it like that: \begin{axis} \myMacro{(1 2 3)}; \end{axis} The goal is to write a macro that plots a ...
3
votes
0answers
265 views

Generating Gantt Charts for process scheduling

I am trying to create a gantt chart for my thesis on blocking analysis. I know of the pgfgantt package for generating gantt charts. But this package generates charts for normal schedules, what I need ...
3
votes
1answer
379 views

One axis in pgfplots

I try to make one axis exercices for students, thus I try to customize pgflots but I don't understand what append in this examples : \documentclass{article} ...
9
votes
2answers
521 views

Contour plot of arbitrary R^3 function without gnuplot

Is there a way to make pretty contour plots of arbitrary functions in R^3, like the one below for example, without the use of the gnuplot contour-stuff? The reason I'm asking is I prefer a simple ...
5
votes
2answers
249 views

special axis distribution

The bar chart below is what I have at the moment. As you see there is a huge difference between the y-values. I could use a logarithmic x-axis, but this is not readable for non-scientists. I want to ...
7
votes
2answers
612 views

How to draw the unit hyperbola in LaTex?

I want to make a graph of the unit hyperbola, but I'm not sure how to make it appear using pgfplots. Basically, what I'm using is this: \documentclass[12pt]{article} \usepackage{pgfplots} ...
4
votes
2answers
148 views

Custom Spacing on PGF legend

I'm trying to change the spacing of a single legend entry in a PGF bar plot. This is my MWE: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=newest} ...
2
votes
0answers
92 views

Why does LaTeX impose a memory limit of 8,000,000 and can I circumvent it? [duplicate]

A few people have already asked the question of how to increase the maximum memory LaTeX is allowed to use (see here and here) because it is quite common for LaTeX to run out of memory when using, for ...
2
votes
0answers
64 views

Dimension too large with a small set of data

I'm trying to compile a simple tikz plot with floating point numbers, but I'm gettin a Dimension too large error. The tikz file works with a different data set, so I guess the problem has something to ...
5
votes
1answer
245 views

Plot mean of measurements with pgfplots

I have a file of measurements that I am planning to plot with pgfplots. There are multiple measurements for each input: Size Time 100 599.3 100 598.0 100 597.7 ...
9
votes
1answer
240 views

Local colormaps in global coordinate system

I am trying to get a surface graph with two colormaps. Instead of using the full Z range i want to give the first surface its own colormap and the second surface should receive its own colormap too ...
0
votes
0answers
173 views

How can I plot an implicit function in pgfplots without having to use gnuplot?

I have been trying to plot a couple of really simple implicit linear functions using only pgfplots internal facilities. Here is my MWE: \documentclass{article} \usepackage{pgfplots} ...
3
votes
1answer
508 views

Errors when plotting a bar chart

This is my crude attempt to create a graph from copied example. I want to plot the diseases on the Yy axis and QoL scores on x axis. It has resulted in errors. Could anyone be kind enough to point out ...
3
votes
2answers
185 views

Custom axis line location for PGFplots table with tikzpicture

I am trying to change the axis y line location from 0 to 100 from these questions (1, 2). Say that the error bars represent confidence intervals on percentage scale, so 100% is no difference. Here is ...
2
votes
0answers
141 views

pgfplots in beamer class with BaKoMa TeX

I have a problem concerning plotting of functions in beamer class with pgfplots. I use BaKoMa TeX. In the article class, all works fine, but switching to beamer, an error occurs as soon as ...
4
votes
1answer
572 views

2 axes scaling problem

I have two problems : the arrow on x axis. The left y axis does't match all the hight as the right does. I want on the left axe ymin=0 ymax=25 and the ticks lines in front of the tick lines of the ...
2
votes
0answers
114 views

tikz externalize and pgfmath error

Using external and \pgfmathdeclarefunction at the same time results in ! Illegal parameter number in definition of \pgfmathfloat@expression. ! Package PGF Math Error: Could not parse input '' as a ...
4
votes
1answer
280 views

How to keep the same mark colour when using meta data for marker size?

Probably an easy answer to this, but I can't get it to work, and I obviously don't understand the manual or the other answers given to similar questions here on tex.sx (see 1,2, and 3). Basically I ...
3
votes
1answer
124 views

Place several plots on one page

I have 4 plots that should be placed on the same page. Does anyone know how to do it? I need to have a caption/title under each plot (and I cannot place it above the plot as there are numbers), a ...
3
votes
1answer
209 views

\newcommand Tikz argument problem

I have this two commands to read x from y or y from x on a plot. The problem is that the label is 180:#3 with above position instread of #3 east position. The wish (less important) : how to merge ...
2
votes
0answers
112 views

Pgfplots: date range and integers as input data

I have a data table that looks something like: Week,value 2010-01-03 - 2010-01-09,0 2010-01-10 - 2010-01-16,0 2010-01-17 - 2010-01-23,0 2010-01-24 - 2010-01-30,0 2010-01-31 - 2010-02-06,0 2010-02-07 ...