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

x-axis values are very close to each other

For the MWE below: \documentclass{report} \usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage[T1]{fontenc} \usepackage{pgfplots} \begin{document} \begin{figure}[H] ...
2
votes
1answer
473 views

PgfPlots duplicate x-axis labels

I have some repeated numbers on my X-Axis. Here is my code- \begin{tikzpicture} \pgfplotstableread{Figures/measurements.dat} \datatable \begin{axis}[symbolic x ...
2
votes
1answer
596 views

Automatic data recognition and plot processing in pgfplots

I am a beginner in LaTeX, trying to use it for industrial documents, such a measurements report. One example is the true position graph of the MWE. The circle represents the true position tolerance. ...
2
votes
1answer
629 views

conditional inside a pgfplotsinvokeforeach loop

I'm using \pgfplotsinvokeforeach to do mathematical computations inside the \addplot options. Now I need a conditional to decide whether to plot a line or not depending on the current index of the ...
2
votes
1answer
640 views

pgfplots spline and colorseries do not work

I want to create a plot with predefined colors and have the points connected by a spline curve. Both things do not happen. The color series is not applied (all lines are black) and a spline is not ...
2
votes
1answer
578 views

How to order barplots in aligned rows and columns?

I am making xbar plots with pgfplots. Within different age groups ("Agen interval") of men a single winner is choosen (Winner), based on some test, and on this winner two different variables are ...
2
votes
1answer
307 views

pgfplots: externalization and ifthen

I use pgfplots with externalization. When I try to include a macro that uses \ifthenelse, always the 'else' statement is being executed. When I switch off externalization, it works again. See this ...
2
votes
1answer
684 views

pgfplots hand-made legend (\label + \ref) fails with custom styles

In pgfplots, when I use a custom style to plot a line, \label the line and then \ref to this plot, I am unable to get the desired result. The desired result would be to get a little line where I am ...
2
votes
1answer
2k views

Drawing Vertical Arrows in Coordinate System Using Pgfplot

I have a series of data plots, an example of which is depicted below, and I would like to draw a vertical line through a particular x-coordinate on each plot, so that the head of the arrow is is ...
2
votes
1answer
3k views

usepgfplotslibrary - undefined control sequence

I have problem with following example code: %& --shell-escape --enable-write-18 \documentclass[a4paper,10pt]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{polski} ...
2
votes
1answer
28 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
31 views

How can I add/translate points in axis cs?

I don't seem to have a problem placing a coordinate in the axis coordinate system, and translating in the x direction seems to work as expected also. But as soon as I try to translate in the y ...
2
votes
1answer
46 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} ...
2
votes
1answer
47 views

How to plot with tikz without graduations in the axis?

