{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
153 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 ...
7
votes
0answers
266 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
61 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
111 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
603 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
1k 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
396 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
60 views

Shaded area under pgfplot, starting with first data point, outputs wrong shaded area

This post is building of the question posted here. When I try to get the area under the curve to show up between 100 and 3000 by using the soft clip={domain=100:3000} command, I get this plot: I ...
5
votes
0answers
43 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
128 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 ...
5
votes
0answers
769 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
525 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
800 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
596 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
50 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
47 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
57 views

String concatenation in Tikz

How can I replace the sequence (in a pgfplots, Tikz environment) \addplot[black] table {plot3/fnxspy1.txt}; \addplot[black] table {plot3/fnxspy2.txt}; \addplot[black] table {plot3/fnxspy3.txt}; ...
4
votes
0answers
80 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
123 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
183 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 ...
4
votes
0answers
124 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
210 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 ...
4
votes
0answers
296 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
425 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
697 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
405 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
669 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
597 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
514 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
556 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
314 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
333 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
40 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
39 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
37 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
53 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} ...
3
votes
0answers
51 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
66 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
83 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
79 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 ...
3
votes
0answers
120 views

Plotting the sum of a function in TikZ

I am trying to plot a function that is the sum of another function based on the parameter. A famous example of this is the "sum of squares", however the functions I really want to do this do not have ...
3
votes
0answers
42 views

Find product of shifted plot and other plot in pgfplots

In the MWE, I shifted the blue plot to the left. How can I now plot the product of the shifted plot (in cyan), and the blue plot? Here is the code I have thus far: ...
3
votes
0answers
124 views

Position of y axis with pgfplots

I am currently trying to create a plot with pgfplots and can't seem to properly position the y axis like I want to. Here's my MWE: \documentclass{standalone} \usepackage{pgfplots} ...
3
votes
0answers
50 views

How to fill an area outside spheres?

The problem is the same as explained in my previous question: How to fill an area outside circles?. The only difference that now I need to fill the green area in three-dimensional space, i.e., the ...
3
votes
0answers
79 views

Parametric irrational system of equations with pgfplots

I thought of parametric form to the following system of equations, but it was difficult for me. Please help me to declare it in a parametric function drawn in pgfplots.
3
votes
0answers
115 views

Change cubes in 3d plot pgfplot to bars

I am plotting a 3d diagram using cubes to represent the data. Works fine so far. Basically, this is what I started with: http://pgfplots.net/tikz/examples/scatter-cube-plot/ Now what I want to do, ...
3
votes
0answers
175 views

Drawing a phase line diagram using TIkz/PGF

I have created a phase line diagram before using these two packages. The code is as follows, \documentclass{amsart} \usepackage{pgfplots} \usepackage{tikz} \newcommand*{\TickSize}{2pt}% ...
3
votes
0answers
44 views

Help with plotting Quadratics in pgfplots

I'm practically new to the pgfplots package. I want to plot the quadratic equation 2x²-5x+2 on a set of axes (this is for an A-level text book). I have two questions: Why does plotting x² in the ...
3
votes
0answers
89 views

Doing surf plot with user defined colormap

I want to make pgfplot surf with my colormap rainbow. The funny thing is that I get error I do not know the key '/pgfplots/colormap/rainbow' and I am going to ignore it. Perhaps you misspelled it. ...