{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.
3
votes
2answers
17 views
overlapping labels in tikz
This might be closed for being too localised, in which case I don't know where to get help from but here goes.
I am drawing a histogram with Tikz (using the ybar interval bar chart) and labelling the ...
0
votes
0answers
20 views
externalizing the caption together with legend
I have the following plot:
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
scale only axis,
width = 0.8\columnwidth,
height = 0.8\columnwidth,
enlargelimits = 0.15,
xlabel = {\# Classes ...
0
votes
1answer
49 views
FOSS for real-time PGFPlots
Any FOSS for real-time PGFPlots? Is it worth opening a feature request for KtikZ (QtikZ)?
6
votes
1answer
48 views
Pattern in \addplot inherits dashed option from previous \draw
I want to fill the area between two curves with a pattern, let's say horizontal line.
Since I want some other dashed lines below these curves, I use \draw[dashed] and then \addplot[pattern=horizontal ...
0
votes
0answers
31 views
error while converting surf error to tikz [duplicate]
I have used matlab2tikz to convert a figure from matlab to tikz, but while compiling it gives following errors
main.tex:170 Package pgfplots Error: No such element:
...
11
votes
3answers
204 views
Draw a cylindrical spiral with TikZ
I want to make a tikzpicture to illustrate the construction of a spiral capacitor.
These are made of spiral coiled films. So imagine a rectangular paper that you tail around one side. Thats basically ...
3
votes
1answer
45 views
PGFPlot/Tikz Legend Error
I wish to add a legend to my two plots - red and black, but the legend seems to have some scaling issues. I think it may be due to the changes made in shifting and domains, but I am not sure!
...
6
votes
1answer
56 views
PGFPlots append text to all contour labels
Is it possible to append a text suffix (in my case a unit) to all labels in a PGFPlots contour plot?
For example, consider the following plot:
\documentclass{article}
\usepackage{tikz}
...
4
votes
0answers
36 views
pgfplots: How to move bar labels [duplicate]
2 questions:
1) How do I move my data labels to the center of my bars?
2) How do I make the labels be purely data labels, and not cumulative values? eg I want the red bar labels to be the value of ...
2
votes
0answers
37 views
How to add PGF plot marker separately to document? [duplicate]
Say I have some PGF plot, which uses some custom plot markers, for instance:
\newcommand{\scaleofcirc}{0.85}
\pgfdeclareplotmark{manualcirc}
{
...
2
votes
1answer
56 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 ...
5
votes
1answer
53 views
pgfplots scale legend position when below xlabel
When using matlab2tikz to generate a .tikz from Matlab where the legend location is set to 'SouthOutside' (below the ylabel of figure), the position of the legend will cover the ylabel unless the ...
3
votes
1answer
62 views
New line in pgfplots/tikz not displaying in TeX
I have a multiple-line legend entry to preserve the width of my figure. I can use
\newline in Matlab and the legend entry is split between two lines. When I produce a .tikz of the figure however, I ...
1
vote
1answer
43 views
Add labels to y ticks in bar chart [duplicate]
I'm just starting to mess with pgfplots and just had a quick question in formatting bar charts. Specifically, I was trying to add labels to each of my y ticks and i couldn't figure it out.
...
4
votes
1answer
48 views
How do I add other plots to a stacked plot?
If I have a ybar stacked axis type, how can I add another plot such as a jump plot on top?
The example below shows more or less what I need:
2
votes
1answer
50 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, ...
4
votes
0answers
48 views
Decimal number in axis tick using: “x tick=data” [duplicate]
I have found the following problem during the building of an histogram:
\documentclass[a4paper,11pt]{article}
\usepackage{pgfplots}
\pgfplotsset{/pgf/number format/use comma,compat=newest}
...
1
vote
1answer
42 views
pgfplots, toks, position of pin edge
I want to use pins to comment specific points in a diagramm. When I use a edge like -> it works fine. But if I use *- for example then the center of the dot is not at the position it should be. ...
1
vote
1answer
97 views
Semantics for parametric plots with pgfplots
I wasn't able to find in the pgfplots manual the exact semantics for pairwise mathematical expressions. Could you clarify the following variations?
% Assume x(t) is parametrized by t in [0,1] and ...
6
votes
1answer
72 views
Add annotations at right margin of plot
I'd like to add annotations outside the plotting area, at the right axis, and at positions that depend on the coordinates of the plot.
I could do that with custom ticks, or adding nodes manually, but ...
4
votes
1answer
65 views
Using remember picture with pgfplots
The two rectangles in the example plot, by my reckoning, should overlap exactly. I would be most grateful if somebody could explain why they don't! My presumption is that this is a bug in my TikZ ...
3
votes
0answers
95 views
How to mitigate “same number of coordinates” error?
I have a rather complicated pgfplots graph mixing const plot with ybar stacked and it doesn't like the data sets I am importing due to coordinate mismatch.
However the graphs are correct and exactly ...
4
votes
1answer
40 views
pgfplots: Splitting xlabel on two lines
I want to split xlabel into lines. My MWE is below:
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.7}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
% xlabel ...
9
votes
2answers
126 views
How to add legend to contour plots?
The following does not work:
\documentclass{standalone}
\usepackage{tikz,pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[view={0}{90},legend entries={foo,bar}] % 'legend entries' causes ...
3
votes
0answers
47 views
pgfplots trim to axis area even with extra ticklabels
I have a plot with extra x tick labels on top in pgfplots that i wish to display in a figure at the top of my page.
I wish to have the top of the actual axis rectangle directly at the top, with the ...
3
votes
1answer
53 views
pgfplots custom axis scaling function
If I have a data set in which most of the interesting stuff happens for small values of x then I can use \begin{semilogxaxis} ... \end{semilogxaxis} to create a plot with a logarithmic x axis, which ...
2
votes
1answer
37 views
PGFplots and table with different number of elements in columns
I am trying to plot a table where I have different number of elements in the columns. In the MWE, the pairs (x1,y1),...,(x4,y4) all have different number of elements, can I use PGFplots in such ...
0
votes
1answer
62 views
Where is the pattern list gallery for pgfplots?
Where is the list, or gallery of the patterns available for pgfplots?
2
votes
1answer
69 views
pgf plot, polar plot: how do i ensure that the 0 degree label begins in the north and not in the east?
I am using the polar library with pgfplots to plot a graph like this:
\begin{tikzpicture}[scale=0.65]
\begin{polaraxis}
\addplot coordinates {(0,1) (45,1)};
\addplot coordinates {(180,0.5) (172,1) ...
5
votes
2answers
126 views
How can I plot bigger amounts of data?
I am currently playing around with hailstone sequences (collatz numbers).
I would like to create a plot like this (from Wikipedia):
But I don't know how this kind of plot is called (it's neither a ...
6
votes
2answers
86 views
pgfplots to plot a function from [4,4.001]
When I try to plot a function on a small range, the output is an empty graph from 0 to 1 on the x and y axis. What can I do to fix this? My tex looks like this:
\begin{tikzpicture}
\begin{axis}[
...
4
votes
2answers
67 views
Externally set ymin, ymax, xmin and xmax with pgfplotset
According to percusses answer in Argument to \input or \include statement? both height and width in the axis environment in PGFplots may be set externally (outside the axis environment) with a nested ...
5
votes
1answer
124 views
pgfplots with gnuplot
I got a problem with latex implementing a gnuplot code. I use PdfLatex with argument "--enable-write18".
The following code should works with the first commented-out line %plot 'data.dat' u 1:2;, but ...
3
votes
1answer
56 views
How can I display tick marks on only one axis of a pgfplots graph?
How can I display tick marks on only one axis of a pgfplots graph?
Here is some simple code to work with:
\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
...
0
votes
0answers
40 views
Trouble with each nth point {integer}
I am trying to plot a big size vectors using pgfplots but I always I get the following:
Package pgfkeys Error: I do not know the key '/tikz/each nth point' and I am going to ignore it....
Is ...
1
vote
0answers
84 views
Plotting a histogram from a dat file using pgfplot
I want to create a histogram from a dat file with two columns, error and frequency. It also has a large amount of bins, 501.
I have followed instructions provided elsewhere on this site but the data ...
6
votes
1answer
90 views
Using nan values in pgfplots
I use addplot to plot a data set which has nan values.
The data file contains 5 columns.
First column is the x-axis (time), the second and fourth is the wavelenght (same element, but 2 measurements) ...
3
votes
1answer
37 views
Changing the default file path for \addplot table {myfile}
Is there a way to add a file path prefix (ideally defined by a key) to the "argument" of \addplot table. Something like
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{%
table file ...
0
votes
1answer
68 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
67 views
How to tell pgfplots to keep empty “series”?
I have a plot with xticklabels defined as symbolic.
In a modified version of my plot, I want to set ymin value. When doing this, my plot is automatically updated: all x series having only points ...
3
votes
1answer
64 views
tikz plot change one value of x axis
I'm not so familiar with tikz plot. The plot looks actually like it should, but I would like to change the last position value 300 to n in the plot.
Is this possible ?
\documentclass[]{article}
...
5
votes
2answers
61 views
How to modify the image of an legend entry
I have the following code
\documentclass[tikz,convert={size=640}]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
legend entries={simulation sample 1,
...
6
votes
1answer
91 views
Pgfplots: Drawing Arrows Along Contour Plots
I would like to draw "stealth" arrows in place of the "0" labels along the trajectory in the phase portrait pictured below. I decided to draw the trajectory using the contour functionality of ...
3
votes
1answer
55 views
TikZ/PGF \closedcycle to y axis
Consider the following MWE:
\documentclass{article}
\usepackage{tikz, pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot [domain=0.7:1.6,samples=20, fill=red!50!white]
...
6
votes
1answer
80 views
Is it possible to shift ticks position in a graph to match APA style ?
I have been looking for a while for a way to shift ticks on a graph. I found many options regarding ticks positions, labels or size but I could not find a way to move them orthogonally to the axis ...
1
vote
0answers
35 views
A workaround for visualization depends on and ybar stacked
Are there any workarounds for the bug?
The "visualization depends on" function causes an error with stacked
plots.
With "ybar stacked", the minimal example generates the error message
...
2
votes
1answer
76 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 ...
5
votes
2answers
82 views
pgfplots: Displaying a bar graph and a table from the same input file
I try to display on one Beamer slide a bar graph and a table with numbers taken from the same input file (to avoid repetition when copying the data). For now, I am stuck on this error message:
...
7
votes
1answer
148 views
Define error bar color in scatter class
I'm using scatter/classes to define color and markers for a plot, and I would like to specify the error bar color this way as well (to match the marker color). I have seen the error bar colors in ...
1
vote
1answer
44 views
Set xstep and ystep pgfplots
I have this MWE. My question is how can set xsep and ystep in the axis so that they will properly appear, and without have to know in prior the range of values: xtick={0,0.1,...,1}, ...




