{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

3
votes
1answer
26 views

pgfplot: centering the axis above the caption without trimming axes

is there a stable way to center the axis (without the axis label) above a figure caption without trimming the axis with \begin{tikzpicture}[trim axis left, trim axis right] ? Trimming the axis ...
7
votes
1answer
57 views

PDF for the hypergeometric distribution

I wish to plot the p.d.f. for the hypergeometric distribution, and I have been using lua combined with pgfplots. However I get an error when I use the density function with the formula for the ...
2
votes
1answer
24 views

Fix group bar chart spacing

Consider the following MWE \documentclass[tikz]{standalone} \usepackage{lmodern} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepackage{pgfplotstable} \begin{document} ...
2
votes
1answer
35 views

Create a new pgfplotstable that is a subset of another pgfplotstable

I'm using pgfplots to plot a data set, and I want to add a local regression line for a subset of the data. I'm able to calculate the regression line and plot if for the subset, but pgfplots is still ...
2
votes
0answers
40 views

Creating Tikz Legends in the Caption

i'm having a few issues with creating a legend in the caption of an image. I've made a lot of graphs using matlab2tikz and i've externalised them to reduce my compiling time and memory usage. ...
3
votes
1answer
99 views

Plotting an atan function in TikZ

I have to plot the function f(x) = atan(x)-x/(1+x^2), but it won't come out right. By looking at previous questions, I have the code: \documentclass[a4paper, norsk, 11pt]{article} ...
2
votes
2answers
55 views

How can I produce a colour bar with pgfplots?

I want to produce a horizontal colour bar with colours varying from black and grey to white. I searched the net for a small code but I couldn't find any. Could you please help produce something like ...
2
votes
1answer
35 views

Is it possible to plot non-numerical data alongside normal data in a normal plot?

I'd like to try and plot non-numerical data to indicate some information for the usual numerical data. The former would then help understand the latter. So in the MWE, it is only one column of extra ...
3
votes
2answers
47 views

How to enable minor y ticks for a logarithmic axis

I am using pgfplots to create some plot with logarithmic axis. But Latex automatically shows minor y ticks for some of them and doesn't show them for the others. Here is an example (when I increase ...
4
votes
1answer
30 views

pgfplots ybar intervals on the left instead of on the right

I would like to make a pgfplots ybar interval plot with the interval extending to the left of the marked point. Here is a minimal non-working example: \documentclass{standalone} ...
3
votes
1answer
506 views

get max/min value in a table column with pgfplot

I'd like to get the max/min value from a specific column table via function \findmax and \findmin in order to use it in ymin and ymax. I really dont get how \pgfplotstablesort function works. What ...
3
votes
1answer
151 views

PGF stacked bar graph not drawn correctly

I am having problem with the following code which is supposed to produce a simple stacked graph. \documentclass[tikz,border=2pt]{standalone} \usepackage{pgfplots} \usepackage{tikz} \begin{document} ...
3
votes
0answers
33 views

\addplot table with input filename relative

I include plots using matlab2tikz to generate tikz-files. There was a nice feature added which enables external datasets. A file plot.tikz is generated with the following code (unnecessary code is ...
3
votes
1answer
27 views

How to stop pgfplots scatter to sort the data table?

I want to draw a scatter plot, using pgfplots and I want the data to appear in the plot area the same as it is listed in the table. I don't want the data to be sorted and then be plotted. As it is ...
3
votes
1answer
43 views

Setting zmin/zmax in groupplot confuses colorbar creation (colorbar is 3d)

When using groupplots and setting zmin and/or zmax in the groupplot environment manually, pgfplots generates a (broken) 3d legend: I assume the issue is that groupplot passes the zmin/zmax settings ...
2
votes
0answers
23 views

fillbetween from pgfplots does not work inside groupplots

MWE: \documentclass{article} \usepackage{pgfplots} \usepackage{pgfplotstable} \pgfplotsset{compat=newest} \usepgfplotslibrary{groupplots} \usepgfplotslibrary{fillbetween} \usepackage{filecontents} ...
2
votes
3answers
80 views

Aligning subfigures in a 2x3 grid with tikz

I have a number of plots obtained with matlab2tikz. Now I want to align these plot in a neat way. I used the subfigure package, but the result is not aligned very nice, see My latex code is: ...
1
vote
0answers
45 views

Formatting pgfplots bar graph with tabular* legend

When I attempt to change the size of my bar chart so that it sits centered above my legend, I can't get the height and width to simultaneously fit my specifications. One dimension is always too small. ...
3
votes
1answer
106 views

How to draw some lines between figures in LaTex

I want to draw the following figure. How do I do this? Some lines between figures, and Can you give me this lines some color? Some color lines in figure, as following:
4
votes
1answer
43 views

reduce the number xlabels in a plot

I have a huge dataset which I'm processing using lualatex. (Normal compilation runs out of memory). The data cannot be sampled as it has some spikes (see figure). So I use the whole dataset. For the ...
3
votes
1answer
61 views

pgfplots - How can I set all the default line widths / thickness values to a certain value?

Upon discussion and examining a few printouts (by my own printer) of some pages of a document, I decided to try and change the line widths to another default value, e.g. semithick (a little increase ...
3
votes
2answers
42 views

How do I change the font size of the labels along the axes in pgfplots?

Surely this question must have been asked before, but I cannot find it and my searches through the user's guide are proving fruitless. I have the following graph: % arara: pdflatex % arara: pdflatex ...
3
votes
1answer
65 views

Custom labels for ybar plot?

I'd like to make a plot where data is arranged in bars, but each bar has a custom label if it is greater than a thousand. For instance, instead of 18,000 the label would read "18k" and for 50 million ...
4
votes
1answer
53 views

pgfplots One node or pin to multiple points

This has been driving me insane, I've searched and checked the pgfplots manual but can't find the relevant section: consider the snippet: \documentclass{article} \usepackage{tikz, pgfplots} ...
4
votes
1answer
66 views

Pgfplots: Addplot color depending on sign

I want to create a plot where positive and negative values have a different color. MWE: \documentclass[tikz]{standalone} \usepackage{filecontents} \usepackage{xstring} \begin{filecontents}{data.txt} ...
4
votes
1answer
82 views

Indicating the differential on a graph

i would like to indicate on a graph the error in estimating f(x) using a linearization to the graph of f. To indicate the distance between points A and B, I would like a thin vertical line, with ...
2
votes
1answer
43 views

“Dimension too large” while working with serial date numbers

I export plots using matlab2tikz and pgfplots from MATLAB to TeX. Most of my plots contain "serial date numbers", which are the days since January 0, 0000. As you can guess, the numbers get quite ...
2
votes
0answers
23 views

X label in multiple bars and problem in bars

Can someone help me in this problem? I am trying to draw an histogram, but I am having some problems. This is the histogram I have made so far: \begin{center} \pgfplotstableread{ 1 800 900 ...
1
vote
0answers
78 views

PGFplots (windows and linux) compile problem

So I am writing a report with a group where I am using Debian with texlive and my groupmates are on both Win 7 and Win 8 with miktex. I have made some plots using PGFplot on my machine, looks like ...
2
votes
0answers
23 views

Removing commas in x-axis values for pgfplots graph [duplicate]

I want to remove the commas in the x-axis values for a pgfplots graph. Here is an example with commas: Is there a way of removing these commas only in the x-values (not in the y-values)?
3
votes
1answer
49 views

Combining surface plot, explicit colour and legends in pgfplots

This question is a result of this one. I would like to make a surface plot using tikz/pgfplots using explicit colour and including legends. Is this possible? I have gone through the entire manual for ...
1
vote
0answers
36 views

matlab2tikz/pgfplots: Tick-labels in axis cannot be overwritten [duplicate]

I want to export plots from MATLAB to tikz and use matlab2tikz to do so. Most of the data I have has dates on its x-axis. In MATLAB I use serial date numbers to store the time. I override the ...
2
votes
1answer
40 views

How to change the color of extra grid lines according to the extra tick color

My problem is similar to the one described in Is it possible to assign to two extra x-tick labels different colors?, so I just took the code from there. Additionaly to the different colors of the ...
4
votes
1answer
55 views

pgfplots: extending a regression line beyond the tables points

How can I extend a regression line made in pgfplots? I would like to extend the line to just shy of the top of plot boundary and just above the bottom of the plot boundary. ...
4
votes
2answers
146 views

Drawing a Cube with Tikz/PgfPlots Looks Stretched along X-Axis

I'm trying to draw a cubic structure (fcc crystal structure) with Tikz. I'm using pgfplots' axis cs function for the 3D projection. But the result looks like a rectangle stretched along the x axis. ...
1
vote
0answers
45 views

Mosaic/Marimekko charts; does this answer still work?

I found this answer How can I produce a mosaic chart / Marimekko chart? and have used it before to create beautiful charts. Under Texlive-2014, with pgfplots version 1.10, I receive a lot of white ...
7
votes
1answer
62 views

Pgfplots: styling the grid properly

I have to draw a grid with coordinates and lines. I was going to do this manually with TikZ, but it seems like pgfplots might be the cleaner way to go. Right now this is what I have with pure TikZ ...
3
votes
1answer
37 views

pgfplots: bar plots and xticklabels display

I have a bar plot and I would like to set x labels but when I do so, the x-axis is not appropriate: \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
6
votes
2answers
190 views

Plotting a distribution with tikz package

I'm trying to generate a plot of a censored Gamma distribution. I've managed to make the plot of the Gamma-pdf and reference the censoring point, but I'm failing to suppress anything beyond it. In ...
3
votes
0answers
69 views

Pgfplots: How do I make a style with consistent width while using `axis equal image=true`?

Workaround: If I set height very large, the width of the resulting plot is what I want and the resulting height is no more than it needs to be. In my case, I can set height=11in, which is the height ...
8
votes
1answer
523 views

Plot the probability density function of the gamma distribution

I want to draw gamma distribution with different shape and scale parameters. The following MWE displayed error. The error information is : Here is MWE: \documentclass[border=5mm]{standalone} ...
6
votes
1answer
95 views

How to recreate this graph?

I'm quite new to drawing graphs. I have the following table: \begin{tabular}{rrrr} \firstrow Frequency/[Hz] & $V_{pp}$/[V] & $V_{rms}$ DMM/[V] & $V_{rms}$ scope/[V] \\ 50 & ...
5
votes
1answer
76 views

Unintended line thickness variation with pgfplots

I admit that I may be abusing pgfplots somewhat, but I want to add a plot of a function into a tikz-picture in a certain way. I have now managed to get this to run, I'm just wondering why the line ...
2
votes
1answer
34 views

Choosing the bar size with symbolic x coords option

When I use both "bar width" and "symbolic x", pdflatex gives me the following error message: ! Package pgfkeys Error: I do not know the key '/pgfplots/bar width' and I am going to ignore it. ...
7
votes
1answer
155 views

TikZ/PGF 3.0 datavisualization vs pgfplots

To follow-up on a previous question TikZ datavisualization or pgfplots?, the current release of TikZ 3.0 has a flexible datavisualization engine that creates the same kind of plots as the more mature ...
4
votes
1answer
156 views

Glitch in 3D surface plot using pgfplots

I want to plot a surface plot in two parameters with pgfplots. A part of the surface which should appear behind the main surface as above it, which looks like a glitch. If I reverse the y axis, ...
0
votes
1answer
85 views

Matlab2tikz, alignment of subplot ylabel (large distance from plot)

Matlab2tikz came to my attention in the past month and have been using the simple tutorial from HowToTeX. It has worked great so far only one issue remains, I am unable to anchor the ylabel to the ...
9
votes
1answer
5k views

How to show the “data-does-not-start-at-zero” symbol on a pgfplot graph?

I have a graph and it doesn't start at zero. How do I add the symbol (my vague description is mentioned in the title) to the y axis of the graph? If it helps, my graph is a scatterplot.
3
votes
1answer
61 views

Tikz: Position dodge on the x axis?

For my 2x2 factorial data, I want to create a line plot with confidence intervals in Tikz. The x-axis ticks are supposed to have a small offset so that the confidence intervals of the two plots do not ...
0
votes
1answer
78 views

Mapped grid color for pgfplots colorbar

I am trying to use a variation of the mapped color for a prepared contour plot. The line color is correctly adjusted using draw color=mapped color!50!black, but I am unable to use the mapped color ...