{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.
4
votes
2answers
1k views
How to make pgfplots vertical labels have proper hyperref erence box?
PGFPlots and hyperref don't seem to play well together for vertical text. For example, the ylabel (which is vertical) shows its hyperref box in the middle of nowhere instead of at the position and ...
14
votes
1answer
366 views
How to plot integral as summation, as pictured?
I'm new to TikZ and pgfplots but would like to know how to plot the square as well as how to plot the arrows + delta x as well as arrow + delta A:
I'd be most grateful if some of you had some ...
14
votes
1answer
1k views
How do I draw a plot with a variable line width in pgfplots?
I have highly dimensional data for which I'd like to draw a plot where I vary the line-width, somewhat similar to the famous Minard chart:
I suspect this can be done with some combination of point ...
14
votes
4answers
1k views
Plotting the solution of inequalities with WolframAlpha or Maple
I want to plot the solution of two inequalities and include them in a LaTeX paper.
I really like they way this looks: Wolfram Alpha. Unfortunately, I have no idea how to
export this into a ...
11
votes
2answers
267 views
Visualize data on a variable-radius graph/network
I am trying to visualize the output from a simulation model I have been working with. The simulation finds the steady-state solution to a system of differential equations on a variable-radius (and ...
11
votes
1answer
409 views
How can I automatically mark local extrema with pgfplots and scatter?
I am trying to have TikZ automatically mark a local maximum in a fourth-degree polynomial I built using a curve-fitting tool. I am new to LaTeX and TikZ, and am a bit overwhelmed - there seem to be a ...
11
votes
2answers
2k views
Need to do some changes to pgfplots axis
I am still in the habit of learning TikZ, barely started using pgfplots to create my images
Although I am still not sure what the best way to do so is, I need to create the image below. My problems ...
10
votes
1answer
332 views
How to plot circular polarized electromagnetic wave
I am searching for a solution to get nice looking circular polarized waves in my latex document. My goal is to get a graph that looks like this:
I do not want the graph to be animated but I can not ...
9
votes
1answer
214 views
Plot magnification using sub-plot within a plot!
How can I produce such kind of zooming shown in the figure? Here the selected portion is plotted again with new axis displaying more details than just magnifying the portion.
One solution is to ...
9
votes
1answer
200 views
How to make the tick thickness as the axis line?
I am trying to make the thickness of the ticks equal to the axis line thickness. That is what I have so far:
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.5}
...
8
votes
1answer
498 views
How determine slope of straight line (with auto scale of axis) in PGF plots
I want to allow automatic scaling of the axis (so don't want to set axis equal=true), and be able to place a label on a line at a manually chosen point along the line. Of course if axis equal=true, ...
8
votes
2answers
2k views
Dimension too large while plotting with pgfplots
I have the following pgfplots code:
\begin{tikzpicture}
\begin{axis}[domain=-8:2]
\foreach \i in {-10,-9.8,...,10} {\addplot+[smooth] {-x/\i+\i};}%
\end{axis}
\end{tikzpicture}
I need several ...
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 ...
5
votes
1answer
266 views
2D surface on a 3D surface plot external data in a file
I am drawing a 3D surface from external data. Here they are:
0 0 -0.64
1 0 -0.5
2 0 -0.4
3 0 -0.31
4 0 -0.23
5 0 -0.2
6 0 -0.24
7 0 -0.32
8 0 -0.42
9 0 -0.59
10 0 -0.76
0 1 -0.54
1 1 -0.4
2 1 -0.27
...
4
votes
0answers
100 views
pgfplots: Aligning multiple bars and marks horizontally along symbolic X-axis
I want to plot average values of some measure as bar charts with error bars and its maximal values as marks above the bars.
I use two separate plots for that now.
The problem is aligning marks with ...
4
votes
1answer
126 views
How to draw on axis from pgfplots?
How can I draw on an axis from pgfplots? I already found out, that I somehow have to use axis cs: in front of the coordinates (what does cs mean?), but the following example does not draw the ellipse:
...
4
votes
1answer
138 views
Filter rows from a table
I have a large table that contains results for many instances, and I want to make separate tables and plots grouped by one (or more) field. In this minimal working example, I want to make a table and ...
3
votes
1answer
75 views
How to plot data from multiple filters using pgfplots
I'm searching for a way to apply multiple filters to a data input and plot the result of each filter in one axis environment. I found the following question which applies one filter but uses the ...
3
votes
1answer
251 views
Is there a common pgfplots styles/templates repository
I (try to) use the same plot layout in pgfplots everytime. I keep having to input the same details and although I do my best to cut and paste, it would be great if there were a simple set of chart ...
11
votes
1answer
256 views
PGFPlots % in ticks labels
Hi i want to put this simbol "%" in the tick labels only in the x axis how can i do?
11
votes
2answers
2k views
ylabel postion with pgfplots
I am using pgfplots to plot some data, but I am having problem you see in the image below. Basically, the ylabel overlaps with the axis numbering. I have googled a LOT but couldn't find any solution. ...
10
votes
1answer
309 views
Why does pgfplots package cause tikz layer to disappear?
I wish to include a pgf-generated line plot and a tikz-generated graphical model in the same document. However, the presence of the pgfplots package (needed for the axis environment) seems to turn one ...
10
votes
1answer
2k views
colors and legend in groupplots
In order to create a nice plot for the comparison of three different sites I'm using the groupplot command. Now for every site I have seven different criterias to compare. So far the plot looks like
...
10
votes
1answer
1k views
pgfplots: prevent single plot from being listed in legend
In order to fill the area between two complex curves I use tables and the vertcat command (see Fill between two curves in pgfplots.).
Now I don't want the plotted area to appear in my legend, just ...
9
votes
2answers
293 views
pgfplots plots function not correct
This code
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot [domain=15:30, samples=1000] ...
9
votes
2answers
947 views
Changing arrowheads size in pgfplots axes
I need to change the default axes arrowheads size of pgfplots when using the option axis lines=center. Following this answer, I tried this code:
\documentclass{standalone}
\usepackage{pgfplots}
...
9
votes
1answer
1k views
What “smooth” plot interpolation algorithm does pgfplots use?
In the pgfplots manual it says:
\addplot+[smooth]
Smooth plots interpolate smoothly between successive points.
In order to choose the right sampling of points from a function evaluation for ...
9
votes
2answers
6k views
Basic bar chart with text as x axis labels
I am trying to create a very basic bar chart using pgfplots. I need four bars representing percentages with text as labels under the x axis. Text labels contain spaces and accented, non-English ...
8
votes
1answer
133 views
pgfplots - x unit with siunitx
I want to use x unit=something to draw the units to an axis. In the manual I find this to use siunitx to do so:
\pgfplotsset{
unit code/.code 2 args={\si{#1#2}}
}
Now I make a plot:
...
8
votes
1answer
139 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 ...
8
votes
2answers
212 views
How can I plot two lines in the same style (using cycle lists) with pgfplots?
I am using cycle lists and the \addplot+ command to plot lines in different styles. I would like to plot several things using each style, however, like this:
% Plot using style 1
\addplot+ ...
8
votes
1answer
468 views
How can I filter/select data (float, text) from a table and plot it?
Note
I post this question in addition to a recent question (see below) with a more detailed description of the problem:
This was the original question:
How can I filter/select data from a table and ...
8
votes
1answer
2k views
pgfplots axis scaling
Is it possible to define in pgfplots that y should correspond to Y cm in my plot?
I know how to do this in tkz-fct, so let me add an tkz-fct example to make more clear what I want:
...
8
votes
1answer
657 views
How to generate templates for charts
Most of us create charts that have to be repeated
a number of times with only the data varying. Applying DRY (do not repeat yourself) programming principles to such problems is not an easy task.
To ...
8
votes
3answers
825 views
PGFPlot - Missing values in table data
I am using PGFPlot with external table data. However, some values are missing for some plots. This causes data in column 2 does not exists error. Is there a way to solve this. The value does not ...
8
votes
1answer
752 views
Smooth option sometimes produces incorrect arrow tips in PGFplots
It seems that the smooth option applied to lines sometimes effects the arrow tips and produces incorrect results. No problem with vertical lines, but any other seems to have a problem. Is this a ...
8
votes
1answer
1k views
Declare nodes in pgfplots as overlays
The Background
In pgfplots, it is possible to make plot elements such as axis labels, ticks and legends overlay, which means they will not be considered when determining the bounding box of the plot.
...
7
votes
2answers
127 views
half of a hyperbola
Only top portion of half my hyperbola is coming in correctly. The other half is doing something strange:
\documentclass{article}
\usepackage{tikz, pgf}
\begin{document}
\begin{center}
...
7
votes
2answers
147 views
add unit circle to a plot
I have a point-by-point plot (pgfplots option only marks) in which I display the real and imaginary part of some points in the complex plane.
I would like to add the unit circle to the plot, for ...
7
votes
1answer
232 views
tikzpicture in minipage
Can I set the exact width to a tikzpicture? I thought so, with "width", but I tried this:
\colorbox{gray}{
\begin{minipage}{.33\textwidth}
adfjk adfjk adfjk adfjk adfjk adfjk adfjk adfjk adfjk adfjk ...
7
votes
1answer
398 views
tikzscale and histograms in pgfplots
Tikzscale is giving wrong results for histograms drawn in pgfplots.
Histogram without scaling by tikzscale:
Histogram after scaling:
I have included a histogram from page 67 from pgfplots manual ...
7
votes
1answer
147 views
Correctly align vertical text on a baseline in pgfplots
I'm proud to announce that I have a large number of PGFplots in my document.
But ... I have a small problem with the vertical alignment of text throughout my plots.
What's the easiest way to align ...
7
votes
1answer
322 views
weibull plot with arbitrary y axis scale
I want to draw a function in a weibull plot. The x axis is log, the y axis however goes with log(-log(1-y)) (as far as I understood it from this site). The y axis looks similar to a log scale but ...
7
votes
1answer
429 views
Two different scales on stacked barplot
What I want to plot
I'd like to plot several stacked xbar plots where each bar plot contains two values. The total from each xbar-plot is based on one unit, i.e. the smallest bar represents "1" ...
7
votes
1answer
2k views
pgfplot: accuracy of tick labels
the y-axis of my diagram uses small numbers like 0,005. I don't want to use a multiplier like 10^-3 which appears by default. If I remove it with
scaled x ticks = false,
x tick label ...
6
votes
1answer
391 views
Change the appearance of grids in pgfplots
I am asking if there is a command in the pgfplots package that changes the appearance of the grid in terms of kind of the lines. What I mean is how to change the kind of lines. I have read the ...
6
votes
2answers
245 views
pgfplots exponent in ylabel instead of yticklabel
I know there are already a lot of questions answered about the exponents of the ticklabels and how to get rid of them, but in my extensive search I was not able to find an answer to my specific ...
6
votes
1answer
201 views
How to add another row of tick labels?
Rather than adding a second x axis by putting it on the other side of the plot I would like to add one implicitly simply by adding another row of tick labels to an existing axis. What I am after is ...
6
votes
1answer
774 views
pgfplot consistent number format
I am trying to make a the number format in my pgfplots the same, as in the rest of my document. I am normally using the \num from the siunitx package to typeset numbers, and would like to use it in my ...
6
votes
1answer
876 views
error bar colors in scatter plot
A data file contains four columns: x, y, error on y, class. class is an integer which I feed to scatter src so i get a graph that has different colors for different classes. However, the error bars ...

