{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

3
votes
1answer
698 views

Alignment of several pgfplots of different widths inside subfigures

I try to fit six pgfplots created with matlab2tikz onto a page by placing them inside subfigures. So my document looks something like this: \documentclass[a4paper,11pt, BCOR=12mm, ...
3
votes
1answer
84 views

place 'axis' at specific coordinates

Is there any way to put axis environment at specific coordinates? For example if I want the function plot to be a secondary part of a big tikzpicture. This is a MWE: \documentclass{standalone} ...
3
votes
1answer
270 views

plot pgfplots graph similar to facet_wrap from ggplot2

I need to plot a 2x2 grid of graphs as shown below: Note: The above graph was generated using the ggplot2 library from the statistical programming language R. Graph taken from link. Here are the ...
3
votes
1answer
285 views

How to define optional arguments for custom pgfplots style

I see from other question that it is possible to create styles with parameters. Like \pgfplotsset{ custom style/.style 2 args{ % code that uses #1 and #2 } } However, I can't find a way of ...
3
votes
1answer
362 views

tick mark separation

My graphs have two ticks on the x-axis. I'd like to have 3 graphs across a page and include y-axis labels. Right now that wont fit. Is it possible to move the x-tick marks closer together so the ...
3
votes
1answer
75 views

How to put legend graphic representation to the right of the label

All the pgfplots examples I could find have the graphic (e.g. symbol) to the left of the label (see example below) in the legend. I think this default is very good but due to space constrains I have ...
3
votes
1answer
77 views

Access label, title in pgpfplots

I would like to know if is possible to access the standard nodes in pgfplots such as ylabel, xlabel, title. I am pretty sure this is quite easy, since each node should have a name by which it can be ...
3
votes
1answer
385 views

pgfplots plot marks vanish when I change colors

I have created two overlapping plots (thanks to Drawing curves and multiple y-axes in one plot with pgfplots): When I change the color in the second one, the plot marks vanish: Here's my MWE: ...
3
votes
1answer
86 views

Too much transparancy in pgfplots

I try to embed pngs including transparancy into pgfplots. The problem is, that the transparancy is only around the main object of the png. However, as demonstrated by the MWE, it seems also to affect ...
3
votes
2answers
191 views

alignment of pgfplot's figures

I'm trying to put to put 2 graphs aligned, here is my MWE: \documentclass[11pt, letterpaper]{article} \usepackage{pgfplots} \usepackage{tikz} \usepackage{caption} \usepackage{subcaption} ...
3
votes
1answer
506 views

How to increase numbers precision in TikZ histogram

I entered fixed point numbers in the following code: \begin{tikzpicture} \centering \begin{axis}[xbar,bar width=0.2cm,legend style={at={(0.5,-0.15)}, xmin=0,xmax=0.8,anchor=north,legend ...
3
votes
1answer
708 views

Align plots in pgfplots

Can somebody help me? I try to align two plots horizontally in pgfplots! In the preamble I have: MWE* \documentclass[12pt]{article} \usepackage{pgfplots,subcaption} \pgfplotsset{ compat=1.7, ...
3
votes
1answer
1k views

pgfplots - Number above one of the bars in the bar chart

I want to put a number above only one of the bars in the bar chart. For example, above the bar A, I want to put a number say 200. Other bars will not have any number at the top. This is my code. ...
3
votes
1answer
306 views

What does error bars/.cd do?

In pgfplots, if you want error bars, you have to write error bars/.cd into each addplot that should have error bars. What does it mean and what does it do and why do I need it?
3
votes
1answer
206 views

Shift y labels, stop y labels being dropped

I have a const plot with intervals on the y-axis. I'd like my y labels to be centered in each bar, as it would be if this were an xbar interval graph. Also, and more importantly, I'd like more ...
3
votes
1answer
135 views

One pgfplot per page in single PDF file

I'd like to reduce my redundancy when making plots with pgfplots. I want to have a single PDF file, such that I can include them on a per-page basis with graphicx. The multi class option for the ...
3
votes
1answer
165 views

How can I fix the formatting of my axis using pgfplots so the axis titles aren't on top of the numbers?

How can I offset my ylabel so it doesn't smudge with the numbers? code \begin{figure}[H] \centering \begin{tikzpicture} \begin{axis}[ scale=1.8, xmin=-15,xmax=15,xlabel={Current $mA$}, ...
3
votes
1answer
4k views

Dashed Line with marker when adding plot from table

In the pgfplot, I would like to have a line plot from a table which is read from a .csv file. I would like to have a line which is dashed and has a marker. I put the code like this - \addplot ...
3
votes
1answer
415 views

pgfplots: drawing areas from a table starting “above” an axis

Please let me explain the motivation behind this a bit more broadly. I'd like to draw measured benchmark values as follows: background/nothing between the x-axis and the minimum value a green area ...
3
votes
1answer
819 views

How to draw a dashed line with *-mark + error marks + a line in foreground in the same plot with pgfplots?

I create a plot with pgfplots with the following code: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.6} \begin{filecontents}{ExampleData.txt} xValue1 ...
3
votes
1answer
189 views

Why do I get an incorrect graph when I plot a function with multiplication expressed by parentheses?

When plotting certain expressions with pgfplots it seems to give the wrong result. Consider the following \documentclass{article} \usepackage{pgfplots} \pgfplotsset{ compat=1.7, no marks } ...
3
votes
1answer
805 views

pgfplots: scatter plot with interpolation

Today I have a question about scatter plots: Is it possible to interpolate scatter plots? In my work I often use "intensity plots" (that's how we call them). In these plots x and y are positions, ...
3
votes
1answer
900 views

Properly squish a pgfplot bar chart

I am trying to make a bar chart with the following lengthy data: Character X-Position Probability space 1 0.18211 e 2 0.10083 t 3 0.07298 h 4 0.06721 a 5 0.05862 o 6 ...
3
votes
1answer
1k views

TikZ: bars width and size of plot

This is a followup on my previous question. I have tried to plot my data and I see the following now. Would it be possible to define the size of the area that is used for the plot? I have tried to ...
3
votes
1answer
434 views

PGFPlots staggered axis

Why in this plot the axis are all staggered ? \documentclass[12pt,% % corpo del font principale a4paper,% % carta A4 % ...
3
votes
1answer
187 views

pass a set of numbers to pgfplotsinvokeforeach <list>

Is it possible to pass a numeric set to the list argument of the \pgfplotsinvokeforeach command? I need something like this: \newcommand{\a}{1,2,...,10} \pgfplotsinvokeforeach{\a} {<...>} ...
3
votes
1answer
770 views

Filling path in pgfplot and pushing into background?

I'm using pgfplots to produce a plot of a closed path in the x-y plane. For reasons that are not important here, I would like to fill the closed path. That works fine, but the axes are then hidden by ...
3
votes
1answer
820 views

How to get the domain for the line of best fit w/pgfplots to be all real numbers?

Although I already worked around this problem by finding the x-intercept with the linear regression equation I calculated w/gnuplot, I'm still curious to know how pgfplots can do it without me ...
3
votes
1answer
2k views

smooth surface plot with pgfplots/gnuplot

i want to create a smooth surface plot with pgf-plots and gnuplot. The following code yields a graph, but i need much more gridpoints along y-direction. How can i reach this? The increase of samples ...
3
votes
1answer
708 views

How to make pgfplots to center a text in a xticklabel

In pgfplots I've used the text width option in the definition of xticklabel style and I wonder how to center the labels text?
3
votes
1answer
608 views

How can I create an angled grid in a 2D PGFPlots plot?

Is it possible to make PGFPlots display 45° height lines in an axis? Basically, what I am looking for is a grid defined by y=-x + k*1000, k being a natural number. My numbers are rather large, e.g. y ...
3
votes
1answer
30 views

pgfplot - remove “top-border-line” and spacing between x-axis and bars

I am currently trying to create a bar chart using pgfplots. My objective is to create a bar chart in which the bars are directly "sitting on top" of the x-axis AND there should be no ...
3
votes
1answer
40 views

Edge thickness of the faces in a surface plot

Is it possible to change the drawing thickness of the edges of the faces in a surface plot in PGFplots? For example, in the minimum working example \documentclass[margin=1cm]{standalone} ...
3
votes
1answer
39 views

pgfplots' fill between with wrong segment split

I want the last segment to be white, but it seems that the last segment is combined with the previous segment. \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} ...
3
votes
1answer
33 views

Using named nodes as pgfplots coordinates

Is it possible to use named nodes as coordinates in an \addplot command? I am trying to plot a line through the averages of a number of boxplots calculated by pgfplots (rather than using boxplot ...
3
votes
1answer
79 views

Drawing and labeling angles in an axis environment

I am curious about the misinterpretation of TikZ commands to draw and label an angle in an axis environment. If, in the following code, I have $\theta$ drawn using the commands, \draw[draw=blue] (A) ...
3
votes
1answer
42 views

pgfplots: replace scatter markers with custom text

I'm wondering if it's possible using pgfplot to plot a 3D scatter plot with lines between each point where the point is replaced with a value. Image is shown below. Currently I am populating the ...
3
votes
2answers
47 views

Bar plot in pgfplots using a palette using only fill

I am trying to create some nice looking bar plots, but this does not seem to be an easy task for me :) I have started out with the following: \begin{tikzpicture} \begin{axis}[ xbar, xmin=0, ...
3
votes
1answer
57 views

Drawing piecewise linear plots with pgfplots

I'd like to draw something like the following (which was done in Mathematica) in pgfplots, but I can't find a way to define a piecewise linear function and have pgfplots get the full and empty circles ...
3
votes
1answer
61 views

Some modifications for a display showing graphs of a function and its inverse

I have a display of the graphs of an exponential function and its inverse. I would like two slight modifications. I do not want the line passing through (0,15) and (15,0) plotted. I used line width ...
3
votes
1answer
65 views

Adding a trend line to a bar chart

I'm very new to LaTeX, preparing my very first document in the environment and learning on the way. I've encountered a problem with one of my plots - I'm trying to add a trend line to a bar chart to ...
3
votes
1answer
61 views

Runaway argument using int() function in pgfplots

The MWE below yields Runaway argument? 3\pgfflt@EOI \ifpgfmathfloatparsenumberpendingperiod \pgfmathfloat@a@Mtok \ETC. ./TeX-SE.tex:29: Paragraph ended before \pgfflt@readlowlevelfloat was complete. ...
3
votes
1answer
104 views

Plots large number of data

As you all know, TikZ has to face the limits in terms of memory, that is given by the TeX compiler. For most of my plots, I have a maximum time step of around 1us and I record several waveforms over ...
3
votes
1answer
90 views

How to project nodes created by relative position on curve to axis and below?

In case I have two curves created with pgfplots I can draw a line between two relatively positioned nodes on each. In this example there is an arrow between the points at 50% of each curve. ...
3
votes
1answer
72 views

Using a character as mark in pgfplots

I have a scatter plot in pgfplots which shows dots in 4 different colors belonging to 4 different sources. I would like to use a character (e.g., "A") instead of a circle as the marker. For instance, ...
3
votes
1answer
55 views

Add nodes with pgfplots

I was trying to add nodes inside axis environment but nothing came out. I actually tried several ways... Any help is much appreciated. \documentclass[11 pt, a4paper]{article} ...
3
votes
1answer
162 views

How to draw and label a vertical line from datapoint to x-axis in pgfplots

I have the following figure that consists of only four different values of $x$. Each of these $x$ values corresponds to a certain dataset and I need to label it in the figure. Therefore, I want to ...
3
votes
1answer
84 views

Adding nodes to line segments

\documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \usepackage[active,float]{preview} \usetikzlibrary{calc} ...
3
votes
1answer
84 views

pgfplots conditional data filtering

I'm wondering if there's a way to filter data points within the \addplot arguments. I have a data set (see MWE below) whose values correspond to one of three conditions (C). I'd like to be able to ...
3
votes
1answer
75 views

Why are my symbolic x coordinate labels printed twice in a tikz plot?

I'm trying to plot a bar graph, using symbolic x coordinates. For some reason, the name of some symbolic coordinates appears under the x axis more than once. If I increase the width (e.g. 12cm) ...