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

ticks disappearing for diverging (out of range) plots

my xticks disappear for some plots even though I explicitly ask for them. Here is my MWE. The function goes to -infinity at the right border of the interval. \documentclass{article} ...
2
votes
1answer
887 views

pgfplots and log scale: bars starting from the bottom of the screeen

The following MWE \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ybar,ymode = log] \addplot coordinates{ (1,1e-15) (2,1e-14) ...
2
votes
1answer
391 views

pgfplots: fill the volume under a 3d surface

I have a very simple 3d graph. \begin{tikzpicture} \begin{axis}[view={60}{20}, %axis equal image=true, xlabel=$X(T)$, ylabel={$D(T)$}, zlabel={$V(T)$}, zmin=0 ] \addplot3[surf,shader=flat,z ...
2
votes
1answer
1k views

Minor ticks not showing when using matlab2tikz

I am using matlab2tikz to import MATLAB figures into TeX. However I can't seem to get the x or y minor ticks to show in the document compiled by TeX. The MATLAB figure I have converted to .tikz have ...
2
votes
1answer
183 views

\pgfcalendar@datetojulian error when plotting a time series using pgfplots

I am trying to plot a hyetogram (hourly precipitation vs time, or column 10 vs column 1 in my data file) with data downloaded from a WUnderground weather station. The time column seems to be properly ...
2
votes
1answer
727 views

pgfplots: how to fix axis length?

I used ymin=0 and ymax=1000 to give axis the length I want. The problem is that if I have some "crazy" data that escape (I have to plot stable solution vs. unstable solution of my algorithm), pgfplots ...
2
votes
1answer
400 views

Error when using pgfplots and beamerposter

I'm trying to create a poster presentation using beamerposter, and it refuses to compile when I insert my pgfplots plot. I get the following error message ! TeX capacity exceeded, sorry [input stack ...
2
votes
1answer
505 views

pgfplots: x-axes do not align due to different labels

This is my first post, so I hope I do everything right :) I have the following problem: Using pgfplots I create two graphs next to each other which have identical y-axes, but different x-axes. I want ...
2
votes
1answer
286 views

How to use listings inside pgfplots captions?

I need to add a (general) listings code in a plot caption. For some reason listings (inline) doesn't interact well with \addlegendentry, what can I do to make the same code work outside and inside an ...
2
votes
1answer
505 views

pgfplot barchart moving x-axis up

For the MWE below: \documentclass{report} \usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage[T1]{fontenc} \usepackage{tikz,pgf} \usepackage{pgfplots} \usepackage{slashbox} ...
2
votes
1answer
325 views

pgfplots: how to check if addplot filters all data

is there an easy way to check if a \addplot(+) table [...] command in PGFPLOTS has any drawn any points? The reason is that I want to process the data dynamically, and if the plot is empty, the legend ...
2
votes
1answer
300 views

matlab2tikz for binary matlab figures

How do you properly use matlab2tikz for binary MATLAB figures? The figures are only black and white and when trying to generate the .tex file I get the error: Input argument 'color' is not a scalar. ...
2
votes
1answer
700 views

Consistently specify function to be graphed with or without gnuplot

I would like to be able to specify a function and then graph that with with pgfplot only, or use gnuplot to compute the coordinates. As far as I know there are two main differences in how the ...
2
votes
1answer
1k views

Tikz Axis bounding box does not align with other bounding boxes. What can I do?

I want to place a lot of pictures and plots in a long document. By now, I am using figure-environment with center-environment, but the tikz-axis-plots didn't align well with included eps-pictures or ...
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
599 views

how to use \insert{_file_} to include tikz \draw command?

I'm using Stata to run some simultions, and my data change every time I run my do file. My data have a discontinuity that changes with each run and I'd like a curly brace that reflects the size of ...
2
votes
1answer
1k views

Regarding bar chart with text as x axis labels

I have seen the previous posts regarding "bar chart with text as x axis labels". I tried to use the same code discussed in the posts and in the documentation, \begin{tikzpicture} ...
2
votes
1answer
47 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
2answers
50 views

Bar chart using pgfplots with both positive and negative bars

I am trying to create a bar chart with both positive and negative stacked bars. However, my negative bar doesn't appear/it is hidden behind the positive bars. How should I change the settings to make ...
2
votes
1answer
57 views

yticklabels Problems

I'm going to draw a certain function from a .txt file. I'd like to specify/to highlight a point of that function on the function itself by a marker and a label. Moreover, I'd like to put a notch on ...
2
votes
1answer
76 views

pgfplots legend nested in matrix

I'm using a \matrix to arrange subplots, each created using pgfplots. When I tried to use \legend to add a legend to individual plots, lualatex tells me Package pgf Error: You cannot nest ...
2
votes
1answer
63 views

pgfplots: frame not closed for surface plot

If you compile this MWE you will find that the frame for the 2d plot is closed, but for the contour plot, which is a 3d plot, not. Both figures are taken from the examples from the pgfplots manual. ...
2
votes
1answer
54 views

Create a new pgfplotstable that is a subset of another pgfplotstable

I'm using pgfplots to plot a data set, and I want to add a local regression line for a subset of the data. I'm able to calculate the regression line and plot if for the subset, but pgfplots is still ...
2
votes
1answer
65 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
62 views

How to change the color of extra grid lines according to the extra tick color

My problem is similar to the one described in Is it possible to assign to two extra x-tick labels different colors?, so I just took the code from there. Additionaly to the different colors of the ...
2
votes
1answer
127 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
130 views

Is there a reliable way to define the scale label's position in a groupplot in relation to the respective label?

I was asked to try and put the scale labels for the yticks not right above the north west corner of the plot as it is rather unusual. Personally, I tend to agree. It works easily but above left might ...
2
votes
1answer
214 views

Miktex 2.9 pgfplots, circuitikz library collision problem

In my book, I use both libraries. After Miktex update yesterday evening (circuitikz ver 0.3 pgfplots 1.11), I have problem with compiling following code: \documentclass{article} \usepackage{tikz} ...
2
votes
1answer
49 views

Gap at origin when using axis lines*=left in conjunction with line width spec via axis line style

Please forgive the strange graph displayed here - I am simply trying to display a replicable chunk of code in the presence of all the packages I am attempting to use and want to avoid displaying data ...
2
votes
1answer
106 views

pgfplots - How can I use the same single coordinate from multiple data files for one plot?

I have multiple .csv files which are organized like force-stats.txt (see MWE below). I'd like to make a plot based on several single points in these data files. Is this possible? So far searches with ...
2
votes
1answer
91 views

2 rows legend and alignment

I got a legend with two rows and I would like to have a different alignment on each row. Is it possible ? In my current code, the legend entries on the second line are much longer than ones on the ...
2
votes
1answer
114 views

Add single bar to a stacked bar plot

In order to show the difference between three measurements against a single one, I need to combine a regular bar plot and with a stacked one. However, once I use a stacked bar plot, the single datum ...
2
votes
1answer
338 views

Axis break in pgfplots - Large box around plot

I had the same problem as TSGM: Axis break in pgfplots I wanted to break the y-axis in a plot. I have tried the solution, which Michi had suggested on Axis break in pgfplots. It worked fine for me, ...
2
votes
1answer
95 views

How to change font family LaTeX plot?

I want to change the font family of the bar plot to Helvetica fonts. I have tried using the following code but it only changes axis fonts and not the data labels inside the plot: ...
2
votes
1answer
309 views

Peculiar tikz-external, pgfplots, tikzscale combination problem

I want to use \tikzexternalize and tikzscale with pgfplots' \addplot graphics command and \clip=false option. I am using three files: A.png, A.tikz and A.tex. A.png can be any graphics file. A.tikz ...
2
votes
1answer
354 views

Simple Line-Plot with date on x-axis

I need to do a really simple line plot and my data is looking like this: Date Value Apr2013 0.06 Mai2013 0.08 Jun2013 0.1 Jul2013 0.2 Aug2013 0.4 Sep2013 1.5 Okt2013 2.0 Nov2013 4.1 Dez2013 8.1 ...
2
votes
1answer
114 views

Loop in pgfplots doesn't work

I'm trying to do a loop in pgfplots to draw a bunch of rectangles under a curve, but it doesn't work. This is my code \begin{tikzpicture}\begin{axis}[ width=160pt,compat=1.5.1,grid ...
2
votes
2answers
153 views

How do I group curves in 2-D plots with pgfplots

In the above image, you can see that there are 4 curves. I have two techniques (black and red). I test them on two different experimental scenarios. So corresponding to each scenario, I get one red ...
2
votes
1answer
153 views

Why do these two plot commands give different results?

Why the following two MWE codes, using pgfplots with and without gnuplot give different results (a phase shift)? \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
2
votes
1answer
107 views

Special design of 3 plots with LaTeX

I wish design 3 plots (A, B and C) in the form of: ------------------------+---------------+ | | A | | ...
2
votes
1answer
90 views

Vertical labeled markers

I have a plot with four curves, and I wish to add vertical marker to pinpint the exact moment the curve drops below a certain threshold, much like this: I'd like to be able to control the width of ...
2
votes
2answers
238 views

pgfplots: markers with text above the marked points

first an image of what I would like to have I want to have a free text of the nth marker of each plot. I am symply providing no example, because I am not really sure to solve it and I am maybe ...
2
votes
1answer
155 views

Ternary plot: points outside of the triangle

although my test data points are all inside the (0,0,1),(0,1,0),(1,0,0) triangle, my ternary plot unexpectedly plots some of them outside of the triangle. \documentclass{beamer} ...
2
votes
1answer
522 views

Polar plot: label and legend rotation

I am using the polar library with pgfplots to plot a graph like this: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat = newest} \usepgfplotslibrary{polar} ...
2
votes
1answer
209 views

pgfplots: How to fix the number of yticks?

With max space between ticks= it is possible to set space between ticks, but I would like to setup the number of ticks, so all my graphs will look similar. I would be happy with 4 ticks, so if y vary ...
2
votes
1answer
245 views

How can I get the grid done correctly?

I'm trying to put the grid in my graphic, and I'm getting this problem below. The grid style must be help lines, and dashed, this I know how to do, but the problem remains in put the grid correctly. ...
2
votes
1answer
461 views

Trouble including a Matlab surf plot (pdf or png) with pgfplots

I have successfully used \addplot graphics before. Now I have a surf plot in Matlab, which I exported as png and pdf and I would like to include the image with \addplot3 graphics. I found some ...
2
votes
1answer
525 views

PGFPlots \addplot cannot read regression column [closed]

I am trying to plot a small dataset and a regression line for it. Here is my MWE: \documentclass{article} \usepackage[T1]{fontenc} \usepackage{tikz} \usepackage{pgfplots} \usepackage{filecontents} ...
2
votes
1answer
154 views

Error when there are plotting macros before \pgfplotsinvokeforeach

Why does \pgfplotsinvokeforeach produce ERROR: Undefined control sequence. when there are plotting macros before it inside a groupplot? \documentclass{article} \usepackage{pgfplots} ...
2
votes
1answer
459 views

Matching Rotated \hyperref in arbitrarily rotated x-label in Pgfplots

Similar to this question: How to make pgfplots vertical labels have proper hyperref erence box? Except, that I am trying to get hyperref working with angled rotated x-axis labels: Got it working, ...