{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

1
vote
1answer
224 views

How to use specific x-values of a CSV-file for drawing a x-y-plot? [closed]

I have a question concerning pgfplots. I have a CSV-file with x-y pairs. The CSV-file is very large (>10k entries). I want to plot now x vs y, but only at some specified x-coordinates. In other ...
7
votes
1answer
183 views

Labeling the center of a closedcycle area

I have this figure: \documentclass[border=2pt]{standalone} \usepackage{pgfplots} \usepackage{kpfonts} \newcommand{\func}{ .00038*(x+8)*(x+6)*(x+3)*(x-1)*(x-6)*(x-8) } \pgfplotsset{ every x tick ...
4
votes
1answer
714 views

pgfplots: Draw area of summed up percentages (like 'ybar stacked', but area style)

Sorry for the title, but I didn't know, how to explain my problem properly. I want to have a filled area plot, like in chapter 4.4.9 (Area Plots) of the pgfplots manual, but with summed up ...
4
votes
1answer
338 views

Legend on second frame has only one entry, labeled wrong

Using pgfplots in beamer with \only frames, the legend for the second frame (only) inexplicably shows only one entry, with the color of the last \addlegendentry, but the legend of the first. The other ...
3
votes
1answer
617 views

curious xticklabel style error

I'm receiving the strangest error when trying to plot a simple graph. Let me show you - this works: \documentclass{standalone} \usepackage[utf8]{inputenc} \usepackage{tikz} \usepackage{pgfplots} \...
4
votes
2answers
2k views

Set the axis range according to the data range, that is, no scales for axis

I use the matlab2tikz package to creat surface in LaTex editor, but it display ugly unlike the Fig. created in the Matlab. Can anyone help me out? Is there a way of adjusting the x,y and z axis ranges ...
10
votes
1answer
780 views

Conditional format for correlation table

I'm using the script by Christian Feuersänger: \documentclass{standalone} \usepackage{colortbl} \usepackage{pgfplots} \usepackage{pgfplotstable} \pgfplotstableset{ /color cells/min/.initial=0, ...
5
votes
1answer
2k views

tikz/pgfplot unstacked ybar with “switched” overlay

So, i'm trying to make a nice ybar plot using pgfplot, but i have some issues i want to solve, hope you can help me. 1) the ybar are not centered on the x value as they should, i mean, the bar for x =...
5
votes
1answer
1k views

pgfplots - How to use figures with commas when comma separator is defined empty?

As the MWE shows, the separator for every 1000th count was defined empty (for the lack of a better term) since the first column represents the year. So running the MWE does not work, since pgfplots ...
3
votes
1answer
202 views

Gnuplot invisible

I'm trying to plot two implicit curves (using pgfplots and raw gnuplot) but they don't appear in the document. In gnuplot it works just fine so I guess it has something to do with pgfplots but i can't ...
5
votes
1answer
2k views

How do I set units in pgfplots without square brackets?

This MWE: \documentclass{article} % translate with >> pdflatex -shell-escape <file> % This file is an extract of the PGFPLOTS manual, copyright by Christian Feuersaenger. % % Feel free ...
4
votes
1answer
533 views

Scale Axis in PGFPlots without changing orientation

I'm trying to plot a data matrix using pgfplots and a surface plot. The method described in this question worked well for me: Using pgfplots, how do I arrange my data matrix for a surface plot so ...
15
votes
1answer
791 views

pgfplots: problem with “non-smooth” intersection of two lines' ends

I have a problem like the one in this question concerning a tikz drawing but for a pgfplots plot. I want to create a plot that has one region filled without opacity and a neighboring one filled with ...
4
votes
1answer
357 views

How to adjust the y-axis of pgfplots

In the right pgfplots, I hope that it could have (0, 10000,20000,30000,40000,50000)[in normal scale], rather than (1000,10000) [in log scale] now, how should I do that? This the the code \begin{...
3
votes
1answer
243 views

Pgfplots: How to make the plot exceed the axes

I am plotting a spike using pgfplots. I want to make the y-axis until (4) only. However I want the plot of the spike itself to continue beyond the y-axis (say until 10). Is there a possible way to do ...
9
votes
1answer
2k views

Barchart with pgfplots with data from R

It took me a while to create a nice (... to some extent) bar chart with R which represents what I need. However I noticed it doesn't look very aesthetic in my Latex document. Sweave isn't a good ...
3
votes
1answer
158 views

Missing pictures when using pgfplots

When preparing an article I came across with a strange problem. To draw graphs I use pgfplots. Like here: \documentclass[twoside,11pt,a4paper]{article} \usepackage{daiostyle} \usepackage[all]{xy} \...
6
votes
1answer
574 views

Axes for notched box plots from data files

I am trying to create notched box plots similar to those shown in the picture from data files. I have managed code that creates the box plots with notches like I want (the code below without the ...
8
votes
1answer
596 views

ellipse intersecting a circle

I am trying to draw an ellipse which intersects the sphere of influence, that is, the dashed circle around the moon. The ellipse needs to pass through (-170.864:.7cm) location along the v0 vector and ...
8
votes
1answer
1k views

How to project a function over a 3D plane

When I looked up the method to express two variable functions as a sequence of intersecting horizontal planes, I thought to use PGFplots to construct a simple set of "slices" of a generic function (...
7
votes
1answer
1k views

Read boxplot prepared values from a table

Update: Is there any possibility of drawing two box plots this way using a single datatable as in the updated MWE below? I'm trying to use pgfplots 1.8's shiny new boxplot feature. As I am also ...
10
votes
1answer
1k views

pgfplots sample colors from colorbar

I would like to get the color definition from a sample of colors in a pgfplots colormap using for example the RGB model. When I choose colormap/bluered with colorbar style={samples=10} I need to have ...
3
votes
1answer
1k views

Adjusting arrow style on pgfplots axes

Using axis line=middle in pgfplots creates arrow tips on the end of the axes. How can I adjust the size, style, etc? I suppose one way would be to make axes without arrows (using axis line*=middle) ...
7
votes
1answer
2k views

draw grid in pgfplots when axis line=none

I would like to have a grid in the y axis although the axis y line is not drawn, either by setting axis y line=none or hide y axis. In the MWE below the horizontal line along y=0 is not drawn when I ...
7
votes
1answer
1k views

pgfplots: Showing tick marks and labels but not axis lines

Using pgfplots, it's possible to turn on or off printing of axis lines and ticks using axis lines for all axes or axis x line (etc.) for only selected axes. However, sometimes it is desirable to print ...
9
votes
1answer
1k views

Common colorbar for groupplot

I want to group two surface plots with the groupplots library from pgfplots and place a common colorbar from the top of the first plot to the bottom of plot. At the moment (code below), both plots ...
4
votes
1answer
963 views

Axis labels and ticks in degree, plot in radian

I've got a plot - the x axis is in radian (from pi/2 to pi) and with gnuplot it works like a charm - the problem is - that my x-axis labeling should be in degree (-90, -75,...,90) and i'm kinda stuck. ...
3
votes
1answer
87 views

Access label, title in pgpfplots

I would like to know if is possible to access the standard nodes in pgfplots such as ylabel, xlabel, title. I am pretty sure this is quite easy, since each node should have a name by which it can be ...
1
vote
1answer
137 views

Problem with referencing plots

I want to reference some plots (done with pgfplots) in my text but somehow it's not possible. If i copypaste the examples from the pgfplot- documentation it works but if I move one of the labels to ...
8
votes
1answer
551 views

Perpendicular lines on sloped lines

I'm trying to make a diagram in TikZ which is supposed to illustrate the triangle you construct when constructing a 60 degree angle. I'm having some troubles, mainly concerning the title of the ...
7
votes
1answer
1k views

Create a Shmoo plot with pgfplots/tikz

I'm interested in creating a Shmoo-plot using LaTeX. I have looked through the PGFplot-examples but couldn't find any that looked suitable as a starting template. Google produces nothing as well, and ...
5
votes
1answer
1k views

Showing grid on top of plot fill with PGFplots?

I have a plot with a pass/fail metric, and wish to show this clearly by having to seperate colors in the plot. To make the data stand out, I have a background grid to the axis tick marks. However, ...
7
votes
1answer
771 views

How to scale a pgfplot in a tikzpicture correctly?

I created a figure in pgfplots and added some extra labels in a tikzfigure environment. Now it turns out I need to rescale the whole figure. Normally this can be done by adding scale=2 but here the ...
12
votes
1answer
982 views

Brownian motion with drift

I have a code for the Brownian motion and it indicates three paths which initially started at point 0. My goal is to increase the initial starting point from 0.0 to e.g. 0.6. This is achieved by ...
2
votes
1answer
102 views

Vertical labeled markers

I have a plot with four curves, and I wish to add vertical marker to pinpint the exact moment the curve drops below a certain threshold, much like this: I'd like to be able to control the width of ...
6
votes
1answer
169 views

Generating an xtick for maximum value

I want to find the maximum value of a plot given by a function like in How can I automatically mark local extrema with pgfplots and scatter?. Is there any way of writing the x-value on the x-acis ...
10
votes
1answer
763 views

Compiling a tikzpicture including \ref

I've been reading and gathering material from multiple sources online about what steps are required to externalize a document that contains TikZ pictures which store a reference to their legends using ...
12
votes
3answers
1k views

pgfplots - Add offset to pins

I'm trying to make a bar plot for an optimization parameter in quantum physics. To be more informative, the graph should display the values of these parameters above the bars. So far I did \...
9
votes
1answer
528 views

legend placement with bounding box restrictions and externalization in pgfplots

I find it useful to add \pgfplotsset{/tikz/every picture/.append style={trim axis left,trim axis right}} to my preamble for bounding box restrictions. But then when I use the legend to name feature ...
3
votes
1answer
2k views

Modify the legend-style in pgfplots

I have a question concerning pgfplots. I made a minimal example which is related to the example in the pgfplots manual (page 182): \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} ...
8
votes
1answer
409 views

pgfplots: problem in the legend using custom marks

With the help of \pgfdeclareplotmark I defined a custom mark for a plot and it worked as expected; however, in the legend, the mark appears with a vertical shift. What is causing this problem and how ...
5
votes
1answer
453 views

Draw ticks over external plot using pgfplots

I plotted a contour/surface plot with gnuplot using set pm3d map and want to include this picture via \addplot graphics {...};. When I match the plot area of the axis environment with the plot range ...
9
votes
1answer
642 views

pgfplots: Tilted and Rotated sphere

I can make sphere with pgfplots through the following code. \documentclass[tikz]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \begin{document} \begin{tikzpicture} \begin{axis}[% ...
13
votes
1answer
5k views

How to remove ticks from the top and right axes of a plot generated with PGFPlots?

I want to remove ticks from the top and right axes of the bounding box of a plot generated with pgfplots. Any help appreciated. Here is sample code which generates unwanted ticks. \documentclass{...
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 ...
5
votes
1answer
3k views

Declare function for tikzpicture

I'd like to declare a function that will be part of the equation that I then want to plot. The equation that I want to plot is defined as \frac{e^{-rT}N'(d_{2})}{S\sigma\sqrt{T}} The function to ...
8
votes
1answer
717 views

Pgfplot : change the distance between 2 adjacent boxes in box plot

Hi I want to change the distance between 2 adjacent boxes in boxplot. I am using following code. What should I change in code to get it similar to as desirable diagram \begin{filecontents}{lmpqd.dat} ...
7
votes
2answers
3k views

Draw sphere pgfplots with axis at center

I want to draw a plot that illustrates the ration pattern of an isotropic antenna. I thought about pgfplots to do the job. I grabbed the code from pgfplots manual and did some changes; but it doesn't ...
1
vote
0answers
272 views

pgfplot Boxplot How to change the thickness of median [closed]

Is there a way to change the thickness of median line in box plot. I am using the code given in Pgfplot : change the distance between 2 adjacent boxes in box plot
4
votes
1answer
2k views

pgfplotstable manage strings and values

I like the pgfplotstable package for reading and plotting tables but handling of strings and values (especially when strings contain spaces) drives me crazy... I often use a table as shown here: \...