{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
139 views

Wrong linear regression computing

I've just started to use pgfplot and I'm actually trying to get the equation from a plot, with the linear regression. However, I'm working in a loglog plot, and the resulting regression equation is ...
3
votes
1answer
343 views

pgfplots legend to name not working

I would like to use legend to name feature to display legend externally. I have two graphs inside a tikz picture which comes from this question. Here is the code tha to tried to modify and make the ...
3
votes
1answer
84 views

pgfplots: adds “-indexX” to duplicate columns when pulling column name by \pgfplotstablegetcolumnnamebyindex

I am making graphs from a huge CSV with a macro hacked from http://tex.stackexchange.com/a/45125 and http://tex.stackexchange.com/a/24023 Which selects start/end column and adds them etc. But ...
3
votes
1answer
218 views

Simple pendulum phase space plot with pgfplots: looking for a clever parameterization

I want to produce a nice phase space plot of the simple pendulum for a course I'm teaching. Essentially, this boils down to plotting y^2/2 = cos(x) + e for different values of e (the energy). If I ...
3
votes
1answer
197 views

pgfplots in beamer class with BaKoMa TeX

I have a problem concerning plotting of functions in beamer class with pgfplots. I use BaKoMa TeX. In the article class, all works fine, but switching to beamer, an error occurs as soon as ...
3
votes
1answer
137 views

How to save a list as a macro for pgfplots

I want to create and store a list then use that list in a pgfplots scatterplot. My attempt is \documentclass{standalone} \usepackage{pgfplots} \begin{document} \newcommand{\listA}{ (1,2) (2,3) ...
3
votes
1answer
297 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 ...
3
votes
1answer
462 views

Scaling graph along x axis

I am trying to plot a symple graph with pgfplots but the numbers do not seem to appear right. Is it possible to somehow scale the left part of the graph? I would also like the numbers on the x axis ...
3
votes
1answer
308 views

pgfplots - box plots min and max x-values

Im using the following code from pgfplots to create box plots: \begin{tikzpicture} \begin{axis} [ ytick={1}, yticklabels={}, y=0.7cm ] \addplot+[boxplot] table[row sep=\\, ...
3
votes
1answer
176 views

How can I get titles on the top of grouped bars?

I have a bar plot with grouped bars. Each group should contain the total sum on top of the group. Example: My example has two problems: The x-position is estimated The y-psition (height) depends ...
3
votes
1answer
270 views

Cant scale x-Axis to textwidth

I want to plot some measured values. The y-axis contains the the voltage and the x-axis time stamps. I used matlab2tikz to create this plot: If I want to plot the graph, the x-axis is not scaled to ...
3
votes
1answer
990 views

Strange behavior in smooth pgfplot with sudden changes in the slope

I'm trying to plot some points with sudden changes in the slope. But I get some strange behavior like this: as you can see in the peaks, there is no smoothness in there. However, I think the ...
3
votes
1answer
361 views

pgfplots ycomb width

Is there a simple way to control the width\thickness of the strokes in the ycomb/xcomb commands proposed in pgfplots? Or should I dive into the source code to clarify?
3
votes
1answer
27 views

Scatterplot from table with markers set by meta column value

My input data is a txt file with a number of columns and rows. The last column value is always an integer taking a value of 0, 1, 2, or 3. I need a scatterplot which has a different marker depending ...
3
votes
0answers
32 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
27 views

“[name path=]” causes document to not finish compiling

I want to plot the area between two functions. On one machine it compiles nicely, on the other one it hangs. Code: \documentclass{standalone} \usepackage{pgfplots} \usepgfplotslibrary{groupplots, ...
3
votes
1answer
46 views

TikZpicture/pgfplots: How to insert time-data in mm:ss-format (without hh:) into x-axis?

Imagine an ordinary x/y-diagram by using the pgfplots/tikzpicture-packages: In case of regular date-values (dd-mm-yyyy) usually there is no problem in application. But now, I have to add times-values ...
3
votes
0answers
36 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
46 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
1answer
50 views

Can you use `pgfplotstable` to do a linear regression to an expression?

I have a lot of data in a table, but it is not linearly related. I can linearize the relationship by computing functions (x expr and y expr expressions). I would like to use pgfplots to show the ...
3
votes
0answers
32 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
51 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
90 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
1answer
62 views

How can we define a custom variant of addplot, including new keys and default values?

I frequently create plots with \addplot using a lot of optional arguments, making it difficult to keep the code consistent. I have a few repeating plotstyles so I tried to implement a new macro that ...
3
votes
0answers
40 views

number of samples for a function plot not working with pgfplot [closed]

I need to plot representations of the delta function on the same axis. \begin{tikzpicture} \begin{axis}[ xlabel=$x$, ...
3
votes
0answers
106 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
72 views

How to label areas in pgfplots fillbetween library

Is there any simple way put a label say $A$ roughly at the "center" of an area created by the pgfplots fillbetween library? Take for example the following example: \documentclass[tikz]{standalone} ...
3
votes
0answers
65 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
1answer
90 views

How to change the mark in a pgfplots boxplot

I have my own custom style for boxplots which I like very much. I like it so much I would like to use it everywhere. I used it with the old boxplots, and it did everything I wanted. However, the ...
3
votes
0answers
68 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, ...
3
votes
0answers
55 views

Pgfplots and histogram with heterogeneous values [duplicate]

I've got to plot an histogram with pgfplots where a single x value assumes a large value on the y-axis (14000) while the remaining data are all under 150... I'd like some suggestions on how to handle ...
3
votes
0answers
25 views

pgfplots stacked bar plots with too little space for some “nodes near coords” [duplicate]

When creating stacked bar charts with pgfplots, how can I avoid printing those (and only those) "nodes near coords" if there is too little space? The following MWE illustrates the problem: ...
3
votes
0answers
154 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 ...
3
votes
0answers
137 views

Defining a function for later use in TikZ or pgfplots [closed]

Not sure what my problem is. I'm trying to define a function to later use in 3D plotting. As of now, I've tried to simplify the code as much as possible to find the error, so realize these are not the ...
3
votes
0answers
173 views

PGF: draw longitudinal arcs in 3D axis environment

I want to draw a sphere, similar to the first one here: http://www.texample.net/tikz/examples/map-projections/ But - of course - different. This is, what I did so far: The dashed lines are behind ...
3
votes
0answers
28 views

Parsing CSV with comma as decimal separator in pgfplots [duplicate]

How can I plot data from CSV file when comma is separator of decimal part? Part of my CSV file: U f(U) 0 6,12323399573677E-016 0,1257 1,2536924115 0,2514 2,4876019375 I've tried this trick but it ...
3
votes
0answers
242 views

TikZ binomial distribution plus Gaussian approximation

My intention is to draw the probability function of a binomial distribution with trials = 20 and probability = 0,4. Then i wanna add the curve of an approximate gaussian curve in the same plot. How ...
3
votes
0answers
87 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 ...
3
votes
0answers
89 views

Custom column intervals in a PGFPlots histogram

Is is possible to give columns in a PGFPlots histogram custom interval of different sizes? Eg. I would like my histogram to have five columns over these intervals: [-100,-50[ [-50,0[ [0,1[ [1,50[ ...
3
votes
0answers
103 views

Compactifying histogram at empty tick values

I have the following histogram: \begin{tikzpicture} \begin{axis}[ x tick label style={ /pgf/number format/1000 sep=}, ylabel=Throughput, enlargelimits=0.15, legend style={at={(0.5,-0.15)}, ...
3
votes
1answer
256 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. ...
3
votes
0answers
147 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 ...
3
votes
0answers
90 views

pgfplot error bar in foreground

I would like to get the error-bar of the lower y-bar ontop of the stacked bar. Which command can I use to get the error bar to the foreground? Thank you in advance. ...
3
votes
0answers
258 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
0answers
150 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 ...
3
votes
0answers
97 views

Creating a tornado plot with pgf and force a break in one of the horizontal bars

To display a sensitivity analysis I want to produce a Tornado plot. In the plot a specific base case value is compared to the values produced after changing parameters in the model. I started from ...
3
votes
0answers
91 views

Part of specified graph is missing [duplicate]

I have the code to graph a rational function f(x)=(3x^{2}+5x)/(2x-3) with a vertical asymptote and a slant asymptote. The equation for the vertical asymptote is x=3/2. I decided to have two parts to ...
3
votes
1answer
146 views

Conditionally use bold font for table cell with pgfplotstable

I am trying to conditionally use bold font for table cells with values according to a condition. It works nicely with changing the text color as illustrated in the example below, but I am not able to ...
3
votes
0answers
52 views

Reduce number of input files for group plot in pgfplots [duplicate]

In the pgfplots groupplot below, I have three sets of data represented by data1, data2 and data3. Each of the data have three subtypes. And I need to plot a graph for each of the subtype. The file ...
3
votes
0answers
26 views

Use data from other multiple data files with calculations [duplicate]

This answer shows nicely how to use data from another file while plotting data using \addplot table. However, when trying to access the create on use column using \thisrow{}, an error occurs. For ...