{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

11
votes
0answers
115 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 ...
6
votes
0answers
241 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
537 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
369 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
47 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
36 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
127 views

restricting variables in pgf plots

I am trying to draw the 'level curves' of the following function: where the variables are restricted such that x,y are non-negative, and x+y is less than or equal to one. In other words, this is a ...
5
votes
0answers
108 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
93 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 ...
5
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 ...
5
votes
0answers
497 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
730 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
572 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
30 views

How to make a 2D surface grid in Tikz?

I want to do something like this: And this is what I have done so far: \documentclass[a4paper, 11pt, oneside]{article} \usepackage{tikz} \usepackage{pstricks} \usetikzlibrary{scopes} ...
4
votes
0answers
82 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
92 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
379 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
594 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
334 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
611 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
545 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
496 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
286 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
314 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
338 views

drawing lines using polar axis coordinate system in pgfplots

I would like to draw arrows with polar axis notation in a pgfplots figure that has Cartesian axes with the draw command: \draw[->] (polar axis cs:radius=1, angle=30) -- (polar axis cs:radius=2, ...
4
votes
0answers
289 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
67 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
37 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
88 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
41 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
69 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
59 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
108 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
42 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
56 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. ...
3
votes
0answers
36 views

Variable dash spacing on a line in tikz/pgfplots

I would like to have a variant on the tikz dashed line style that begins with dashes spread far apart, and as the line continues to plot, the spacing between dashes reduces, perhaps to zero at the ...
3
votes
0answers
60 views

Pgfplots: \addplot3 with all axis in logarithmic scale

I would like to generate a surf plot and set the mode of all axis to "log". For instance \documentclass[tikz]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} ...
3
votes
0answers
78 views

Grouping data in pgfplots

I have a file with measurement results for different settings (group) in a single csv file as shown below. I would like to plot a line in pgfplots for each group and provide an appropriate legend. Is ...
3
votes
0answers
32 views

Is there a way to automatically force xticks on first and last data point in pgfplots?

I have created a custom pgfplot style which allows me to create line plots with the x axis being a time in hh:mm format. The data is loaded from .csv files. The automatic tick placement on the x axis ...
3
votes
0answers
87 views

Pgfplots: Transpose headrow as first column in: confusion matrix with colormaps / heatmaps

My question builds on code from this question: original question/answer What I am trying to achieve: I want to use pgfplots to build a table, where the header row is automatically added as first ...
3
votes
0answers
73 views

PGFPlots: calculate linear regression of part of the plot

I'm trying to calculate the young modulus of a certain material using it's load-deflection curve. For such, I need to get the slope of the linear part of the curve (just the beginning). But my files ...
3
votes
0answers
54 views

Crop z-axis of PGFPlots

I try to implement the following image of the function 1/(x*y) I plotted using WolframAlpha using the PGFPlots package: The function is not defined if x=0 or y=0, so I split it up into four parts ...
3
votes
0answers
57 views

trying to load images with foreach

Im trying to load images from a directory but I cant because I dont know why \i does not indicates the number, code searches the directory and the files were not found.. \documentclass{beamer} ...
3
votes
0answers
49 views

Specify marker color to come from colormap in @pre marker code

I'm making a 3D scatter plot of point data (markers only). I want the marker size dependent on one metadata column in my table, and the marker color dependent on another metadata column - I've managed ...
3
votes
0answers
72 views

Pgfplots: Draw time-series without missing data

I have time-series data which I want to draw with pgfplots. The data only covers weekdays, thus no weekends. Still pgfplots inserts new ticks for datapoints having essentially no data, this results in ...
3
votes
0answers
144 views

Pgfplots Boxplots with a thick line at the mean value

pgfplot produces nice looking plots, that have consistent look and feel. But sometimes you have a good reason to change that look, and I found it tricky to change style of an specific line, circle, ...
3
votes
0answers
153 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 ...
3
votes
0answers
87 views

PGFPLOTS Graph with many x values for the same y label

I am trying to create a diagram with PGFPLOTS like this: This is my data file: SN STAR PLANET R RU RL 1 51 Peg b 0.0521068 0.000868447 0.000868447 2 55 Cnc b 0.113377 ...
3
votes
0answers
200 views

Legend image arguments for the command `\addlegendimage`, 3d legend image

In the 3d plot I want to modify the third legend entry to only show the marks and not the line. From http://tex.stackexchange.com/a/113765/28093 I understood that I'm supposed to use something ...
3
votes
0answers
100 views

pgfplot - how to make horizontal error bars

Hello I would like to add horizontal error bars to my plot, that's picture is below. There is code of my plot \begin{tikzpicture}[thick,scale=1, every node/.style={transform shape},trim axis left, ...