{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

5
votes
1answer
765 views

Pie chart slice with pattern background

I was able to create a pie chart based on the answer in How to draw Bar & Pie Chart. I realized my document is printed in grayscale and learned about patterns (Where is the pattern list gallery ...
13
votes
1answer
745 views

Polar Plots - layout and extraction of crucial parameters

Let S be some sort of function, depending on direction and frequency, for example: envir. background noise. I have S defined on a rectangular grid and I wanted it plotted on a polar grid. So far I ...
2
votes
0answers
56 views

How to get rid of base 10 multiplier in pgfplots axis [duplicate]

I'm making a graph in tikzpicture using the code below. \documentclass[11pt]{article} \usepackage[usenames,dvipsnames]{xcolor} %must come before tikz \usepackage{tikz} \usetikzlibrary{arrows} ...
2
votes
0answers
339 views

pgfplots: problem with stacked histograms

I want to plot data for a node that has several inflows and one outflow, using stacked histograms. I want the plot to look like this: First, I have tried stacked histograms (ybar stacked, see the ...
1
vote
1answer
524 views

Grouped Bar-Chart, all four in a panel

I am tryin to show all four graphs in a single panel page. Also, I want to see my graphs being very professional for beamer presentation in a single frame. Thanks. \documentclass{article} ...
4
votes
1answer
213 views

read table from file , each row different number of columns

I have a data file where each row has a different number of columns, like this: x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ...
3
votes
1answer
291 views

pgfplots change fontsize to 1pt nodes near coords

i want to change the fontsize of the "nodes near coord" and also the y tick labels in a pgfplot to 1pt (no worries, that's just of theoretical interest). I found that ...
15
votes
4answers
860 views

How can I hatch the areas delimited by two intersecting Gaussian distribution curves?

This is a follow-up to one of my earlier questions: Fill area between curves. I want to color three regions delimited by two curves and a vertical line. Each should have its own shading and color. ...
4
votes
2answers
479 views

pgfplots ybar issue

I'm having trouble with pgfplots using ybar. When I try: \begin{tikzpicture} \begin{axis}[height=4.5cm, width=8cm, ybar, axis x line=bottom, axis y line=left, grid=none, ytick={0,10,20}, xmin=0, ...
5
votes
2answers
752 views

HSV shading of cone in pgfplots

How can I shade the surface of a cone according to the HSV color space? I'd like to create a drawing similar to this from Wikipedia: So far, I have this code: \documentclass{standalone} ...
1
vote
1answer
197 views

Axes for bivariate normal distribution with tikz

I got the following figure: with this code: \documentclass{standalone} \usepackage{pgfplots} \begin{document} \def\centerx{2} \def\centery{-1} \begin{tikzpicture} \begin{axis} ...
5
votes
1answer
283 views

How do I get a pfgplot figure to take up the whole page?

So, I'm making figures using pgfplots and I have a problem: They don't centre on the page well. I'd rather stick to article for ease of printing and so I can have multiple figure in the same document ...
2
votes
1answer
342 views

pgfplots addplot 'domain' option overwrites/collides with axis 'domain' option

I have a problem with domain specification in addplot which collides with domain specification in axis. The code below plots the x axis as well as the function (expo) from 0.1 to 2. My desired ...
0
votes
1answer
969 views

Trouble with pgfplots and ubuntu [duplicate]

Using writelatex (because I was at work where I had to use a windows machine which did not have a working Latex setup) I was able to produce some relatively nice-looking graphics using pgfplots. My ...
6
votes
1answer
345 views

How to glue these cubes together to form one big cube?

\documentclass[tikz]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{axis}[ view={110}{45}, hide x axis, hide z axis, hide ...
7
votes
0answers
200 views

Automatically add discontinuities in some plots [duplicate]

I have multiple plots (about 15 different figures) that have the same axes (i.e., same ymin and ymax values and same xticks). One of the plots has very large values. I don't want to either increase ...
8
votes
1answer
529 views

How to orientate a pgfplot 3D plot

I am trying to plot a spiral such that it is orientated as shown in the rough sketch. The spiral is coming out of the screen. The script below yields the diagram shown at the end, but whatever I ...
17
votes
3answers
4k views

Fill area between curves

I need to reproduce the following plot: I tried the following code using pgfplots: \documentclass[8pt]{beamer} \usepackage{tikz} \usetikzlibrary{patterns} \usepackage{pgfplots} \begin{document} ...
13
votes
1answer
1k views

PGFPLOTS: Show x labels for every second tick

How can I show xaxis labels for every second data in this dataset. I want a bar for each tick, but not a label. \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} ...
2
votes
1answer
177 views

Loop in pgfplots doesn't work

I'm trying to do a loop in pgfplots to draw a bunch of rectangles under a curve, but it doesn't work. This is my code \begin{tikzpicture}\begin{axis}[ width=160pt,compat=1.5.1,grid ...
4
votes
1answer
4k views

Create PGFPlots Histogram from file

How can I create a histogram from a file as follows. I can't seem to pick up the variable names from the file even. \documentclass[tikz,border=12pt]{standalone} \usepackage{filecontents} ...
9
votes
1answer
404 views

groupplot pie charts

Is there a way to group pie charts using groupplots? I want to have something similar to this: Here is the MWE: \documentclass[times]{article} \usepackage{pgfplots, pgfplotstable} ...
4
votes
3answers
582 views

I want to plot the integral of sin(x^2) in pgfplots [duplicate]

i want to plot the integral of y=sin(x^2) in pgfplots but dont know what to put inside the ''{ }''. This is because its a prety hard function to integrate. Can someone help me!
2
votes
1answer
359 views

Number of rows in loaded table

Is it possible to determine the number of rows in a table read by pgfplotstableread{values.dat}\val ? My setup is the following. I make experiments to see how a parameter affects a convergence ...
12
votes
1answer
360 views

Solid sphere with a cylindrical hole through center (bead shaped solid)

I am trying to draw a solid sphere with a cylindrical drilled through its center. The best I have been able to do is: which does not show it is solid. How do I make it more solid in appearance? ...
1
vote
1answer
581 views

pgfplots: xticklabels and yticklabels in fractions

How to properly put xticklabels and yticklabels in fractions? \documentclass{article} \usepackage{pgfplots} \let\ds\displaystyle \begin{document} \begin{tikzpicture} \begin{axis}[ scale only ...
3
votes
1answer
279 views

Axis Multiplier near middle-axis

In PGFPlots I would like to have the multiplier for the specific axis near this axis when the axis is in the middle. The option xlabel near ticks does that, but moves the axis-label to the center of ...
4
votes
1answer
931 views

Change boxplot style

I'm following this PGFPLOTS manual. At first I was enthusiastic with it. However I'm finding some difficulties on doing even basic things. Now I'm trying to change boxplot style. Up to now I wrote ...
2
votes
2answers
984 views

How to change the x axis position pgfplots

I have trouble to shift the y axis. Is there any command to shift the y axis in the right direction (the first point where graph started) and start the graph exactly from the first point. Thanks.
0
votes
1answer
163 views

Scatterplot add a x line top of the line using Pgfplots

I want to draw a x line on the Picture-1 exactly like picture-2. I also want to remove the arrow as marked with circle. Any suggestion or complete code will be greatly appreciate. Picture-1 Code ...
8
votes
1answer
172 views

Help with a simple bar plot

I have some data in a table; the first column has some names; the second column associates a "category" to each name, and the third column associates a "section" to each name. All entries are ...
2
votes
0answers
22 views

Legend symbol not being displayed correctly in pgfplots [duplicate]

I'm trying to create a horizontal bar plot with log axis. Adapting several examples I could get what I needed. However, the legend symbols are not being displayed the way I want. Here's what I got so ...
6
votes
1answer
769 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
527 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
247 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
116 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
493 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
1k 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
259 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
192 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 ...
5
votes
1answer
979 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 ...
6
votes
1answer
2k 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
140 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, ...
7
votes
0answers
393 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 ...
1
vote
0answers
20 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
874 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
399 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
592 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
3k 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
198 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 ...