{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

4
votes
1answer
41 views

How to group 2 by 2 style this plot?

I have the following plot that say something about performance: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.12} \begin{document} \begin{tikzpicture} \begin{axis}[legend ...
4
votes
1answer
30 views

tikz: \pgfkeysvalueof and text color!

This tikz code automatically output a node with the y value on the plot... However, how can I colour the text black ??? (now it's blue) \definecolor{mycolor1}{rgb}{0.20810,0.16630,0.52920}% ...
2
votes
1answer
30 views

Show only every n-th xtick label when using 'x tick label as interval'

This question results from the same problem I asked here. Now, I have to many data points to give every single one a tick label. For one axis (the one on the bottom) I could achieve what I want. But ...
3
votes
1answer
36 views

drawing line between plotted points

How do you have the line draw between points that have been plotted on a graph? Here's what I've done so far. \begin{tikzpicture}[>=latex] \centering \begin{axis}[ axis x line=center, axis y ...
4
votes
1answer
42 views

pgfplots - How to specify default line widths for plots and marker?

I would like to specify different default line widths for plots and for markers (like x-marker). For the plot line width, I use: \pgfplotsset{every axis plot/.append style={line width=1pt}} Yet, ...
6
votes
1answer
64 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 obtained from Concorde. He was writing a ...
0
votes
1answer
16 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
37 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
27 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
53 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
47 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
72 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
47 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
35 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
111 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
38 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
25 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
43 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
41 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
46 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
42 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
66 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
46 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
55 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
71 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
75 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
107 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
44 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
105 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
28 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
84 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
31 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
63 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
31 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: ...