I'm trying to plot a function with tikz and let the plot as clean as possible, but I can't remove the lines along the axis. Can anyone help with this? \begin{tikzpicture} \begin{axis}[ axis ...
2
votes
1answer
41 views

aligning plots in pgf plots and a couple other associated questions

I am fumbling my way through pgfplots. I have 3 plots on a page. I have a few issues: The bars in the plots are floating above the axes to various degrees. How do I anchor the bars down to the axis? ...
2
votes
1answer
82 views

A triangle not being plotted

I have the code for a triangle on the Cartesian plane. There seems to be two commands that TikZ is not able to compile. The first line is \addplot[samples=501,dashed,domain=1:3] {3,x}; which should ...
2
votes
1answer
41 views

PGFPlot equally spaced coordinates

how can i make the plot that the provided x-coordinates are separated visually with the same distance. So instead of 0 500 1000 1500 2000 there should be 0 10 20 50 100 200 ... and the second thing ...
2
votes
1answer
66 views

How to make Loop?

I need to make for loop analog in LaTeX. My code has following form \documentclass[9pt]{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture}[scale=1.2, font=\tiny] ...
2
votes
1answer
51 views

Only one xlabel for matrix of plots in pgfplots

I am looking for a way to make only one xlabel for a matrix of plots with pgfplots. My current plot looks like this and would like a xlabel where the red circle is drawn. The code for the plot is ...
2
votes
1answer
83 views

pgfplots : Row title in legend

I would like to add a title to each row of my legend in pgfplots. I achieved this with this example : \documentclass{article} \usepackage[pdftex, active, floats, tightpage]{preview} ...
2
votes
1answer
82 views

Linear Regression with symbolic x-coordinates

I have been having difficulty with this problem for a few days now so I'm hoping you can come to my aid. I am trying to create a line of linear regression for a very small chart using pgfplots. ...
2
votes
1answer
47 views

pgfplots is skipping first ytickslabel from file

Rendering the MWE below pgfplots skips the first 'Adiff' label of the CSV. I'm sure this is a no-brainer and easy karma points for experienced pgfplots users, but I am stomped. ...
2
votes
1answer
51 views

Label faceted surf in pgfplots

I have a series of X,Y,Z points and like to create a discrete surf plot and label each point. I am using \addplot3[surf...] to generate the plot but I can't figure out how to label the colors. I don' ...
2
votes
1answer
62 views

pgfplots: Why does samples quantity has such effect on the shape of the plot?

By varying the value of the samples in drawing such plot in pgfplots, the shape of the plots changes so much; is it because of some instability in drawing plots or the function has such behaviour? ...
2
votes
1answer
91 views

PGFPLOTS: How To Put \addplot boxplot prepared Inside Macro Definition

I have a need to wrap the `\addplot [boxplot prepared]' inside a macro to greatly save typing. It seems simple enough, but the devil is in the details with macro expansion issues. Is this doable given ...
2
votes
1answer
120 views

How to deal with large numbers in chart axis labels

I am using pgfplots to visualize my experimental results, but some of the experimental results have very large numbers ($10^18-10^19$ for example). The way pgfplots deals with them is that, it puts a ...
2
votes
1answer
87 views

Fix group bar chart spacing

Consider the following MWE \documentclass[tikz]{standalone} \usepackage{lmodern} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepackage{pgfplotstable} \begin{document} ...
2
votes
1answer
54 views

Is it possible to plot non-numerical data alongside normal data in a normal plot?

I'd like to try and plot non-numerical data to indicate some information for the usual numerical data. The former would then help understand the latter. So in the MWE, it is only one column of extra ...
2
votes
1answer
99 views

fillbetween from pgfplots does not work inside groupplots

MWE: \documentclass{article} \usepackage{pgfplots} \usepackage{pgfplotstable} \pgfplotsset{compat=newest} \usepgfplotslibrary{groupplots} \usepgfplotslibrary{fillbetween} \usepackage{filecontents} ...
2
votes
1answer
70 views

“Dimension too large” while working with serial date numbers

I export plots using matlab2tikz and pgfplots from MATLAB to TeX. Most of my plots contain "serial date numbers", which are the days since January 0, 0000. As you can guess, the numbers get quite ...
2
votes
1answer
161 views

How can I renew /pgfplots/xmin (and the other 3 values) after a coordinate transformation?

I use "hybrid" coordinates made out of \ymin and raw x- and y-values. It's pretty comfortable to use, thanks to Gonzalo: \newcommand{\getpgfkey}[1]{\pgfkeysvalueof{/pgfplots/#1}} ...
2
votes
1answer
179 views

Half filled circle marker

How can I draw a half filled circle on my axis. I would like the marker to be at the origin and be filled on the left half of the circle. \documentclass[12pt,]{article} \usepackage{graphicx} ...
2
votes
1answer
118 views

axis alignment for 3D graph using matlab2tikz

I am trying to include multiple 3D figures (created in matlab) into a latex file. The original 3D figures in matlab look like this: In the .m file that creates these figures, I use ...
2
votes
1answer
216 views

Contour plot using pgfplots where some data entries are NaN

I would like to make a contour plot of data that has been saved in a text file that consists of three columns where the columns are x_i, y_i and z_i and some elements z_i are NaN. I use MikTex 2.9 ...
2
votes
2answers
107 views

Plotting standard error

I am trying to create a chart with the std error but I can't seem to get it to work the way I want it to. I want to get rid of the line between every entry. This is what I have right now: ...
2
votes
1answer
313 views

x tick label style issue, anchor=east and text width command not working together

I have a figure where one of my labels is very long. I would like this label to be split to two rows. Currently my code is like this \documentclass{article} \usepackage{pgfplots} ...
2
votes
1answer
105 views

pgfplots - How can I fill the background to a “node near a coordinate”?

I'd like to have the nodes/values for each plot fill with white, so the grids get overdrawn, so to speak. Is this possible? (Note: I only activated the major grid for x for the sake of the thread.) ...
2
votes
1answer
91 views

Pgfplot won't compile more than 6 curves on the same plot

I want to plot with pgfplots 12 curves on the same plot. The curves are given by 12 csv tables named "curve_01","curve_02" etc., about 3000 points each. To reduce computational time I reduce the ...
2
votes
1answer
147 views

Logarithmic y-scale with zero bin value

I have some trouble with an histogram filling when I plot it with ymode=log. Here is a MWE \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ ...
2
votes
1answer
246 views

Axis tick options, ticks and labels inside axis area

I know the title can be misleading, but I don't know how to put it better. I will correct it when I get better proposals. I try drawing plots from external tables with pgfplots. Alas, the template I ...
2
votes
2answers
300 views

doing 3x3 subplots with the colorbar located northside

I wanted to have my nine (2d) matlab plots shown as 3x3 subplots in latex with the colorbar located northside. I have no idea how to do this especially that I have the colorbar saved separately from ...
2
votes
1answer
84 views

Pgfplots, Units and “Modify Number Data Scale”

I've got a question with tikzpicture in LaTeX. Data of Tikzpicture are in a external file. The y-axis scale is like: 100,000 - 150,000... (thousands). I need to put the scale of this axis like 100 - ...
2
votes
1answer
103 views

log scale plot and filter not interacting well in pgfplots

It looks like when I try to scale coordinate data in a pgfplots, I cannot do it in log scale simply, since the expression filter seems to be applied to the final point and not the table value. For ...
2
votes
1answer
333 views

Engineering notation (scientific) as tick labels with pgfplots (maybe via siunitx)?

I would like to have numbers on the ticks labels formatted in engineering notation -- but unlike in How to control pgfplots axis scaling for engineering notation (multiple of 3 exponent)?, I would ...
2
votes
1answer
119 views

Plot not plotted with pgfplots' \nextgroupplot and discontinuities?

I'm trying to do Multiple axis discontinuities with pgfplots, and so based on Axis break in pgfplots, I produced this MWE: \documentclass{article} \usepackage{calc} %\widthof \usepackage{pgfplots} ...
2
votes
1answer
73 views

What is the overflow limit for a named path in tikz / pgfplots?

I asked this question FillBetween library sometimes works and sometimes does not which led to this answer and discussion http://tex.stackexchange.com/a/180926/6908. There seems to be a limit of data ...
2
votes
1answer
211 views

Conditional alignment of labels in pgfplots bar chart

I'm trying to make a bar chart with pgfplots. I'd like the labels to be plotted inside the bars, except when there is not enough space. In that case the label should be shown next to the bar. I've ...
2
votes
1answer
645 views

Problem with xticks when importing Matlab figures using matlab2tikz

When importing the following figure using the Matlab2Tikz, I obtain the following output , with the xticks strangely exported . Does any one have an idea how I can prevent this? Maybe by passing ...
2
votes
1answer
168 views

How to programmatically coax pgfplots to recognize nan within surface as matlab does

I came across this post after wondering why nan's did not appear to be handled by pgfplots as they are by matlab when working with the matlab pcolor function. My typical workflow in this context is: ...
2
votes
1answer
167 views

How to plot stacked bar plot inside table?

I have following code in Latex. Which plots only one data series (data2). I would like to plot staked bar plot inside table for both data1 and data2 with different colours. Any ideas.? Many thanks. ...