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

How to get vector graphics from Concorde program?

Back in around 2009/2010, my former colleague Libor Sarga (a beginner in TeX at that time), asked me if I could help him to get a vector form of his results got from Concorde. He was writing a chapter ...
0
votes
1answer
14 views

How do I increase spacing between unit components in pgfplots?

I'm using pgfplots (version 1.12) with the units library. When I create a unit label \si{molecules \cm^{-2}}, this turns up without any spacing between "molecules" and "cm". When I use the same ...
3
votes
1answer
31 views

How to have an ybar plot without frame?

I want to remove the frame around a plot, which usually works well with axis lines = left. However, something strange happens when trying this with ybar. Without axis lines=left With axis ...
4
votes
2answers
24 views

changing y axis values

How do you change the y axis points to letters? Specifically I'm interested in using musical notes in the y axis. This is what I've tried and I received an error. \begin{tikzpicture}[>=latex] ...
2
votes
1answer
49 views

Plots and chapterspecific colors

I have a color switching function that looks like this \definecolor{chap1}{RGB}{68, 114, 148} \definecolor{chap2}{RGB}{10,130,124} \definecolor{chap3}{RGB}{250,72,46} ...
2
votes
0answers
40 views

How to plot multiple plots associated to different colors of a colorbar with pgfplot

I HAVE EDITED THIS THREAD, NEW QUESTION AT THE END First of all, I apologize for my possibly bad English as it is not my mother tongue. My problem is complex but I am going to try to explain it the ...
5
votes
1answer
62 views

Problem with axis when drawing a function plot using PGFplots

