{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
2answers
94 views

y label is stuck on the right side of the graph

I try to get y label on the right side of the figure, but the label is still stuck on the left side. Below is an example borrowed from another user here. It must be something very simple, but just I ...
2
votes
1answer
73 views

Trouble including graphics from csv file into Pgftable, commands are dissapearing (local maybe?)

I've been trying to add eps graphics with the filename in a csv file. Take a look at the CSV to get an idea of what I mean: ...
2
votes
1answer
288 views

pgfplots: marker size relative to interval size

I am trying to create a ybar interval pgf plot with horizontal lines as markers on top of each interval/bar. Intervals widths are specified by my external CSV data file. I defined my own plotmark ...
2
votes
1answer
167 views

How to change location of boxplots along axis in pgfplots?

pgfplots draws boxplots equally spaced along the axis (x axis in my example below). How can I draw the boxplots at different locations along the axis? E.g., the example below the distance between the ...
2
votes
1answer
187 views

How could we fix the legend in the x-axis with bar chart?

How could we fix the problem with the x-axis ? Also, would it be possible to have written above or in the middle of each column each number ? So as to make my bar chart, I have used the following ...
2
votes
1answer
139 views

unaligned groupplot

I tried to stack my plots with a groupplot from pgfplots package. Like in this MWE: \documentclass{article} \usepackage{pgfplots} \usepgfplotslibrary{units} \usepgfplotslibrary{groupplots} ...
2
votes
1answer
411 views

Setting gnuplot-like colormaps with pgfplots

I would to use the gnuplot default colormap with pgfplots. This colormap is defined in gnuplot with set palette rgb 7,5,15 where the numbers refer to a function for the red, green and blue colours ...
2
votes
1answer
288 views

Specify directories to check by the PGFplots addplot command

When I produce a graph with PGFplots, I first test it, before importing it in my main document tex file. I have the file tikzpicture.tikz in which the tikzpicture environment data is included, and I ...
2
votes
1answer
159 views

How can one insert an arrow on the z-axis of a ternary diagram to indicate increasing order of the element on this axis?

I need help on how I can insert X_{Bi} and a rightarrow on the z-axis of each of the subfigures in my ternary diagram. X_{Bi} implies X subscript Bi while rightarrow is as in LaTeX to indicate that Bi ...
2
votes
1answer
260 views

Pgf plots and a tabular legend

I have a plot where I want to add a legend which is the combination of lines and marks. For that I want to replace (or define a new) the original pgf plots legend type. As said before, in the ...
2
votes
1answer
758 views

Adjusting arrow style on pgfplots axes

Using axis line=middle in pgfplots creates arrow tips on the end of the axes. How can I adjust the size, style, etc? I suppose one way would be to make axes without arrows (using axis line*=middle) ...
2
votes
1answer
217 views

Legends for scaled pgfplots

I am using the pgfplots package to create some plots of data for my thesis. As an example, consider the following code: \documentclass[a4paper]{article} \usepackage{tikz} \usepackage{pgfplots} ...
2
votes
1answer
219 views

TikZ's decoration option for paths derails pgfplots axis

Well, the title says it all: TikZ's decoration option for paths derails pgfplots axis' formatting. Included in the MWE is my whole preamble concerning TikZ. If I run the MWE below, I get the following ...
2
votes
1answer
403 views

Circuitikz works with ground but does not work for rground

If I try to plot the following circuitikz schematic it works: \begin{figure}[bth] \myfloatalign \begin{center} \begin{circuitikz}[american voltages] \draw (0,0) node[ground] ...
2
votes
1answer
325 views

Externalize pgfplotstable with csv file

This is a direct follow-up question to this: Adding units to pgfplotstable header After fixing the output I tried outsourcing the table. After figuring out that standalone does not work with ...
2
votes
1answer
546 views

Nodes near coords gives Undefined Control Sequence

I have the following example of a graph. I want to place the items in the table "Restart" next to the nodes. Everything works until I add "nodes near coords", I get a bunch of errors saying "Undefined ...
2
votes
1answer
412 views

Modulo calculation in PGFplots tick label

I am printing a diagram and want to use a_[0...3] as tick labels on the x-axis. Right now I have a[0...7] as labels and look for a way to print a[\tick mod 4] (i.e. a_0, a_1, a_2, a_3, a_0, a_1, a_2, ...
2
votes
1answer
388 views

pgfplots: Scatter plot with multiple series side-by-side

I have multiple machines on which I did benchmarks. Now I wan to use pgfplots to show multiple y values (the variance in the measurement) for a single x value (a benchmark parameter) within a single ...
2
votes
1answer
455 views

Change axis number format for external tikz file

I'm using \input{filename.tikz} to include .tikz graphs created by matlab2tikz in my LaTeX document. As shown in a comment on this question it is possible to change the plot marker size when the ...
2
votes
1answer
269 views

How to generate a separate legend picture?

I want to generate a tikzpicture which only contains the legends, and not the plots themselves. I use the following code and it returns an error: ! Package pgfplots Error: Sorry, the supplied plot ...
2
votes
2answers
567 views

Problem in adjusting contour label color and numbr of samples in pgfplot

I am trying to create a contour plot using TikZ. I have two questions: How can I change the contour labels color to all black? Is it normal that gnuplot responds slow for creating smoother contour ...
2
votes
1answer
624 views

Tikzpicture in a two column way using a one column .cls template

I'm using a .cls IEEEtran from IEEE available here http://www.ieee.org/conferences_events/conferences/publishing/templates.html; and all document is in two columns. I'm ploting using pgfplots a ...
2
votes
1answer
192 views

ytick pgfplot issue

I have the following latex code but unfortunately cannot get the ytick to be of my choice. \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{center} ...
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
870 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
386 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
177 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
708 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
383 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
495 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
284 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
496 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
321 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
692 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
597 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
65 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
61 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
47 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
52 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
55 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
116 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
117 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
47 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
102 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
83 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 ...