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

How would I specify intervals?

I am new to latex, and would like to plot a graph where the x-axis has intervals. I have this sample code that is not interval: \documentclass{article} \usepackage[margin=0.5in]{geometry} ...
2
votes
1answer
79 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}[ ...
1
vote
1answer
70 views

Remove labels with pgfplots

How to remove extreme labels on each axis ? Why does the shape of the curve is not limited to the upper edge of the grid ? I find that the curve is not very smooth, especially at the apex of the ...
3
votes
1answer
69 views

TikZposter does not work with pgfplots

I can't use axis environment in tikzposter, when I add \usepackage{pgfplots}, I will get: Package pgf Error: Sorry, the requested layer 'backgroundlayer' is not part o f the layer list. Please verify ...
3
votes
1answer
42 views

When using pgfplots, I receive an error of “ Missing { inserted.” when using the fillbetween package. Why does this error show up?

I've been using pgfplots to generate images in my homework for a modelling course. I've been receiving the error below and I can't seem to locate it in my code. Missing character: There is no ; in ...
1
vote
0answers
49 views

tikz - maintain scale while adding plots

I want to superpose some plots like this one, but shifted in the x-axis: \documentclass{article} \usepackage{tikz,pgfplots} \begin{document} \begin{figure} \pgfplotsset{ ...
1
vote
0answers
29 views

real number of my files at tikzpicture

I have a tikzpicture that read 3 data files. The values at Y axis are converted automatically to x10^5. I need to show the exact number of my data files. How do I do that? Thanks. ...
4
votes
1answer
47 views

Speed up plotting data with many columns

I am trying to make some kind of a spaghettiplot and draw all columns from a table with 851 columns (one for the z-coordinate, the rest for a quantity as a function of height), to get something ...
5
votes
1answer
37 views

Why does setting the position of the x label shift the label for this semilogyaxis in pgfplots?

I have two plots with the same line; one is plotted on a standard scale, one is plotted on a semi-log y scale. The second plot has the x-axis label shifted vertically quite substantially. How can I ...
2
votes
1answer
161 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
82 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
0answers
54 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) ...
2
votes
0answers
46 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
35 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 ...
1
vote
1answer
44 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
53 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
51 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
51 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
46 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
44 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
50 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 ...
5
votes
1answer
71 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
87 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
19 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
45 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
44 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
58 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
66 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
83 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
57 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
40 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
127 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
77 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
54 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
52 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
45 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 ...
6
votes
1answer
80 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. Here is the code: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.10} ...
0
votes
0answers
53 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
52 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
47 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
82 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
70 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 ...
2
votes
0answers
70 views

Plot data and the mean of each column

I have a data file which looks like 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 ...
5
votes
1answer
72 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
79 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
94 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
119 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
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)} ...
5
votes
1answer
83 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
45 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} ...