Dear TeX StackExchange, I am trying to plot two functions in the same grid. The code I currently have is below: \begin{center} \begin{tikzpicture}[scale=1, transform shape] \begin{axis}[grid=both, ...
1
vote
0answers
42 views

Alternating colors for stacked bar charts

I'm trying to make a stacked bar chart with two bars next to each other with different colors. I've based my code on discarding \addplot commands similar to this question, but even though I'm ...
0
votes
1answer
30 views

Start xtick labels in the first interval using pgfplots

I'm creating a graph with two x axis using pgfplots where one axis represents timesteps and the other iterations within one timestep. So far I have the following code: \begin{tikzpicture} ...
6
votes
2answers
101 views

Tikz figure wit linear inequalities, surfaces and lables (ILP graphically)

I'm creating slides to explain Integer Linear Programming (ILP). What I want to do is show how solve a two dimensional problem graphically. E.g. I have the following problem: Decision variables: ...
6
votes
1answer
70 views

Getting PGFplot to align \draw commands between plots

I am trying to use pgfplots to add slope triangles to several plots on the same axis which look like the following: I thought I was in luck to see parts of this process explained specifically in ...
6
votes
0answers
35 views

PGFplots axis label style not working when `axis lines=center` in axis environment options

When compiling the code \documentclass{standalone} \usepackage{pgfplots}\pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{axis} [ x label ...
3
votes
1answer
44 views

Display explicit plus sign in pgfplots axis

Is there a more elegant way than mine to display explicit plus signs for positive values on the axis of a pgfplots graph? Currently I'm doing xtick={-3,-2,...,+3}, ...
1
vote
1answer
23 views

PGFplots axis legend with multiple columns/rows of different lengths

I have an axis environment in PGFplots with multiple graphs which correspond to certain group of data types. I want to stress this distinction by grouping the legend entries. In particular, using a ...
4
votes
0answers
42 views

Problem with fill between option in pgfplots

I have a problem with fill between option when I try to use it for more than one plot. What I am trying to do is to fill an area between the '+' and '-' errors of a curve. Here is the code: ...
0
votes
0answers
39 views

Pgfplots rounded corners and plot problem - part II

This is a follow-up to question Pgfplots rounded corners and plot problem. When the grid is right on the edge of the plot, it does not bend with the axes. Is it possible to apply bending to the grid ...
2
votes
1answer
45 views

Horizontal alignment of plots (pgfplots)

I have 4 plots generated by pgfplots that I would like vertically and horizontally aligned. They are all included in my main file via \input. Due to memory constraints two of them live in one file ...
3
votes
1answer
40 views

pgfplots: select number of divisions

I'm not stuck to using pgfplots to produce this, so feel free to offer suggestions. For my exam papers, I want to provide the students with blank semi-log grids to do hand plots. (To be specific, ...
4
votes
1answer
63 views

Generating pgfplots legend from gnuplot data

I’m having trouble getting pgfplots to typeset very small numbers, e.g. 6.82e-08. I don’t know if the problem lies in it being a very small number, or if it’s because of the interaction with reading ...
3
votes
1answer
62 views

Calculate xtick positions by formula to mimic plotxx (or plotyy)

Please consider this MWE: \begin{document} \begin{tikzpicture} \begin{axis}[% /pgf/number format/1000 sep={}, % do not delimit per thousand xmin=19, xmax=22.5, xlabel={angle in ...
0
votes
0answers
44 views

Plot data and the mean of each column

I have a data file which looks this: 1 256 2 197 3 190 4 188 5 219 6 169 7 179 8 181 9 182 10 178 where the first column are timesteps and the second column contains the number ...
5
votes
1answer
53 views

Calculations in PGFplots \addplot3 inline table

Plotting a rectangular patch with the code \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} \addplot3[patch,patch ...
5
votes
1answer
70 views

How to add arrows near the plot path and fill the area under this path?

I'd like to draw a closed plot path filled with pattern and surrounded by arrows: When I used @Jake's solution to add arrows (Decorate a path with little arrows parallel to it) then the pattern ...
7
votes
1answer
74 views

Macro for pgfplots/gnuplot exponential regression line

I am trying to create a series of plots with exponential regression that are automatically generated from comma/tab separated .csv files and pgfplots with help from gnuplot. When not using macros I ...
1
vote
2answers
106 views

make parametrised surface graphic with annotated features using Tikz or PGFplots

I'm looking to recreate that image for a LaTeX document. I am a novice at tikz and pgfplots. Please help!
5
votes
1answer
47 views

Creating different coordinates with the same macro

I am creating a 3d image using pgfplots. To specify certain coordinates, I created a macro \newcommand{\setpolarcoord}[4]{ % {Name}{r}{theta}{phi} \pgfmathsetmacro{\tx}{#2*sin(#3)*cos(#4)} ...
5
votes
1answer
78 views

Repeat geometry / body / object / shape in PGFplots

I depicted a pentahedron by means of the code \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset { plotOptsA/.style={surf,patch,patch type=triangle,shader=faceted interp}, ...
2
votes
1answer
42 views

Problems plotting histograms as a line graph?

I would like to plot some percentages as a line graph, so I tried this: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=2.12} \begin{document} \begin{tikzpicture} ...
5
votes
2answers
102 views

Bar graph-PGFPlots

first sorry for my English. I wonder how to make a bar graph like figure. I tried with this code PGFPlots package, but is not good. Someone knows how to do this? \begin{tikzpicture} \begin{axis}[ ...
1
vote
0answers
30 views

Part of surface plot missing

I have created the following plot using pgfplots I'd like to remove the white patches (marked in red). Here's my code \begin{tikzpicture} \begin{axis}[grid = major, grid style={dotted}, ...
1
vote
1answer
27 views

How can I plot error bars on the first and last points in pgfplots?

I have a number of data series to plot with error bars, but since they might overlap in the middle, I'd like to show error bars for only the first and last points. All the data points will have the ...
2
votes
1answer
30 views

Apply same options to multiple `addplot` in pgfplots

Can I apply the same options to all addplot's in a single axis environment in pgfplots? For example: \begin{tikzpicture} \begin{axis} \addplot[%plot 1 color = red, ...
1
vote
1answer
83 views

Plotting a 2D slice of a 3D data set

I am plotting 3D data sets as surface plots, but sometimes I need to show a slice of the surface plot by restricting either the x-value or the y-value. I have provided a MWE, showing The surface ...
2
votes
2answers
36 views

How to make a legend entry image consist of line, pattern and markers in pgfplots

I'm trying to make the legend entry image look like a chunk from the "whole" of the following plot (so it has a line, pattern lines and marker). Is it really possible? I'm after an unsuccessful ...
2
votes
1answer
37 views

Point meta not working for for coordinates plot, example page 186 PGFplots manual Revision 1.12 (2015/01/31)

On page 186 of the PGFplots manual Revision 1.12 (2015/01/31) an example of the use of point meta is given: \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
5
votes
1answer
43 views

Construct colormap for iso / level surface in PGFplots

I am trying to construct a plot of a surface in 3d of which the color of the surface is dependent on the z coordinate. The difficult part is that I need the color to vary 'discretely', not ...
1
vote
0answers
29 views

Pgfplots surface looks “wiry” [duplicate]

I've plotted a function from some values, given in the form: x,y,z -2.4,-2.4,0.00208966369454526 -2.3,-2.4,0.00245568047497186 -2.2,-2.4,0.00284901821144199 -2.1,-2.4,0.00326424484110634 ...
7
votes
1answer
64 views

How to make a figure showing growth of functions but with scaled y-axis in latex?

My problem is I would like to make a figure in LaTeX, which looks like the picture. It's important that the y-axis is scaled in a similar way as the picture. BTW I'm using Windows, MikTeX and ...
0
votes
0answers
30 views

pgfplots won't plot from CSV

I have a file called 'dat.csv' that contains data in the following format: x,y,z -2.4,-2.4,0.00208966369454526 -2.3,-2.4,0.00245568047497186 -2.2,-2.4,0.00284901821144199 ...
3
votes
1answer
88 views

Is it possible to choose the base line of the ycomb?

Is it possible to choose the base line of the ycomb (vertical lines)? For example, in log scale, the default base line is at y=1 (or y=10^0). But I would like to make it at y=0 (i.e. minus infinity). ...
3
votes
1answer
61 views

How to plot this histograms as a line graph?

Let's say I have this histogram plot: \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ symbolic x coords={a small bar,a medium bar,a large bar}, ...
6
votes
2answers
76 views

Help with plotting the following

Bellow is the following code that I currently have, I am just struggling to replicate the graph as accurately as I would like. The actual functions for the graphs are quite complex so i am just trying ...
3
votes
1answer
28 views

pgfplots + gnuplot: how to clean up the look of a contour plot generated from raw gnuplot data by using a colour bar?

Here's a MWE: \documentclass[12pt,letterpaper]{article} \usepackage{lmodern} \usepackage[T1]{fontenc} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.11} \begin{document} ...
5
votes
1answer
58 views

Erroneous depiction by use of `\draw` and `\fill` commands in PGFplots `axis` environment

I am trying to use table data to construct a patch surface plot. In doing so, I use pgf/tikz, pgfplots, pgfplotstable and the command \edef. My code: \documentclass{standalone} \usepackage{amsmath} ...
3
votes
0answers
21 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: ...
2
votes
1answer
42 views

Call to coordinate for creating a patch gives an error

I'm trying to construct a patch in pgfplots by means of table data. In attempting to do so, I also use the \coordinate command. Minimum working example: \documentclass{standalone} ...
4
votes
1answer
57 views

Disabling filling does not work with patches

I want to draw a triangular patch with no filling. Minimum working example: \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} ...
1
vote
0answers
38 views

Importing PDF image with filled surfaces using graphicx [closed]

So I coded up a plot in pgfplots for inclusion in a document and it came out very nice. I've attached what it looks like below straight from the original pgfplots compilation. I generated the filled ...
1
vote
0answers
34 views

Glitches and other problems with pgfplots

I want to draw a rather smooth surface in a 3D graph with pgfplots. 1) It shows however, some glitches (spikes on the smooth surface), which I guess due to some numerical issues in the basic package. ...
2
votes
0answers
68 views

Tips for making a lightweight long document

I wonder what tips should we keep in mind to keep a long document lightweight. I've written 3 chapters from my thesis with ~30 figs and some math, and document size is exponentially increasing (10MB ...