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

Insert border to area under plot part 2

This question builds from the question posted here. How can I get the plot to show up in red in the region between the shaded region like this: Here is the original code: \documentclass{book} \...
2
votes
1answer
193 views

Axis break in pgfplots - same scaling for the two plots

I've found the answer to my question here. Nevertheless I have a related question. The MWE can be exactly the answer to the linked question, so I insert here just the "interested part" (if I have to ...
2
votes
3answers
65 views

How to remove quotes from data for pgfplots

I have a lot of .csv files that I need to plot. However, the numeric data comes, sometimes, among quotes or just as numbers (without the quotes). For example a,b,c,d "1","4","5","1" "2","3","1","5" "...
2
votes
1answer
223 views

Same color for mark and label in scatter plot

I would like to obtain a scatter plot with marks and labels of the same color. I can get colored marks but labels stay stubbornly black: I would like 0's to be blue, 1's to be green etc. in the ...
2
votes
1answer
50 views

PGFPlots cycle list skips first definition after every cycle

I got some problems with self-created cycle lists in PGFPlots. As you can see, the plots skip the first definition of my cycle list after every run through the cycle list. Are there any coding ...
2
votes
1answer
73 views

Pgfplotstable: display numbers exact as written in file

My file is U(V) I(A) I/U 0.00 0.000 0 0.31 0.020 0.065 1.15 0.075 0.065 1.82 0.120 0.0659 2.73 0.178 0.0652 3.42 0.224 0.0655 5.08 0.333 0.0656 6.24 0....
2
votes
1answer
115 views

Give a threshold value to automated ymin and ymax

In pgfplot, is it possible to give the automated scaling of your axis a minimal/maximal value? In other words; I want to have y=0 always on the vertical axis in a way like: ymin=min(0,...
2
votes
1answer
28 views

pgfplots: Accessing the Width of a Diagram and Using it as a Variable for other Widths

I define the width of a plot/diagram using the width key, for example: width = 0.8\textwidth, I also define the width of the title text similar: title style = {text width = 0.7\textwidth}, I am ...
2
votes
1answer
49 views

Anchors on the outer bounding box of a color bar

I have a tikzpicture with two axis environments in the horizontal direction: \documentclass[margin=1cm]{standalone} \usepackage{pgfplots} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture}...
2
votes
1answer
94 views

Subtract area from plot

The color of the 2 areas are added. Instead, I would like each new area to cover the previous ones with the color defined in the description. \begin{tikzpicture}[domain=0.001:160, samples=100] \...
2
votes
1answer
138 views

Two sets of labels on pgfplot bar chart

I'd like another set of hard-coded labels that sit on top, near the bottom (0) of each bar. I.e., like the nodes near coords labels, but shifted down towards 0 and with my own custom text. So in the ...
2
votes
1answer
102 views

Plot a data/Table from Mathematica using `pgfplots`

I use data1 = Table[] in Mathematica 9 (M9) to generate a table of values. The thing is that when I read the data file, there's only one column! How can I plot this data file in LaTeX using pgfplots? ...
2
votes
1answer
99 views

How do I format a range of pgfplotstable columns at once?

I want to set a range of columns (1,2,3 in the MWE below) at once without overwriting the formatting of the first column. Therefore, I don't think an "all" columns solution is applicable. \...
2
votes
1answer
99 views

Math symbols in pgfplotstable

Suppose I have a file numbers.txt, whose contents are x y 1 2 3 4 50 20 I want to put this into a table using pgfplotstable, but while these numbers can change I want an additional ...
2
votes
1answer
183 views

Why aren't NaN-s ingored in pgfplots' axis?

Why doesn't \addplotignore NaNs I used to break columns? MATLAB plot function correctly ignores them, so I think the columns are OK. Moreover in pgfplots doc NaNs are suggested to be used when such ...
2
votes
1answer
81 views

Reduce font in a LaTeX graph

May someone help me to reduce font to \small or \scripsize in may graph here by ? How can I delete the 10^0 and replace it by 1. It is a Log axisb ? Thanks My code is below. I have found a solution ...
2
votes
1answer
63 views

