{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

4
votes
1answer
788 views

Multiple plots with error bars

I want to plot two graphs with error bars from an external file. The data file contains the columns x, y1, y1+, y1-, y2, y2+, y2-, where y1+ etc. are the error bars for the corresponding y-values. ...
4
votes
1answer
264 views

How to have different colormaps for different columns in the same Heatmaps table using pgfplots

I want to make a heatmap using different colors for only two columns in a heatmap. I was able to do it using two different pgfplotstables, i.e, two different heatmaps. But, i wan't to know whether i ...
4
votes
1answer
517 views

Metadata for different colours in PGFPlots

I would like to use PGFPlots to create a plot using three sets of metadata. I figure it would be best to have one set represented by the plot mark and the remaining two by the fill and draw colour ...
4
votes
1answer
416 views

pgfplots - divide y-axis in 2 parts

I have a plot, code here. Now the problem I have is that because of the scale of y-axis it looks as if the plots are actually just 3 lines. Now what I want is that the y-axis is sort of splitted. Into ...
4
votes
1answer
369 views

pgfplots: Plot only parts of table and in “random” order

I have been lurking around stackexchange for a long time and so far been able to find solutions for my newbie problems but now I'm really stuck! My problem is probably not that complicated, yet a bit ...
4
votes
1answer
576 views

PGFPLOTS 3d box line for Z axis not being drawn

The vertical 3d box line for Z axis is not being drawn. If I make the grid lines dashed, the line is drawn, but also appears dashed, as the grid lines. To me, it looks that the line is in fact drawn, ...
4
votes
0answers
49 views

Dimension too large Error in bar drawing

Here is my code. The following code returned ‘Dimension too large’ error. This error has different reasons since I cannot fix it after I surfed on the internet. The code would be work if I ‘change ...
4
votes
0answers
40 views

pgfplots: Plotting one subfigure per country, from datafile

I have data in csv format at the country-year level, and using pgfplots I would like to plot a given variable over time, with one subfigure per country. My idea was to use a groupplot environment: and ...
4
votes
0answers
111 views

pgfplots quiver arrowhead size

I am making a quiver plot using pgfplot and I want the arrow head size to be scaled "nicely" with the length of the vector (e.g., the way Matlab quiver plot does). I've come across several solutions ...
4
votes
0answers
52 views

Tikz/pgfplot: draw option to plot a plot file at given position

I would like to use the draw function of the tikz package to plot a 2D experimental data at a given z altitude. Since I am using some kind of projection view, I would like to fix the z position of ...
4
votes
0answers
54 views

pgfplots: math expressions of variables in axis style

I would like to use a calculated value of pgf variable exp(\pgfplots@data@xmin) This is a concrete example what I need \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \...
4
votes
0answers
99 views

Normalized histogram (density) in pgfplots

I have a data file containing 100 256 values ranging from 0.01 to 3, approximately. I would like to plot the density of this data set. I have the theoretical (asyptotic distribution) drawn for ...
4
votes
0answers
73 views

Pgfplots Tick Position [duplicate]

Similar to this question, I want to hide some ticks in a pgfplots axis. However, I'm trying to manipulate a 3D plot. I used the proposed answer and reread the documentation at: "4.15.2 Tick Alignment:...
4
votes
0answers
133 views

Calculate x-coordinate for given y-value by interpolating data from pgfplotstable

I have a text file data.txt with the following content: -2 -2 +1 +0 +1 +3 +2 +4 +2 I read it with \pgfplotstableread{data.txt}\data and then plot the second column by the first column with \...
4
votes
1answer
76 views

pgfplots wrongly calculate \pgfplots@data@xmin in the case of mixed plots (with and without error bar)

In this TUGBoat article the author show how to implement tufte style plots with pgfplots. Currently I am working with Lualatex,texlive 2015. In the following MWE I implemented the idea from the ...
4
votes
0answers
199 views

Drawing Cross Sections of (Contours over) Torus

I have this simple torus \begin{figure} \begin{center} \begin{pspicture}(-6,-4)(6,4) \psset{viewpoint=30 10 25 rtp2xyz,Decran=30,lightsrc=viewpoint} \psSolid[object=tore,r1=2.5,r0=1.0,ngrid=36 72,...
4
votes
0answers
135 views

Setting Folder for Data pgfplots in LyX

I'm trying to get a figure in my LaTeX document, but I struggle to set the search-path I use \addplot[blue] table {invcum.dat}; from the example, however it keeps saying ! Package pgfplots Error: ...
4
votes
0answers
174 views

Conflict tikzscale and matrix group plot

I want two axis environments next to each other in one figure environment. I want them to be vertically aligned and scaled to the width of the text. I am trying to achieve this by means of the ...
4
votes
0answers
334 views

Automatically positioning a legend relative to multiple plots in groupplots

This question deals with centered legend placement in a set of plots aligned with groupplots. However, as the OP stated in a comment, the (accepted) solution requires some hand tweaking. I suspect ...
4
votes
0answers
140 views

PGFplots 3D: Axis labels are placed “in the middle” of axis instead at the tip

I would like to use the "center"-style for axis and place the label of the axis near the arrow tip. It works in 2D but in 3D the labels for the x and y axis are placed at very weird places. See the ...
4
votes
0answers
224 views

How to draw the vectors from point to point

I have the file "gradmethod.dat" that contains the values ​​of the 3D coordinates: "gradmethod.dat" is 0.4166337995 -0.0003214561 0.1735863062 0.0036860331 0.0076438475 0.0014742969 0....
4
votes
0answers
310 views

normalizing graphs in pgfplots

Suppose you have multiple graphs in a pgfplot whose y ranges are [0 y1] [0 y2] etc, y1 < y2 < .... I want to divide all graphs by max(yi), so that the plot would be in the y range [0 1] (but ...
4
votes
0answers
417 views

pgfplots error using matlab2tikz [closed]

I am trying to plot a matlab figure in latex file. so i use this matlab2tikz function. It works really well, until I try to add some customised text on the figure before converting it to tikz file, ...
4
votes
0answers
485 views

Flip x and y axis of ternary graph

I am trying to reproduce the USDA Soil Triangle. To do so, I would need to flip the x and y axis of the default pgfplots-ternary. I understand, that I could switch my inputs (don't really want to do ...
4
votes
0answers
55 views

Display shifts in curve and slope with Pgfplots [duplicate]

I have the following MWE and would like to plot three lines on it, displaying the shift in height (and maybe the change in slope) between the second and third lines. \documentclass{article} \...
4
votes
0answers
754 views

pgfplots: howto read touchstone files (s1p, s2p, s3p,…)

With pgfplots you can simply create nice plots that seamlessly integrate into your TikZ figure. As a high frequency engineer you will inevitably use a network analyzer to measure S-parameters. The de ...
4
votes
0answers
450 views

Pgfplots histogram with density less than one

I want to plot two histograms over each other in order to compare densities of two different datasets. The problem is that the second dataset has less observations than the first one, and I want its ...
4
votes
0answers
109 views

Add fitting line to histogram plot created by pgfplots [duplicate]

I have created a histogram plot with pgfplots as following \begin{tikzpicture} \begin{axis}[small,ymin=0,title=\texttt{hist}] \addplot [ hist, fill=orange!75, draw=orange!50!black] table [y index=...
4
votes
0answers
70 views

Grouped overlay bar chart in LaTeX? [duplicate]

I have been trying to create a grouped overlay bar chart in latex using pgfplots, much like this one (not actually mine, found randomly on Google): What I'm trying to achieve is not a stacked bar ...
4
votes
0answers
704 views

using gnuplot to plot data from a file

I am trying to plot some data using pgfplots, but the data are so extensive that the maximum capacity is reached. I get the error: TeX capacity exceeded, sorry [main memory size=3000000]. What can I ...
4
votes
0answers
56 views

Using PGFPlots to plot macro result [duplicate]

I've got a few macros that perform floating point lookups and calculations for me and I'm interesting in plotting their results. They're the kind of calculation which requires if/else, so they can't ...
4
votes
0answers
385 views

How to automatically optimize the PDF output of TiKZ externalize?

I use pgfplots with externalization for generating plots in my document. For heavy plots the output PDF for a figure can grow to few hundred KB. I used Adobe Acrobat to optimize the PDFs which ...
4
votes
0answers
617 views

Decorating a PGFPlots bar graph with Tikz decorations

Update :- This appears to be a problem in which nodes near coords are handled by PGFPlots and incompatibility with Tikz decorations and fading library. I simply commented the nodes near coords line ...
4
votes
0answers
531 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 ...
4
votes
0answers
577 views

Multiple ternary plots and pie charts in pgfplots

I'm trying to plot lots of ternary plots and pie charts. Ideally it should look smth like this: The pie-chart (ternary plot) on the left-hand side serves as an explanation of what is happening, ...
4
votes
0answers
441 views

Normal probability plot with percentile grid and axis [closed]

How can I make a normal probability plot with a percentile grid and y-axis as shown in figure? I've read the pgfplots documentation but i can't find anything useful.
4
votes
0answers
137 views

Pgfplots fails to generate boxplots for some data set [closed]

I use pgfplots to generate boxplots, however with some small data sets as the following, I get an error message. speed 2 3 1 2 2 11 Here is the error message : Sorry, an ...
4
votes
0answers
329 views

Problems with pgfplots, loops inside tikzpicture and reading from files

I was trying to implement this method (How to import ASCII coordinates to TikZ) to import coordinates and draw them, but I am having this problem Undefined control sequence \end{tikzpicture} Extra }, ...
4
votes
0answers
298 views

How to draw this 3D H-layout recursive tree with Tikz? [closed]

Background: This is an extension problem from my last post How to draw the recursive H-Layout tree using Tikz?. The (2D) H-layout tree is actually from the VLSI layout problem in computer science. I ...
4
votes
0answers
148 views

Nested symbolic x coords in bar chart [closed]

any ideas on how to create something like this in latex? the image is of a basic grouped plot (using pgfplots) but with a nested x axis group (the numbers in red) that I've added using an image ...
4
votes
0answers
341 views

Convolve two 2D Gaussians using tikzfading - intensity issues

I would like to visualize the convolution of two 2D Gaussians (or something looking similar). To do this, I declare them in a tikzfadingfrompicture environment. However, to get the desired result and ...
4
votes
0answers
78 views

question on pgfplots and pos= [duplicate]

In pgfplots, pos=a , with a between 0 and 1, refers to the relative x coordinate on a plot. I was wondering if there is an equivalent construct that accept the absolute x coordinate rather than the ...
4
votes
0answers
124 views

Axis labels according to DIN461 [closed]

DIN461 requires to put the unit of the axis between the last two ticks of an axis, see http://de.wikipedia.org/wiki/DIN_461 (sorry only in german, but the lower two images make it clear, I think) Is ...
4
votes
0answers
429 views

Creating plots in Latex - easy to learn? [closed]

I am currently working on my summer project for which I created the following plot with Mathematica: Now I am not 100% satisfied with the results and one of my professors recommended PGF and TikZ. ...
4
votes
0answers
309 views

pgfplots: percentages and endvalues in stacked ybar

I have two questions regarding the pgfplots package. I have attached the source code I worked on. There are two features I am not able to realize: I would like to put the total value (sum of the ...
4
votes
0answers
476 views

Using `external` selective for TikZ-pictures [closed]

For the following example: \documentclass{beamer} \usepackage[utf8]{inputenc} \usepackage{tikz} \usetikzlibrary{calc,external} \usepackage{pgfplots} \tikzexternalize \begin{document} \tikzstyle{...
4
votes
0answers
52 views

pgfplots: How to move bar labels [duplicate]

2 questions: 1) How do I move my data labels to the center of my bars? 2) How do I make the labels be purely data labels, and not cumulative values? eg I want the red bar labels to be the value of ...
4
votes
0answers
62 views

Decimal number in axis tick using: “x tick=data” [duplicate]

I have found the following problem during the building of an histogram: \documentclass[a4paper,11pt]{article} \usepackage{pgfplots} \pgfplotsset{/pgf/number format/use comma,compat=newest} \begin{...
4
votes
1answer
680 views

Grid lines in top-view surface plot

I'm almost satisfied with my graphs, only grid lines are missing. What I'm basically doing is a sort of density plot / color plot by letting pgfplots generate a surface and viewing it from the top: \...
4
votes
0answers
893 views

How to correctly set a colorbar for an external graphic? [closed]

I created a pdf file from a Matlab imagesc plot. I have remove the colorbar and axis and now I want to have this image in my tex document. I manged to get the axes almost as I want them, but the ...