{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

3
votes
1answer
701 views

One axis in pgfplots

I try to make one axis exercices for students, thus I try to customize pgflots but I don't understand what append in this examples : \documentclass{article} ...
3
votes
1answer
390 views

\pgfplotstabletypeset heatmap: logarithmic scale

I am trying to create my own rendition of this heatmap. My values range anywhere from 1 to 783764. I want to plot them as colors on a logarithmically (base10) scaled colormap. So the values' ...
3
votes
1answer
505 views

Cyrillic text in symbolic x coords

I make bar plot with pgfplots: \documentclass{report} \usepackage[T2A]{fontenc} % Поддержка русских букв \usepackage[utf8]{inputenc} % Кодировка utf8 \usepackage[english, russian]{babel} % Языки: ...
3
votes
1answer
367 views

Add arrow to 3D pgfplot

How to add an arrow (cf red arrows below) in a 3D plot (or 2D plot should be similar) in pgfplots ? The arrow has not to be specifically aligned with the label but could be placed closer to the axis. ...
3
votes
2answers
3k views

matlab2tikz and legend location

I have a matlab plot given below, that is converted to tikz. Let's call it myfile.tikz \begin{tikzpicture} \begin{axis}[% width=\figurewidth, height=\figureheight, scale only axis, xmin=1, xmax=3, ...
3
votes
1answer
201 views

PGFPlots: Thick line goes outside drawn y-range

What is the best way to avoid thick lines in PGFPlots from going outside the drawn y-range? For example, near the maximum in \documentclass{article} \usepackage{pgfplots} \begin{document} ...
3
votes
1answer
603 views

Two boxplots per plot entry - shifting boxplots in pgfplots

I'm trying to compare the results of a control group and an experimental group under different conditions. To simplify, let's assume there is only one condition (ie. only one mark along the x axis ...
3
votes
1answer
150 views

How to remove all of ticks keeping the extra ticks

I want something like \begin{axis}[ y ticks=\empty, extra y ticks={-1,1}, extra y tick style={yticklabels={{name1},{name2}} ] ... \end{axis}
3
votes
1answer
515 views

PGFPlots: How does one plot a wave packet?

Given the equation 2\cos(kx - wt)\cos(.5\Delta k(x - \frac{\Delta w}{\Delta k}t)). How can I plot this in pgfplots? k is the wave number w is the frequency \Delta k and \Delta w are both \ll 1 We ...
3
votes
1answer
418 views

pgfplots memory overload

I want to plot 5x9000+ data points. I am already using: \usepgfplotslibrary{external} \tikzexternalize and -shell-escape -enable-write18 in PDFLatex. However, I still get the memory error. I ...
3
votes
1answer
481 views

pgfplots plot marks vanish when I change colors

I have created two overlapping plots (thanks to Drawing curves and multiple y-axes in one plot with pgfplots): When I change the color in the second one, the plot marks vanish: Here's my MWE: ...
3
votes
1answer
407 views

! Dimension too large

I keep getting the error Dimension too large when i make my \Desktops{80} and my \DTUnits{20} however if I change my \DTUnits{14} it works, can someone help me please? ...
3
votes
1answer
112 views

Hiding Decimal Results from PGF Output

I have this \foreach statement which results in even numbers with decimals. I would like to omit or hide the decimal from the results. How can this be done simply? I have seen a few answers to much ...
3
votes
1answer
732 views

pgfplots won't produce error bars

The following error is thrown when I try to compile the MWE below: Package pgfkeys Error: I do not know the key '/tikz/error' and I am going to ignore it. Perhaps you misspelled it. I'm running ...
3
votes
1answer
242 views

How to make the legend border tighter?

I am trying to make the legend border tighter. What is the \begin{axis}[legend style={...}] property to adjust the legend border (both width and height of the border)? \documentclass{article} ...
3
votes
1answer
702 views

set domain in pgfplots

I created this graph. The graph is shown correctly but I need the range on the y-axis to be from 10e-8 to 1. I would also like a grid. I'm a newbie with the pgfplots package. \begin{figure}[htp] ...
3
votes
1answer
3k views

matlab2tikz for surf plots: reducing data?

I was really happy to see that matlab2tikz also supports surf plots. Unfortunately, it produces too much data, so I run into the well-known memory problem. I tried compiling with lualatex instead of ...
3
votes
1answer
265 views

Using foreach to generate computed indices in a plot

I have a table with 8 columns, and I want to generate 4 plots (1 vs 0, 3 vs 2, 5 vs 4, and 7 vs 6). I was going to use foreach to generate the plots using \begin{tikzpicture} \begin{axis} \foreach \x ...
3
votes
1answer
338 views

pgfplots: marks in table as ellipse with size of error bars, area of uncertainty?

Is it possible, and if yes how, to plot a table with pgfplots where the marks are ellipses with the major and minor semiaxes being the size of the error? Such that a data point is displayed as its own ...
3
votes
1answer
141 views

Make the label surrounding line disappear

Referring to How to plot the graph below? Is it possible to make the label surrounding lines, and the top and right lines for the coordinates disappear?
3
votes
1answer
518 views

Filter by value when reading and calculating data using pgfplotstable

I am trying to plot data from a file, using pgfplots for the plot and pgfplotstable to read in the data and calculate a new column (cummulative values from another row), which is plotted as well. My ...
3
votes
1answer
430 views

Plots with only a few scattered marks and correct legend

I would like to draw several plots with lines and only a few marks. The markes are irregularely spaced, so I used a method alluded to in the pgfplots manual, section 4.8.5 (Legend appearance), page ...
3
votes
1answer
868 views

How can I add a legend in aligned subplots

I want to have two subplots with the same x axis aligned above one another. In the manual I read, that I should use \matrix{} to achieve this. Now I want to have legends in both plots. But since the ...
3
votes
2answers
383 views

Numbers as markers with \foreach and additional macro based on counter

First issue I would like to plot several curves using the \foreach command and have their number in the sequence as markers. Here is the code I came up with : \documentclass{article} ...
3
votes
1answer
215 views

pass a set of numbers to pgfplotsinvokeforeach <list>

Is it possible to pass a numeric set to the list argument of the \pgfplotsinvokeforeach command? I need something like this: \newcommand{\a}{1,2,...,10} \pgfplotsinvokeforeach{\a} {<...>} ...
3
votes
1answer
442 views

Using counter values as part of style name for plots

I figured I should be able to give a bunch of line styles and access them using counters. Sure enough, this works out fine; this document \documentclass{article} \usepackage{tikz,pgfplots} ...
3
votes
2answers
2k views

latex code for graphing rational function

I've seen in TikZ and pgf Manual for version 1.18 a code for graphing some functions but it does not provide an example for a rational function. Can someone help me graph $x+\frac{1}{x}$?
3
votes
1answer
4k views

PGFPLOTS: figure and table formatting

Just after an hour spending browsing through the pgfplots manual, I am trying to have a figure and a table side by side (both the figure and the table use the same data). So I still have lot to learn! ...
3
votes
1answer
2k views

smooth surface plot with pgfplots/gnuplot

i want to create a smooth surface plot with pgf-plots and gnuplot. The following code yields a graph, but i need much more gridpoints along y-direction. How can i reach this? The increase of samples ...
3
votes
4answers
2k views

How do I align a pgfplots graph?

I'm trying to draw a graph with the associated table of data using pgfplots. It works great, but the graph itself isn't aligned with the table. This is what it looks like: I don't like the ...
3
votes
1answer
46 views

Axis label positioning in pgfplots

Can someone please help me explain why label positioning in the following code does not work? It is not clear what I am doing wrong. I also tried axis description cs. That does not change the label ...
3
votes
1answer
45 views

How do I remove some unwanted x ticks in PGFPlots?

I am not sure where I am doing wrong, but in the plot I should not have two 32, two 64 and two 128 on the x-axis. Here is a minimum working example; I would appreciate any assistance. ...
3
votes
1answer
90 views

Alternate position of x tick labels

Is it possible to automatically change the position of every other x tick label in pgfplots? This is my scenario: I have a plot with symbolic x tick labels loaded from the table. Those labels are ...
3
votes
1answer
54 views

How can I add degree signs to the numbers on the x axis?

I want to add degree signs to the numbers on the x axis, as shown in this picture. How can I do this? \documentclass[tikz,border=5pt]{standalone} \usepackage{pgfplots} ...
3
votes
2answers
145 views

How to draw a tangent line to an arbitrary `\addplot` [duplicate]

I am attempting to draw the following graph in tikz. My attempt so far has gotten me to here. \documentclass[border=3mm]{standalone} \usepackage[dvipsnames]{xcolor} \usepackage{pgfplots} ...
3
votes
1answer
207 views

Basic Bar Plot with long text legend, horizontal guides and percentage values

I am new to pgfplots and actually I want to create something pretty basic. Yesterday, I started modifying my chart with the help of the pgfplot manual and the help of Google but unfortunately, I ...
3
votes
1answer
61 views

Plot hex numbers in pgfplot

I want to draw a graph from external text file which contains hex numbers (representing integers) like 0x8210 in 4 columns. It seems pgfplot does not automatically recognize the hex numbers. I know ...
3
votes
2answers
70 views

How to align annotations with axis labels in pgfplots?

I would like to annotate plots produced with pgfplots in such a way that: The baseline of the annotation is aligned with the baseline of the x-axis label. The left margin of the annotation is ...
3
votes
1answer
80 views

Fix Overlapping Plots in Pgfplots

I am trying to plot x^2+y^2−z^2=1 and x−2z=0 on the same graph and am able to successfully graph them; however, the result looks horrible and overlaps poorly. How can I fix the overlap and make a ...
3
votes
1answer
82 views

How to add multiple x axes with different scaling?

I am trying to plot the following graph (Standard Atmosphere) with pgfplots: What I currently have is: \documentclass[]{article} \usepackage{pgfplots,amsmath} \begin{document} \begin{tikzpicture} ...
3
votes
1answer
122 views

PGFPlots — custom colors for ticks labels

Is there any way to change a color of a single tick label? I need some labels to be black and others to be blue and red. \documentclass[png,border=4pt]{standalone} \usepackage{tikz} ...
3
votes
1answer
41 views

bug in pgfplots+subcaption?

I'm using pgfplots (with the excellent matlab2tikz), pgfplotstable and subcaptionbox together, and for some inexplicable reason (at least to me), the command \pgfplotsforeachungrouped seems to break ...
3
votes
1answer
169 views

Draw a surface on a ternary diagram with pgfplots

I'd like to draw a surface on a ternary diagram. Until now, I can plot density maps on a ternary diagram (cf. density map). But I would like to replace the density map by a surface, like on figs a ...
3
votes
1answer
171 views

pgfplots error message “/pgfplots@addplotimpl@expression@curly”

I am currently using pgf plots to make a few graphs; however, when I go to typeset the document I receive a strange error message that prevents the PDF from being produced. The error message states: ...
3
votes
1answer
130 views

Adding lines to bar charts

Is it possible to add a straight horizontal black line (from (0, 0.4) until the very end of the graph) in a bar chart environment like this: Here is the code that generates this bar chart (borrowed ...
3
votes
1answer
216 views

How to add an extra tick without adding a new line to the grid

I need to add an extra tick to the x-axis without adding a new grid line at the new x value, the problem is that I'm using extra ticks to get a complete grid (it is one solution that was given to me ...
3
votes
1answer
97 views

Show mark labels near marks and not centered in ybar interaval graph

I'm doing a graph with vertical bars (ybar) where each bar represents not a number (1) but a class ([-0.5,0.5]). I would prefer that tick labels on the x axis appeared near the ticks marks, so ...
3
votes
1answer
63 views

characteristic of a regression line

I have a little Problem with a regression line I made. I need it to be from its zero up to the x-value of the highest point. This is how it actually looks und underneath how I need it. Does anyone ...
3
votes
1answer
128 views

Is it possible to make a gradient from 'opaque color' to 'total transparency'?

It seems like the 'color' transparent acts just like black (changing opacity acts as some kind of gray): \documentclass{standalone} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} ...
3
votes
2answers
96 views

Labelling only one point on a coordinate axis (pgfplots)

I want a grid on the whole plane like I have, but I don't want labels on the coordinate axes (other than at x/y=1) or the blank spaces that are seen in the MWE. How do I accomplish this? ...