{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

0
votes
0answers
27 views

Bar graphs with tikz scientific axies=clean

I really like theaxis generated by tikz datavisualization with scientific axis=clean. However I can not find a bar graph visualizer in the documentation. Does such a visualizer exist? Or (even better) ...
0
votes
0answers
14 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, ...
1
vote
0answers
36 views

How to add a zoombox effect to different images?

According to link it is possible to create magnified subfigures and corresponding boxes for portions of a large image like this one: I would like obtain the same effect but with different ...
1
vote
1answer
25 views

Individual tick label style depending on position

I'm looking for a solution to restrict tick labels to be within the axis limits (see figure, without enlarging limits). The idea was to apply a custom tick label style for example to the first ...
2
votes
0answers
36 views

Problem with pgfplot

I'm trying to use the template that can be found here https://github.com/matze/mtheme but I'm running into a problem which I can't resolve. The error message says; I can't find file ...
1
vote
1answer
28 views

Get x and y labels for tikzpicture

I have plotted a scatter diagram with pgfplots: With this code: \begin{figure}[H] \centering \begin{tikzpicture} \pgfplotsset{ticks=none} \begin{axis}[ymin=0, ymax=10.5, ...
1
vote
0answers
32 views

Error in TikZ pgfplots that previously compiled

I'm trying to compile the following code with no luck. The odd thing is that it was working and then suddenly it is no more working (I edited something in the document and upgrade CSV files, but this ...
2
votes
1answer
35 views

How to avoid that stacked bars overlaps error bars?

I have a stacked bar chart with error bars that sometimes dips below the top part, which hides the remaining part of the error bar. (see both blue and red for x=5 and the red for all others). I want ...
4
votes
1answer
47 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
38 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}% ...
5
votes
1answer
101 views

PGFPlots only have one 0 at the origin

When I create a figure using tikzpicture, tikz adds two 0's at the origin for a plot (one for the x-axis and another for the y-axis). I think it looks cleaner to only have one zero at the origin. I ...
2
votes
1answer
33 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 ...
4
votes
1answer
48 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, ...
3
votes
1answer
40 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 ...
6
votes
1answer
66 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 ...
3
votes
1answer
38 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 ...
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 ...
2
votes
1answer
54 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} ...
4
votes
2answers
29 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
0answers
50 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 ...
6
votes
2answers
114 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: ...
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
2answers
110 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!
1
vote
0answers
48 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
36 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
1answer
7k views

How to configure axis on pgfplots?

How to configure axis on pgfplots? Similar for this. \documentclass{article} \usepackage{tikz,pgfplots} \pagestyle{empty} \begin{document} \begin{tikzpicture}[>=latex] %x axis \draw[->] (-5,0) ...
6
votes
1answer
84 views

How can I reduce the memory required for following example (nested ‘for’ loops)

I want to plot a convolution of two spectra. The first one is a weighted dirac comb, the second a defined function. To do this I used two nested for loops but the calculation exceed the Tex capacity ...
4
votes
1answer
81 views

pgfplots complains path is empty

I'm trying to fill an area under a curve drew with pgfplots. I've tried the solution outlined in this answer: \documentclass{article} \usepackage{amsmath} \usepackage[usenames,dvipsnames]{xcolor} ...
6
votes
1answer
71 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 ...
3
votes
1answer
45 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}, ...
6
votes
0answers
39 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 ...
1
vote
1answer
29 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
46 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: ...
2
votes
1answer
47 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 ...
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 ...
3
votes
1answer
43 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, ...
2
votes
1answer
53 views

Pgfplots rounded corners and plot problem

I noticed something strange recently when trying to use rounded corners in pgfplots: it totally ruins the plot. See below without rounded corners: and then with rounded corners: Here is a ...
4
votes
1answer
68 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 ...
5
votes
1answer
60 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 ...
3
votes
1answer
63 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
72 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 ...
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}, ...
5
votes
1answer
48 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)} ...
7
votes
1answer
76 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 ...
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
106 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}[ ...
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 ...
1
vote
0answers
31 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
30 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 ...