{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

13
votes
0answers
160 views

Put Gnuplot mutiple surfaces plot in PGFplots axis environment to overcome z-buffer problem

Although PGFplots is the perfect tool for many depictions, it unfortunately does not have a properly working z buffer for intersecting surfaces (at this time, 10-09-2015). I'm trying to overcome this ...
10
votes
0answers
78 views

Is there a general rule when to write pgfplots keywords together?

When using tikz especially pgfplots I find it often difficult to remember if a keyword is written together or separaded. Examples for keywords written together are: xticklabels enlargelimits ...
7
votes
0answers
273 views

Special effects in TikZ leads to unprintable PDF

So I recently made a picture of the Mexican Hat Potential (related to the Brout-Englert-Higgs Mechanism of particle physics). I am more than satisfied with the graph and everything, but I noticed ...
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 ...
6
votes
0answers
134 views

A problem with pgfplots and coordinates

I'm using Jake's code in his answer to How can I automatically mark local extrema with pgfplots and scatter?. Using the mark max style I can retrieve the value for the y-coordinate of the maximum for ...
6
votes
0answers
116 views

Group style key does not work in pgfplotsset

When I want to set a style using groupplot, I will do something like this: \begin{groupplot}[ group style={ group size=1 by 2, vertical sep=1cm, }, ] However, I've found that if I try ...
6
votes
0answers
627 views

How to add marks to all graphs at certain y level

I'd like to add markers to my plots only at certain y levels. How to do this for certain x levels is obvious, I didn't manage to do it inversley though. What I have (equi-x): What I want is ...
6
votes
0answers
2k views

Tikzscale, trim axis left/right, and externalizing

tikzscale and trim axis do not play well together, with the produced figure being larger than requested because it ignores the size of the labels. I was wondering whether it is possible to use both ...
6
votes
0answers
407 views

Using pgfplots and gnuplot and compiling with output-directory

I would like to use the pgfplots package along with gnuplot. However, I cannot get this to work if I compile using the -output-directory option. For example, if I have the following MWE: \...
5
votes
0answers
27 views

Skip some x tick labels when using `xtick=data`

I am plotting some csv data with \documentclass[border=10pt]{standalone} \usepackage{tikz} \usepackage{pgfplotstable} \usepackage{pgfplots} \pgfplotsset{compat=1.13} \begin{document} \begin{...
5
votes
0answers
44 views

Use of smooth in combination with text decoration in pgfplots gives error “Dimension too large”

The use of the option smooth in combination with the text decoration option gives the error "Dimension too large" Is this bug already known? What can I do? Short example code is given below. \...
5
votes
0answers
837 views

Error using tikz externalize: can't write md5 file

I tried to use the externalize library. It worked fine when all my files where located in the same folder. Usually I am using a subfolder as build folder, where all generated files should be stored. ...
5
votes
0answers
531 views

using bar chart to compare two groups of data, how to draw one node (showing the ratio) per two bars?

I have two groups of data, you can think of them as one control group and one treatment group, and each data point shows the system's performance under certain parameter x. Now for each value of ...
5
votes
0answers
822 views

How can I display negative error bars in a logarithmic plot using pgfplots?

I have error bars representing 95% confidence intervals in a logarithmic plot. Some of the error bars extend to negative numbers for which the logarithm is undefined, so pgfplots simply drops the bar ...
5
votes
0answers
597 views

Decorate pgfplots mesh

In my quest to solve this question I'm trying to see if I can decorate a mesh-plot by drawing many circles or maybe rectangles with a radius determined by \pgfplotspointmetatransformed. But I can't ...
4
votes
0answers
38 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
51 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
52 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
90 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
126 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
0answers
191 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
131 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
170 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
319 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
133 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
219 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
301 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
441 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
731 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
423 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
688 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
373 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
611 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
526 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
566 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
323 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
336 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
307 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 ...
3
votes
0answers
46 views

Dimensions too large on plot

I'm trying to plot a Gauss function/normal distribution, based on the answer to this question, however my domain is 0:10000 and the sample size is 95. This is resulting on the following error: ...
3
votes
0answers
47 views

Fill pgfplot bars with colorbrewer

I want to use colorbrewer in my project since it provides color cycle lists but I struggle to use them in the right way I think. Please have a look at my MWE: \documentclass{article} \usepackage{...
3
votes
0answers
183 views

Coordinate Transformation for labeling with PGF-Plot

Difficulty with drawing the right coordinates I use pgfplots to draw a set of data points, fit them with gnuplot and then find the intersection points between the linear fits and a vertical bar. Now ...
3
votes
0answers
45 views

Rotating polar pgfplot

I rotated my polar plot by 90 degree. To make sure, the y-Line stays at the 90 degree position I used xmin=90, xmax=450, but now I need my xtick labels back from 0 to 330. \documentclass[a4paper, ...
3
votes
0answers
89 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 ...
3
votes
0answers
43 views

Tikz image with remember picture combined with custom page numbering

I have a problem combining TIKZ-pictures when using custom pagenumbers. I modify my page numbers as shown in the upmost answer here. When drawing a simple TIKZ-image, I recieve the error ! Illegal ...
3
votes
0answers
42 views

pgfplots - fill between changes with plot width

I'm plotting some distribution functions for my students, and I am shading regions of the plots. If I reduce the plot width to 0.35\textwidth or less, the shading disappears. How do I ensure that it ...
3
votes
0answers
80 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
0answers
52 views

Remove the first and last values of xtick and ytick

I use the following code to create a tufte-like range plot as suggested here: Tufte like axis with pgfplots \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \makeatletter ...
3
votes
0answers
67 views

How to exclude items from a TikZ Spy

Somewhat related to this question, I would like to exclude items from the magnified area. In the example below, I do not want the pin lines or the orange line to appear in the magnified area. Is ...
3
votes
0answers
97 views

Appropriate values for `xmin`, `xmax`, `ymin`, `ymax`, or `unit vector ratio={a b}` to get asymptote

I would like to graph a function that has y=x as an asymptote. In the following code, I have $\sqrt{x^2 + x}$ plotted. It does not look like y=x is an asymptote to it. Are there values for xmin, ...
3
votes
0answers
108 views

Error bars with color on pgf plots

I was trying to make my error bars the same color as I have for my data on pgf-plot. The method was greatly explained earlier here - Define error bar color in scatter class My code at the beginning \...