{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.
1
vote
0answers
29 views
How to increase nonstop limit
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 column mismatch.
However the graphs are correct and exactly what ...
9
votes
2answers
105 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 ...
4
votes
1answer
34 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 ...
5
votes
2answers
118 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 ...
3
votes
0answers
36 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 ...
8
votes
1answer
134 views
Is there a workaround against loss of precision in pgfplots axis?
I am generating a bunch of plots automatically using pgfplots. For some datasets the span of data in one axis (y) is relatively small (relative to the absolute value) and therefore pgfplots when ...
3
votes
1answer
45 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 ...
6
votes
1answer
581 views
How to generate stem plots with TikZ like stem() in Matlab?
Given a set of (x,y) coordinates stored in a file, how could I generate a stem plot from those coordinates? I would like to achieve something similar as the matlab's stem function: ...
0
votes
1answer
51 views
Where is the pattern list gallery for pgfplots?
Where is the list, or gallery of the patterns available for pgfplots?
2
votes
1answer
56 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) ...
4
votes
2answers
64 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 ...
4
votes
1answer
62 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}[
...
5
votes
1answer
117 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
45 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}
...
6
votes
1answer
83 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) ...
0
votes
0answers
34 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
73 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 ...
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
34 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 ...
2
votes
1answer
62 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}
...
0
votes
1answer
61 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 ...
3
votes
1answer
57 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}
...
3
votes
2answers
118 views
LaTeX - PGF groupplot - polar axis
I can't find the answer anywhere, is it [and how] possible to make a group plot of multiple polar graphs? For grouping, I use pgf.groupplot library, for polar axis, I use \begin{polaraxis} from pgf ...
5
votes
2answers
51 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,
...
3
votes
1answer
53 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
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 ...
6
votes
1answer
77 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 ...
7
votes
1answer
138 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 ...
2
votes
1answer
68 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 ...
1
vote
0answers
32 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
...
7
votes
1answer
110 views
How to change xticklabel or yticklabel style to Percentage?
When using tikzpicture in the pgfplots package, how can I change use PERCENTAGE for xticklabel or yticklabel.
Here is a simple example:
\documentclass[a4paper]{article}
\usepackage{pgfplots}
...
5
votes
2answers
77 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:
...
1
vote
1answer
43 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}, ...
2
votes
1answer
67 views
pgfplots grouped bar chart from file
I am trying to create a grouped bar chart with pgfplots from a file that contains a data table. However in the resulting picture the bars are not grouped but on top of each other.
Every working ...
4
votes
2answers
666 views
3
votes
1answer
43 views
Adjusting width of ybar interval separator to width of histogram bars
I have an array of numbers for which I want to create a histogram for the first 22 entries. I want to show both the first few entries of the array as a bar plot as well as the histogram in two ...
5
votes
1answer
59 views
Lining up angled tick labels on a pgfplots bar plot
I'm trying to produce a bar chart for publication with math text in the tick labels. The most readable layout would be to angle them, but when I do they clash with the axis and are difficult to relate ...
2
votes
1answer
156 views
tikzpicture and pdf - x axis partially disappears
I would like to know why the x axis partially disappears, given the following code. Is it a PDF problem? Also, is there any option to connect the midpoints automatically but not in a smooth fashion?
...
5
votes
1answer
105 views
Align pinned nodes in PGFplots
I'm working with plots generated from matlab2tikz and I have several plot lines close to each other. Labeling them is proving difficult, but I believe a good looking solution could be to list the ...
0
votes
0answers
51 views
tikz.sty not found for Texniccenter [closed]
I did search online, but didn't find any good answer for it. That is it. I found the solution.
Go to miktex package manager; type 'tikz.sty' in the File name table; search it and then install what ...
5
votes
1answer
102 views
Fill the area enclosed by multiple functions in a single plot
I wish to fill the area enclosed by four functions, as indicated by the hatching in red in the figure below:
So far I've been able to fill the area between each pair of functions, as shown below:
...
1
vote
0answers
53 views
local extrema pgfplots - smooth
Is it possible to change this code for a "smooth" plot?
How can I automatically mark local extrema with pgfplots and scatter?
MWE
\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
...
2
votes
1answer
65 views
Global legend for multiple figures
Similar to this question, I need output as follows but in a neat way. My solution code is not neat any more: I added a dummy axis to use its legend. Also the legend must be at top of the page.
Here ...
4
votes
1answer
135 views
Put numbers in legend using pgf pie
I would like to have the numbers that are inside the pie chart to be in the legend. How can I make that happen?
Here is the MWE:
\documentclass{article}
\usepackage{pgf-pie}
\usepackage{tikz}
...
3
votes
1answer
245 views
How can I make logarithmic axes through the origin?
I have this graph:
The x-axis looks like it should look like:
arrow head at its end
label near the arrow head
it goes through the origin
But the y-axis does strange things:
It does not go ...
1
vote
0answers
65 views
Issue with PGFPlots text
I'm trying to generate some plots using TikZ, with the following code:
It's not about babel, fontenc, or inputenc; I've tried removing them to no avail.
\documentclass[a4paper]{article}
...
1
vote
1answer
155 views
Debugging TikZ and PGFPlots compatibility issue
I just tried to compile an old TikZ code (which as far as I recall compiled perfectly in the past and was not changed in the meanwhile) and I faced some serious compilation issues related to TikZ.
...
4
votes
2answers
225 views
How to shift x ticks in pgfplots having multiple stacked bars
My goal is to generate this bar chart:
I was able to achieve this chart as my MWE:
\documentclass[parskip]{scrartcl}
\usepackage[margin=15mm]{geometry}
\usepackage{pgfplots}
...
1
vote
1answer
87 views
Pgfplot figure off-center
I create a tikzpicture in standalone mode (see code below). Then import the resultant .pdf file into my document via \includegraphics (see pic). However the axis labels are cut off and part of the ...






