{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

2
votes
3answers
57 views

Can I connect the end of an \addplot to the beginning of the next \addplot?

I'm using pgfplots to plot an implicit equation, but I'm running around using gnuplot by parametrizing the curve instead. The down side is that my parametrization necessarily comes in curve segments. ...
2
votes
1answer
179 views

Display max value of an y bar stacked plot

The following MWE generates an y bar stacked plot: \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ ybar stacked, ...
2
votes
1answer
149 views

Help drawing vectors in a PGFplots axis environment using calculated coordinates and \draw

Why does using \draw and calculated coordinates not follow what a graph of projectile motion ought to look like? Any suggestions for code that would work using formulas in coordinates? ...
2
votes
2answers
259 views

How can I make a simple graph with grids using pgfplots?

I want it to look like this: Preferably with comments so I can learn how to make my own!
2
votes
1answer
145 views

Cylindrical Bar Chart

I know this might be a long shot, but does anyone happen to know (or point me to where to start) how to draw this chart. Say we have 6 values (5, 10, 15, 20, 25, 30), one for each column. Thanks in ...
2
votes
1answer
3k views

Enabling “--shell-escape” on TeXworks under MiKTeX

After resolving the problem on my previous question, I applied to finally install Gnuplot 4.6; and after a successful installation I had to allow the --shell-escape option on TeXworks, so I added a ...
2
votes
2answers
500 views

Pgfplot Automation tool

Are there any good graphical software that I can use to draw diagrams/graphs and export them as pgfplot code? For example, I want to create an histogram so I drag an histogram icon from a menu to the ...
2
votes
2answers
583 views

ybar stacked plot with negative coordinates

When using ybar stacked on a mix of positive and negative coordinates I cannot seem to find the answer I want. \begin{figure} \begin{tikzpicture} \begin{axis}[ybar stacked] ...
2
votes
1answer
28 views

Pgfplots: Add curly rotated braces to a graph

I created a simple graph of a demand function so far. Is there an easy way of addition curly rotated braces and labels to the graph (like in my sketch). Those should mark the intervals for a value ...
2
votes
1answer
204 views

Color coded plots with colorbar in pgfplots

In matlab I can achieve this result using the structure of this minimal working example (in matlab): figure('color','white'); hold on xx=0:1; colors = parula(5); for i = 1:5 color = colors(i,:); ...
2
votes
1answer
53 views

How to make parametric plot?

I wonder how to make multiple parameters in pgfplot? In the code I used x and y as parameters to draw sphere, with radiuse 1cm. When I added x=2cm, y=2cm, z=2cm, so that the plot would look better: ...
2
votes
2answers
131 views

Print comma instead of period in node near coord

I need to print the Y-values for each point with a comma for decimal seperator. See my MWE. The data is provided as a .csv within my folder. \documentclass{standalone} ...
2
votes
1answer
222 views

Creating performance profiles

A performance profile is a kind of plot used in the optimization community; here below is an example from http://www.gamsworld.com/performance. For an introduction, see Section 22.4 of Higham and ...
2
votes
1answer
95 views

plot points depending on x value?

Is there any options to replace each nth point={100} for something dependent on column value? My table is something like: x y 0 5 1 4 2 5 3 3 3 -3 2 -4 1 -1 0 0 I just want to ...
2
votes
2answers
532 views

Inserting graphics into asymptote or pgfplots

How another graphics can be inserted into Asymptote or pgfplots? The following is a MWE in pgfplots that creates three figures in the document. The main figure which I want to insert graphics in is a ...
2
votes
1answer
409 views

PGFPlots and gnuplot: How to add asymptote, a xtick that isn't a number, and can intersection be used?

\documentclass[tikz, convert = false]{standalone} \usepackage[utf8]{inputenx}% http://ctan.org/pkg/inputenx % Euler for math | Palatino for rm | Helvetica for ss | Courier for tt ...
2
votes
1answer
101 views

Can \draw .. controls .. be found in pgfplots?

I just want to use something like .. controls .. in an addplot command. Unfortunately, the option "smooth" does not produce the image I desire. I haven't found it in the manual so far. The reason I'm ...
2
votes
2answers
250 views

Negative y value in polar plot

I'm having some trouble with polar plots. I have to plot negative values, but without changing direction. I tried to set the ymin value to be negative, but it doesn't work. ...
2
votes
1answer
585 views

pgfplots: using pi in foreach

How can I use pi the number in a \foreach in pgfplots? \documentclass[tikz, dvipsnames]{standalone} \usepackage{pgfplots} \usepackage{mathtools} \pgfplotsset{compat = 1.8} \begin{document} ...
2
votes
2answers
1k views

barchart in pgfplots looks really bad

Problems: The bar value "90" is written over a black line, almost impossible to read The value "58" is written over an x tick, hard to ready Bar spacing is bad. There is too much space between the ...
2
votes
1answer
587 views

Need help in drawing the following Stacked Bar Graph

I want your help in drawing the following figure. I think it is called as stacked bar graph.
2
votes
2answers
1k views

Remove border around area legend rectangle

I have a legend with the option area legend to draw a little rectangle in the legend instead of a line segment. There is a border around the rectangle I would like to either remove or make the same ...
2
votes
1answer
153 views

biblatex and pgfplots

I'm using pgfplots to plot some graph of data I stored in a file (a lot of data points). If i charge the bibtex package and I obtains the famous error: TeX capacity exceeded, sorry [main memory ...
2
votes
3answers
63 views

Text beneath two function graphics inside of a figure

Is there a way to put extra text under some function plots in the following code? I need them to appear side by side on the page in the same figure and I do not what to use an extra caption. The text ...
2
votes
1answer
95 views

Plotting a Bivariate Normal Distribution in Tikz

I have been trying to make a 3D plot of a certain bivariate normal distribution but that is far from ideal at the moment. The code I have been using is \begin{tikzpicture} \centering \begin{axis}[ ...
2
votes
1answer
107 views

PGFplots z buffer does not sort the plotted objects properly

I have a PGFplots axis environment in which I attempt to plot several line objects and a surface object. The objects have to be 'sorted' in the sense of which object is drawn before or behind the ...
2
votes
1answer
108 views

Survival Curves with pgfplots

I'd like to plot Kaplan-Meier (survival) curves with pgfplots from output generated in Mathematica. A typical output table would look something like this: 211 1 253 1 307 1 344 0 365 0 365 1 ...
2
votes
2answers
220 views

Tikz addplot fill between depending on sign

i have following problem. I read data from a table and plot it and then fill the area between the x-axis and the curve. This works fine. Well at least a bit. I want the "negative part" filled in ...
2
votes
1answer
60 views

Suppress auto axis range in pgfplots

I have an axis with two \addplot commands inside in pgfplots. Every \addplot command cause the axis limits to automatically re-arrange in order to show all the plotted data. I would like to suppress ...
2
votes
2answers
232 views

Drawing and labeling asymptotes

How do I label the asymptotes for the rational function y=(x+1)/(x-1)? I copied the code \draw[dashed,latex-latex] ({{1,0}}|-{{axis description cs:1,1}}) -- ({{1,0}}|-{{axis description cs:1,0}}) from ...
2
votes
2answers
374 views

addplot3 [area plot] filling the wrong area

using some saved data, i use (The data file cane be download from pX.txt where the first column is the x and at each iteration, I plot the other columns with respect to the first column) ...
2
votes
2answers
623 views

Plot theoretical Binomial distribution with pgfplots

I am trying to plot the theoretical binomial distribution with pgfplots but don't get the desired output: \documentclass{article} \usepackage{pgfplots} \usepackage{python} \begin{document} ...
2
votes
1answer
212 views

Pgfplots - Labeling Regions

I'm trying to draw chart which indicates different regions of stability/instability in all the areas demarcated by the different curves. How can I manually put in Roman numerals or letters on ...
2
votes
1answer
732 views

pgfplots: How to specify custom tick and label at specified value on an axis

I would like to specify a custom tick with a custom label at a sp \begin{axis}[ symbolic y coords={<{Critical point} at 2.138 ???>}, ] \addplot+[samples=100,domain=-2:2] {x^2}; ...
2
votes
1answer
658 views

A simple (indented) integration contour with Tikz

I would like to draw an integration contour which is pretty easy I think, but I am a newbie at the Tikz package. The integration contour goes from -i*infinity to +i*infinity parallel to the ...
2
votes
1answer
454 views

read strings from csv file for usage as figure meta data

I got the following problem, I use pgfplots(table) to generate plots and tables in my latex document from generated data. I would like to read additional information from a metadata file. The reason ...
2
votes
1answer
183 views

Lines missing in the graph

The code \pgfplotsset{mystyle/.style={mark=none}} \begin{figure}[t!] \resizebox{.4\textwidth}{!}{\begin{tikzpicture} \begin{axis}[title=QWS Dataset, legend pos=outer north east, ...
2
votes
2answers
2k views

Can't load file for bar plot

I have the following: \documentclass{article} \usepackage{pgfplots} \usepackage{pgfplotstable} \usepackage{filecontents} \begin{filecontents}{testdata.csv} Probe Mittelwert ...
2
votes
1answer
1k views

Moving axes labels in pgfplots

How can one have an axes labels (x and z near the axis) like this:
2
votes
1answer
2k views

How to draw a plot from .xls file in pgfplot?

I want to read .xls format file in pgfplot to draw a graph. I couldn't find how to do that. Is it possible to do that? I have attached a small .xls file here for which I want to compute plot. ...
2
votes
1answer
405 views

Footnote on graph title

I'd like to add a footnote to the graph title. After adding the footnote, it disappears! Here is my MWE: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \pagestyle{empty} ...
2
votes
1answer
130 views

How to change to dotted style

How to change the line style to line style with different line style such that people need not to have a color printer to view it? \pgfplotsset{mystyle/.style={mark=none}} \begin{tikzpicture} ...
2
votes
1answer
133 views

How can I shift ymin to zero when values are near to zero?

How can I shift ymin to zero when values are near to zero? I also try ymin=0 command but it does not work. \begin{figure}[h] \centering \begin{tikzpicture} \begin{axis}[ ybar, ymax=4, ...
2
votes
2answers
585 views

Strategies to visualize multiple two-dimensional regressions?

Hopefully I can describe my question more clear here in the content than in the title. It might be more about visualization strategy than specific pgfplots techniques. The problem is about regressions ...
2
votes
1answer
676 views

How can I add a legend in aligned subplots

I want to have two subplots with the same x axis aligned above one another. In the manual I read, that I should use \matrix{} to achieve this. Now I want to have legends in both plots. But since the ...
2
votes
1answer
852 views

pgfplots: putting marker labels outside of the plot

the following code: \documentclass{article} \usepackage[english]{babel} \usepackage{pgfplots} \usepackage{tikz} \usepgfplotslibrary{groupplots} \begin{document} \begin{figure} ...
2
votes
1answer
402 views

Pgfplots label get repeated by tikz spy library

My question is very similar to this question. I label a certain curve in my plot and magnify a part of that. The \spy command repeats the \label which causes multiply defined label warnings which are ...
2
votes
1answer
370 views

How can I add another plot to the \addplot command in PGFPlots?

My goal is to add another plot to the \addplot command and this small example hopefully shows what I'm trying to do: \documentclass{standalone} \usepackage{pgfplotstable} \begin{document} ...
2
votes
1answer
329 views

Cobweb diagram has offset iterates / modifying a working piecewise functions results in chaos

I have a problem with the following tikz code (maybe, when reading this, skip at first the code and read the question which is at the end), that creates cobweb-diagrams: \documentclass{article} ...
2
votes
1answer
668 views

Legend with Markers for Mesh Plot

I use a mesh plot with scatter points (2d) where the colors are determined from a third coordinate of the data as described in this question. The legend however should contain the markers of a curve ...