How to control the ticklabel size in TikZ graphics?

Is there any method to control the size of ticklabels in LaTeX when using pgfplots? It seems that the yticks are written in a wrong way LaTeX snippet: \begin{tikzpicture} \begin{axis}[% width=\...
2
votes
1answer
108 views

sketching path on unit simplex

I am trying to simulate a path on the unit simplex, which can be drawn using pgfplots: \documentclass[border=5pt]{standalone} \usepackage{tikz} \usepackage{tikz-3dplot} \begin{document} \...
2
votes
1answer
84 views

Pgfmath misbehaving when reading negative values from table in Pgfplots

I am astonished that when I attempt to square a number read from a table with pgfplots, the result has the same sign. Consider this: \documentclass{standalone} \usepackage{pgfplots} \usepackage{...
2
votes
1answer
82 views

Set origin of y axis to 1

How to set the origin of y axis to 1? Minimal example: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \begin{document} \begin{figure} \centering \begin{tikzpicture} ...
2
votes
2answers
189 views

Tikzpicture: How to caption with multiple axis

Is there a way to caption multiple axes with tikzpicture? I don't want to use subfigures since each axis (and its corresponding figure) is connected via an arrow to another axis. I have something ...
2
votes
1answer
251 views

Use multiple columns as y-axis for a plot pgfplots

I am plotting a set of graphs using pgfplots and I am loading the data from a csv file. The csv file contains the results of a test which has been executed 10 times, and a column showing the average. ...
2
votes
1answer
49 views

plot and fit from pgfplottable

I would like to plot a graph from data created inside pgfplottable. I have one file of data data.dat: x,y 1,2 2,3 3,4 4,5 5,8 6,9 7,34 And this code : \documentclass{beamer} \usepackage{etex} \...
2
votes
1answer
62 views

Plot data in a tabular environment using plgfplot

I have a tabular environment which has two columns representing x and y data. Is there a way for pgfplots to reference the data in that tabular and plot it? Example table: \begin{tabular}{ll} 1 &...
2
votes
1answer
689 views

How can i use the content of the \usepgfplotslibrary{fillbetween} in the LaTeX Code WITHOUT the order: \usepgfplotslibrary{fillbetween}

Hey I have to use LaTeX in Wordpress with the plugin Quicklatex. There is a problem while using the pgfplots package. When I type \usepgfplotslibrary{fillbetween} in the preamble, i get the error: I ...
2
votes
1answer
82 views

pgfplots: locally activating linear scale in a log scale plot

I have the following short example: \documentclass[tikz,10pt]{standalone} \usepackage[utf8]{inputenc} \usepackage{amsmath,amsfonts} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{...
2
votes
2answers
130 views

colour coding of 2-d-data

Imagine the following requirement: There is a rectangular matrix of variable size with integer elements. These data are located in an ascii file. I need to get it into a TikZ graphic (1) where the ...
2
votes
1answer
46 views

PGFplots within Environ format mistake

I try to write an environment for a simple barplot with pgfplots to reduce the needed markup. For that I use the environ package. For some reason tikz complains about a format mistake at the ...
2
votes
1answer
109 views

Help with Help Lines

I am plotting lattice paths to two points. I would like to have help lines drawn on top of the Cartesian plane so that any line that is an integral distance from an axis is a solid line and any line ...
2
votes
1answer
242 views

Different anchors for tick marks

To avoid interfering with the graph, I would like to position -2 with xticklabel style={anchor=north east}, and 2 with xticklabel style={anchor=north west}, within the axis environment. With this ...
2
votes
1answer
239 views

Using math-mode in pgfplots axis unit

I want to apply a unit to my axis. Usually I use the siunitx package for that. However, this time I would like to use a Greek letter with a subscript \mu_\text{B} but my document won't compile. Here ...
2
votes
1answer
201 views

pgfplots: change vertical position of node label in addplot

In the MWE below, how can I change the vertical position of the label associated with the curve? For example, if I wanted to put it below the curve? \documentclass{standalone} \usepackage{tikz} \...
2
votes
1answer
52 views

Duplicate values when writing value near coordinate

I am using this code, taken from my question here. The problem arises when two x values have the same y value. Then the label I want to write near the coordinate overlaps with the other one. How can I ...
2
votes
1answer
215 views

Default tikz arrow style in pgfplots

I'm trying to change the axis arrow style used in pgfplotsto the default one obtained in tikzusing ->, i. e. I've done some research but can't seem to find a way to do that.
2
votes
1answer
102 views

Formatting axis as currency

This may well have been answered somewhere, but I can't find it. It seems very simple, but is eluding me. I have a chart built with pgfplots. \documentclass{article} \usepackage{pgfplots} \begin{...
2
votes
1answer
282 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 tick:...
2
votes
1answer
1k 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 ...
2
votes
1answer
176 views

Fill between on top of axis background

How can I draw the fill between area on top of another fill area that is drawn in the axis background preaction? MWE: \documentclass{article} \usepackage{pgfplots, pgfplotstable} \...
2
votes
1answer
660 views

Make visible node text outside of pgfplot axes range

I'm using matlab2tikz in order to generate pgfplots .tex code to create a figure with pdflatex. The matlab function I'm using to create the figure creates each of it's tickmark labels explicitly, so ...
2
votes
1answer
211 views

PGFPLOTS How to add an extra xtick or vertical line at the correct location?

I am trying to add a vertical line at the coordinate x= 3.5 to illustrate that this is the actual thickness configuration. However the attempt below does not put the tick at the right position on the ...
2
votes
1answer
358 views

How to change font for axes, labels, etc in pgfplots using fontspec (lualatex)?

I need to make figure with Garamond font applied to axes and labels, as well to text in nodes. This is my MWE: \documentclass[12pt]{standalone} \usepackage{tikz} \usepackage{pgfplots} \usepackage{...
2
votes
1answer
377 views

pgfplots: addplot3 color particular planes

using \addplot3 how do you shade in particular planes? e.g., If we consider the unit cube, I want to shade the plane x = 1,y = 1, z = 1. This is all I've got so far: \begin{tikzpicture} \begin{axis}...
2
votes
1answer
141 views

Why do I get a “Dimension is too large” error?

\documentclass{article} \usepackge{pgfplots} \usepackage{tikz} \begin{document} \begin{figure}[H] \centering \resizebox{0.80\textwidth}{!}{% \begin{tikzpicture} \begin{axis}[width=15cm,compat=1.5,...
2
votes
1answer
67 views

Include a table as label in pgfplots

I would like to have as a symbolic x coordinate a tabular. Is this possible? Below is a MWE that has all the required elements. \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{...
2
votes
1answer
124 views

What are the minimum requirements to create a “standalone” installer for pgfplots?

I prefer to use pgfplots for my plotting needs, but I tend to use LaTeX for my documents as well, so I have the full TeX Live installed. I'd like to convince my friends/lab mates/colleagues to use ...
2
votes
1answer
93 views

Conditional \addlegendentry

How can I add legend entries dependent on some variable? At least it does not work in the minimal example below. \documentclass{standalone} \usepackage{tikz,pgfplots} \begin{document} \def\myLegend{...
2
votes
1answer
850 views

What exactly are the 'unsuitable tick labels' mentioned in pgfplots' compatibility warning?

When I use pgfplots, I get the following warning: Package pgfplots Warning: running in backwards compatibility mode (unsuitable tick labels; missing features). Consider writing \pgfplotsset{...
2
votes
1answer
116 views

Inputenc error pgfplotsset

When I try to compile my code throw me an error between inputenc and pgfplots. I compile the following code: \documentclass[11pt]{article} \usepackage{amsmath} \usepackage[utf8]{inputenc} \...
2
votes
1answer
208 views

How to get two data series in tikz plot?

How do I create a second data series from the code below? I have tried separating the two curves with curly brackets but it was not the correct code. \begin{figure}[h!tp] \centering \...
2
votes
1answer
165 views

Axis drawn longer than specified

The y-axis in the following graph is about ten times higher than I want it to be. The graph has a maximum height of 0.5 units. I specify that the y-axis should go up to 2 units. \documentclass[10pt]...