{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
1answer
200 views

Adding extra ticks based on sum of ybar stacked

I am trying to add minor yticks on my axis based on the end values of a ybar stacked plot. Here is where I'm at: \documentclass[tikz]{standalone} \usepackage{pgfplotstable} \pgfplotstableread{ Year ...
11
votes
1answer
337 views

Criteria for deciding how best to specify coordinates with tikzpicture with or without pgfplots

Conclusion The original question, as Christian has pointed out, was far too broad and basically a result of being overwhelmed by the size of two main manuals for tikz and pgfplots and how they ...
26
votes
4answers
4k views

Differential Equation direction plot with pgfplots

In earlier thread Jake provided some code whom successfully draws the following differential equations in the range [0; 1] dy/dx=2*x dy/dx=x*sqrt(x) See: How to draw slope fields with all the ...
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 ...
6
votes
1answer
864 views

pgfplots log ticks with fixed point: only for one axis?

I recently learned about the log ticks with fixed point option in pgfplots, which I like very much. However, it seems like if I add it to the options of an axis like so \begin{axis}[% max space ...
9
votes
1answer
2k views

How to draw slope fields with all the possible solution curves in latex

Sorry, I have no code to submit, mostly because I have no idea how to do this. I want to type up my homework (I can do the homework by hand) and I am looking for a simple method that I can use ...
8
votes
1answer
2k views

Problem with a TikZ/Geogebra plot of an exponential function (even if using CVS version definition)

I wanted to graph the function f(x)=(-1+4x^2)*e^2 in a coordinate system. Using "Export Graphics View as pgf/TikZ" in Geogebra I got the following code (here shown after I did some minor changes ...
1
vote
2answers
798 views

3D as 2D plots using Matlab data

I am trying to plot 3d data as 2d (please refer to the attached figure). Is that possible at all in Tex (or Matlab)?(Usually, this is done a s a legend, however, when no colors are allowed, I have to ...
9
votes
1answer
260 views

\pgfmathdeclarefunction and LuaLaTeX

Is it possible to use LuaLaTeX in \pgfmathdeclarefunction? I tried with sinh which seems to work in pgfmathsetmacro but not in \pgfmathparse and pgfplots. How should I declare a pgf function with ...
5
votes
1answer
187 views

Plots with “no marks” have marks in references

I want to plot some functions without marks and reference them in my text - the problem is that in the text there are some random marks and i can't turn them off somehow. \documentclass{article} ...
2
votes
2answers
8k views

Install packages in texworks missing style files

So I am trying to install the pgfplots package in LaTeX on my Windows 7 machine. I usually did this by just running the LaTeX file with \usepackage{pgfplots}, and then the computer asks me if I want ...
5
votes
1answer
519 views

A pgfplots bar chart only shows the first x tick

I have the following code: \begin{figure} \pgfplotsset{ every axis/.append style={font=\tiny}} \centering \begin{tikzpicture} \pgfplotstableread[col sep=comma,header=false]{test.txt}\mydata; ...
4
votes
2answers
499 views

Making given y-axis data in dB?

I learned recently how to draw in pgfplots and is really enjoying the output. I generate my data in matlab and then write it to a file. One line of the file will contain two entries, first x-axis data ...
6
votes
1answer
428 views

Drawing a box with shading in pgfplots

As a follow-up to this question, or more precisely this answer, I'd like to know how to do the equivalent of \shadedraw [shading=axis,left color=green,right color=orange,color=blue,line width=2] ...
5
votes
1answer
611 views

How to change the distance between a pin label and the pin line?

The distance between the pin line and the plot can be changed by inner sep. How to change the distance between the pin label and the pin line? \documentclass{article} \usepackage{pgfplots} ...
3
votes
1answer
249 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 ...
11
votes
2answers
872 views

Interactive surface plot with pgfplots

I know that it is possible to embed three-dimensional files into PDFs with \LaTeX which can then actively be interacted with by the reader (see here for example). I have a surface plot I made with ...
3
votes
1answer
323 views

Pgfplots label not appearing

\documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \usepackage{tkz-euclide} \begin{document} \begin{tikzpicture} \begin{axis}[ticks=none, xtick={-10,-9,...,10}, ...
2
votes
1answer
144 views

How enlarge the two parts of data

Below shows the graph and code. The red circle show two portion of data. Since the upper red circle has data values >1500, therefore the lower red circle(0-500) shows all lines cramped together. Is it ...
3
votes
0answers
22 views

Empty y-axes label in tikzpicture-diagram [duplicate]

I'm searching for to code for a empty y-axis label. I don't want numbers on my y-axis. Any Ideas? My code: \begin{tikzpicture} \begin{axis}[only marks, ...
8
votes
1answer
1k views

Pgfplots: tick labels with zerofill except for 0 tick

The standard pgfplots notation for tick labels is without final zeros when no needed but the standard one for scientific papers is to have all ticks with the same number of digits after the dot a part ...
6
votes
1answer
5k views

Filling in markers in pgfplots

I've been searching around and digging through the pgfplots manual and I can't quite seem to find a good answer for this. I'm trying to make a graph with "open circles" to indicate where the function ...
4
votes
0answers
78 views

question on pgfplots and pos= [duplicate]

In pgfplots, pos=a , with a between 0 and 1, refers to the relative x coordinate on a plot. I was wondering if there is an equivalent construct that accept the absolute x coordinate rather than the ...
3
votes
1answer
1k views

Legend marker in pgfplot bar chart

I spent the last hours trying to solve this issue. I hope you can help me, sorry if the answer appears clearly somewhere else, I was not able to find it. I would like to adjust the marker/symbol in ...
7
votes
1answer
686 views

Dashed axis lines

How can make the axis lines that go from the origin to each of the coordinates dashed? For instance I want the axis line that goes from (0,0,0) to (0,0,1) to be dashed. ...
3
votes
1answer
615 views

Two boxplots per plot entry - shifting boxplots in pgfplots

I'm trying to compare the results of a control group and an experimental group under different conditions. To simplify, let's assume there is only one condition (ie. only one mark along the x axis ...
7
votes
2answers
800 views

Two-sided bar chart

I strive to make a bar chart displaying opinions for and against different topics. I tried to do this with pgfplots starting from bar and interval bar charts. Bars to both sides can be archived ...
5
votes
1answer
1k views

Shading regions of a graph with Tikz?

I'd like to shade the regions labeled A, B, C, D in this graph. \begin{tikzpicture} \begin{axis}[ xmin = 0, xmax = 1000, ymin = 12, ymax = 16, xlabel=$Q$, ylabel=$P$, ] \addplot[name ...
3
votes
1answer
560 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 ...
4
votes
1answer
791 views

Overlay bar plots to do asymmetric errorbars?

To illustrate the problem, I use the code from the answer of this link for asymmetric errorbars in pgfplots. \documentclass{article} \usepackage{pgfplots} \usepackage{pgfplotstable} ...
8
votes
1answer
518 views

Plot and non-numerical labels with PGFPlots

Given some data (from a file), I would like to use the first two columns as coordinates, and the last column as label for every point. x y label 123 5.2 name I use the table command to read ...
5
votes
2answers
752 views

Plotting R boxplots with pgfplots

I use quite a number of boxplots in my writing, and have chosen pgfplots as my plotting solution for a number of reasons (one of which is the benefit of having the data to build the plot in the tex ...
30
votes
1answer
2k views

How to make pdfLaTeX multithreaded when `--shell-escape` is enabled?

I am using \write18 enabled (or --shell-escape) with externalization to compile a bunch of PGFplots. The first run takes much time, and I noticed that pdflatex only runs on one CPU core. Is there any ...
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 ...
8
votes
1answer
867 views

Using pgfmath declared function in pgfplots/tikz commands

The commented rows of the following code give me errors. It seems that functions declared with \pgfmathdeclarefunction do not work with tikz commands... \documentclass{standalone} ...
8
votes
2answers
1k views

Problems using \addlegendentry in a loop with pgfplots

I have some spectra to plot, which I exported from the Siemens Xray toolbox, which works nicely with pgfplots. Since these are multiple files that look the same I think I can do it with a for loop, ...
6
votes
1answer
250 views

When using decorations, how can I calculate with \pgfdecoratedpathlength?

I would like to draw a picture with tikz and use 'decorations' to show a single pulse on a line. Correct: A -- B As you may see my code won't work for more than one segment ( A--C--B ). ...
1
vote
1answer
129 views

Composite plot in PGFPlot

I am trying to get pgfplots to do produce a plot like the following: i.e. a scatterplot with a second scatterplot below the x-axis. I am having a hard time figuring out how this kind of plot is ...
4
votes
2answers
674 views

Pgfplots: How to fill area under a curve in a 3d plot similar to \closedcycle in 2d

How can I fill the area under a curve in a 3d plot, similar to the \closedcycle command in ordinary 2d plots? Applying this command does a filling which is not rotated. Minimal working example: ...
7
votes
1answer
1k views

pgfplot xbar legend ordering

when I am drawing a xbar chart, I have troubles with the legend entries. They appear to have the opposite ordering as I suppose they should have. \begin{tikzpicture} \begin{axis}[xbar] \addplot ...
6
votes
1answer
397 views

output-directory and shell commands

Let's use a small example to use gnuplot to draw a nice function using tikz. \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw plot[domain=-3:3,samples=100] ...
1
vote
0answers
26 views

tikz legend with only 1 bar, not 2 [duplicate]

I have bar graphs made with tikz picture and pgfplots and the legend has two bars shown for each item. If this were printed in black and white I can see it being confusing given that I have multiple ...
6
votes
1answer
226 views

pgfplotstable: fixed precision, switch-case?

I tried using pgfplotstable to format an external txt file, but some problems arrived. My goal is to show the numbers with fixed, fixed zerofill, precision two and with the presign, which should ...
3
votes
1answer
444 views

tick mark separation

My graphs have two ticks on the x-axis. I'd like to have 3 graphs across a page and include y-axis labels. Right now that wont fit. Is it possible to move the x-tick marks closer together so the ...
6
votes
2answers
584 views

Annotate grouped bar plot

I'm trying to draw a grouped bar plot, but with added dots "on top" to signify outliers in the results. Currently I have: \begin{figure}[] \begin{tikzpicture} \begin{axis}[ ...
12
votes
4answers
1k views

In pgfplots, how to apply enlarge * limits to axis but not to grid?

I need to plot a pgfplot where the axis arrows “overshoot” the grid by 10pt. Using enlarge x limits I can enlarge the arrows, but then the grid gets enlarged too. \documentclass[]{standalone} ...
3
votes
1answer
782 views

Setting gnuplot-like colormaps with pgfplots

I would to use the gnuplot default colormap with pgfplots. This colormap is defined in gnuplot with set palette rgb 7,5,15 where the numbers refer to a function for the red, green and blue colours ...
5
votes
1answer
398 views

Add background pattern to tikzpicture vertical bars

How do I replace the blue backgrounds as indicated in the picture with a diagonal and grid pattern respectively? I currently can't find a neat solution for my kind of graph. Code ...
0
votes
1answer
466 views

How to correct problem with ybar plot: bad axis and too many labels in x axis

I need a bit of help here with the axis... Any suggestions would be always welcome. I have got 2 extra labels at the x axis... \documentclass{scrreprt} \usepackage{pgfplots} ...
2
votes
1answer
2k views

Pgfplots: Horizontal colorbar on top

I found on pgfplots manual ho to have an horizontal colorbar (simply specifying the colorbar horizontal option) but how can I put it above the axis? By default pgfplots puts it below the axis.. Here ...