{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
117 views

Pgfplot how to make scientific number format with “e” exponent style

The normal scientific coordinate is something like 10^2, how do I change it to 1e+2 style ? For example: \documentclass[border=4mm]{standalone} \usepackage{pgfplots} \begin{document} \begin{...
3
votes
2answers
119 views

Unable to plot both axes and arccos function in pgfplots

What I want to plot is 3 functions: x=0, y=0, and x=cos^{-1}(x). The plot and graph of the first two look like this: \begin{center} \begin{tikzpicture} \begin{axis}[domain = -1:1, samples = 500, ...
3
votes
2answers
153 views

PGF Plots line not all thick

I have looked on the forum and haven't been able to find a solution to my problem. I have a .tikz file made in MATLAB and exported using matlab2tikz, with two plots containing a very large number of ...
3
votes
2answers
162 views

Dimension too large with \pgfmathsetmacro

I want to define varafterglowepsdown, varafterglowa and varafterglowb and use them in a tikz function like this: \newcommand{\varafterglowepsdown}{0.0001} \pgfmathsetmacro{\varafterglowb}{ln(\...
3
votes
2answers
239 views

pgfplots log axis with only minor ticks/labels

I'd like generate sheet of blank semilog paper. Every decade shoud have labels from 1 to 9. I only managed to have an unlabelled axis, but had no success to set the x axis labelling according to my ...
3
votes
1answer
141 views

Graphing an arcsin function using pgfplots

I am trying to graph this function using pgfplots: D(x)=180+2x-4(arcsin(sin(x)/1.33)) What is the how to I represent this in the the addplot function in pgfplots? I am also confused as to what to ...
3
votes
1answer
624 views

Document compiles with pdflatex but not lualatex but why?

Using the current TexLive 2015 on Windows 7 I can successfully compile the following MWE with pdflatex: \documentclass[tikz]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.12} \begin{...
3
votes
1answer
2k views

Resize font in legend below \tiny

I have small graph in my presentation (I have to). To adjust the size of the legend, I have to use very small legend. But \tiny is not enought. Here is a MWE : \documentclass{beamer} \usepackage{...
3
votes
1answer
441 views

controlling pgfplots axis labels

I prepare Multiple Y-axis plot -4 Ys YY-YY But I have only one problem, I want my x number only show 0,4,8,12,20 time But when I write commander show me all from 0 to 20 How I will do this? \...
3
votes
1answer
929 views

pgfplots : Row title in legend

I would like to add a title to each row of my legend in pgfplots. I achieved this with this example : \documentclass{article} \usepackage[pdftex, active, floats, tightpage]{preview} \usepackage[utf8x]...
3
votes
3answers
146 views

How to make pgfplots obey non-rotated boundaries along the axes for a rotated graph?

I'm trying to rotate a simple Gaussian, but when I try to rotate the graph, it seems clear that pgfplots is simply cropping the graph to match the boundaries specified: The above picture shows two ...
3
votes
1answer
828 views

Plotting an atan function in TikZ

I have to plot the function f(x) = atan(x)-x/(1+x^2), but it won't come out right. By looking at previous questions, I have the code: \documentclass[a4paper, norsk, 11pt]{article} \usepackage{...
3
votes
1answer
451 views

axis y line*=right does not move ylabel to right

When I recompile this code from the pgfplots gallery (example_291.tex), I get the following graph which clearly does not move the ylabel to the right for the second axis \documentclass{...
3
votes
2answers
222 views

Polar plot with cartesian values, lack of angular precision in the integrated arctan2 calculation?

I noticed that for values close to 0° and 180° the angular values dramatically changes if the values are imported from cartesian data. Here the code (with cartesian coordinates plotted in polar with ...
3
votes
2answers
262 views

pgfplots - Zero lines draw over anything else, especially node/pins

For adding zero lines to every plot produced by pgfplots, I used the code provided by percusse here. (A quick note after 2 replies were provided: this is a "global" solution. If one likes to add the ...
3
votes
1answer
1k views

PGF Math Error: Could not parse input

Trying to plot a BER vs SNR function using erf function. However I get an error saying " Package PGF Math Error: Could not parse input '' as a floating point number, sorry. The unreadable part was ...
3
votes
1answer
1k views

Trouble plotting arctan with pgfplots

I'm trying to plot arctan(x) with pgfplots but I don't get a good output. Here is my code: \begin{cfigur}\begin{axis}[ width=160pt,compat=1.5.1,grid style={ultra thin},every axis plot post/....
3
votes
1answer
295 views

Why does datatool/pgfplots only plot for last row in table?

I'm trying to use datatool to put a bunch of circles on a pgfplots plot. I tried the following: \documentclass{article} \usepackage{datatool,tikz,pgfplots} \pgfplotsset{compat=1.9} \begin{...
3
votes
1answer
596 views

removing the numbering of the axis pgfplots

How can I remove the axes numbers on this plot Helix as well as the box enclosing it? Would it be possible to now add a tikz 3d axis with pgf plots? \tdplotsetmaincoords{72}{120} \begin{tikzpicture}[...
3
votes
1answer
2k views

Bell curve with multiple x-axes and annotations

I've just started working with pgfplots and I'm getting good results, but I'm having difficulties getting this one done in LaTeX: The curve itself is not a problem, but the multiple x-axes (I don't ...
3
votes
2answers
1k views

How to ensure equal font sizes in all included TikZ/pgfplots figures?

I would like to have many tikzpictures in my document. Since each tikzpicture has its own size, I don't know how to manage the font size among all the pictures. Some of tikzpictures are of size \...
3
votes
1answer
1k views

pgfplots - how to specify ticks?

I know how to specify ticks manually. But this is too much work if you have multiple plots. I am searching a way to do that automatically. What I want to specify is the number of ticks for an axis. Is ...
3
votes
1answer
368 views

setting z-limit on surfplot in PGFplots

I am making a 3D surfplot in pgfplots, and my situation is described by the following MWE: \documentclass{article} \usepackage[ansinew]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath, amsthm, ...
3
votes
2answers
240 views

Adding a x tick but not the corresponding y tick

I'm generating pgf plots on the fly and I would like to avoid adding non integer y ticks on my plots, while keeping all the x ticks. Here is a MWE: \documentclass[10pt]{article} \usepackage{tikz} \...
3
votes
1answer
309 views

Why aren't the titles ordered in the same way data is in groupplots?

I'm trying to display a few plots using pgfplots and groupplots using the following example. I take the titles of each plot from a different data file than the data itself. The data appear to be ...
3
votes
1answer
798 views

coloured fitting pgfplots

I want to fit this data with a straight line and both the straight line that the points have to follow the color of the colorbar horizontal. Another problem is that I can not adapt the grid scale.. ...
3
votes
1answer
6k views

Formatting a pgfplot graph. Thicker bars and total width

I am creating a stacked barchart with the following code. However, I have some problems. How do I set the width, of the whole thing? width= does not do it ... How can I get thicker bars? How can I ...
3
votes
1answer
80 views

How to remove the axis lines

How to remove the axis but the label should be there Eg:current output Expected output I am using the following code \documentclass{standalone} \usepackage{mathtools} \usepackage{pgfplots} \...
3
votes
2answers
79 views

PGFPlots graph is truncated, top is cut off

I'm trying to use pgfplots to plot a Maxwell-Boltzmann curve. After scouring around the internet for the density function, I've come up with this: \begin{tikzpicture} \def\kB{1.3806488e-23}% ...
3
votes
2answers
193 views

matlab2tikz spectrogram is too big

I have produced the following spectrogram in MATLAB and I am trying to import it into a LaTeX document after using matlab2tikz. I am fully aware of the issues with maximum memory etc for typesetting, ...
3
votes
1answer
266 views

How to draw this graph

It is first time for me using latex. I am trying to draw this figure . This is my code \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ ...
3
votes
1answer
156 views

Contour plot error with pgfplot and tikz

I'm trying to plot contour lines of a two variable function. I found this example here: \begin{tikzpicture} \begin{axis}[view={0}{90}] \addplot3[contour gnuplot={ labels over line,number=9}] {...
3
votes
1answer
166 views

Colormap with Tikz

What I have tried so far \documentclass[a4paper]{article} \usepackage{pgfplots} \begin{document} \pagestyle{empty} \begin{tikzpicture} \begin{axis}[view={0}{90}, colormap={custom}{...
3
votes
2answers
109 views

fairly specific cartesian graph help

I have been trying for an hour or two to draw a TikZ plot with varied results. I am trying to draw a plot whose x axis has ticks for each x unit n*(1) and each y unit n*($\sqrt{-5}$). I then need to ...
3
votes
2answers
252 views

PGFPlots: point meta colormap index as fill value

I have the following simple PGFPlots sample \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{axis}[ xmin=0, xmax=1, ymin=0, ...
3
votes
1answer
239 views

Why doesn't this example from the pgfplots manual compile?

I copied this example from page 134 of the pgfplots manual (version 1.12.1): \documentclass{article} \usepackage{pgfplots} \pgfplotsset{width=7cm,compat=1.12} \usepgfplotslibrary{patchplots} \begin{...
3
votes
2answers
81 views

Plot “timeout” with pgfplots

I'm plotting some timing results using pgfplots. The times are shown on a log scale. Each of the three techniques eventually ends in a timeout, and I'd like to show that somehow in the graph. I ...
3
votes
1answer
2k views

pgfplot | tikzpicture | changing length + width of ticks

While there are any number of posts on how to fiddle (from the Latin) with tick labels, or tick placements, or tick color, I haven't been able to find anything (in terms of worked examples, or in the ...
3
votes
2answers
262 views

Monte Carlo Method Drawing

I would like to produce a Monte-Carlo-Plot with tikz and pgfplots, similar to this: I've already tried to adapt from this thread: Filling specified area by random dots in TikZ I've tried defining ...
3
votes
1answer
620 views

get caption/subcaption every plot using groupplot pgf tikz

Hello I want to have Under each plot (subgroup plot) its caption or label, so I can also reference it in my document. Here in my example I used (a), (b), (c) I can keep them but they are not well ...
3
votes
2answers
354 views

Vertically stacked group plot with different horizontal scaling

I've 4 data sets that I'd like to present as a stack using pgfplots' groupplot library. What I'm struggling with is that the first data set has a larger horizontal range to the remaining three. I'd ...
3
votes
1answer
235 views

drawing line between plotted points

How do you have the line draw between points that have been plotted on a graph? Here's what I've done so far. \begin{tikzpicture}[>=latex] \centering \begin{axis}[ axis x line=center, axis y ...
3
votes
1answer
325 views

Is it possible to choose the base line of the ycomb?

Is it possible to choose the base line of the ycomb (vertical lines)? For example, in log scale, the default base line is at y=1 (or y=10^0). But I would like to make it at y=0 (i.e. minus infinity). ...
3
votes
1answer
199 views

Nodes Near coords hide when 0

Is it possible to hide nodes near coords in pgfplots when value = 0 ? I have something like this. And axis setting \begin{axis}[ ybar, bar width=3pt, nodes near coords ]
3
votes
1answer
338 views

PGFplots z buffer does not sort the plotted objects properly

I have a PGFplots axis environment in which I attempt to plot several line objects and a surface object. The objects have to be 'sorted' in the sense of which object is drawn before or behind the ...
3
votes
1answer
347 views

use axis of original plot in \spy plot

I use \spy in an plot. This works generally, but I want the axis in my magnification too. I attach a picture to clarify. I do not want to do this with a \node and manually calculate and add the axis ...
3
votes
2answers
338 views

Point Cloud Symbol in a PGFplot legend

I have a point cloud of data in a plot, and a reviewer commented on changing the legend entry for the point cloud from a single dot to a point cloud like or at least a few dots in the legend. However ...
3
votes
2answers
224 views

Adding label to a pgfplot

How can one include a label on the x-axis of a pgfplot. Below is a MWE. What I desire is simply to have the label -0.7 indicated on the x axis. \documentclass{article} \usepackage{tikz} \usepackage{...
3
votes
1answer
319 views

How can I add a reasonable padding to this bar chart?

I’m trying to add a uniform padding to all sides of this bar chart. In a different answer on tex.SE I have found the following code, however, I wasn’t able to find values for xmin and enlarge x to ...
3
votes
2answers
353 views

Reducing space between annotation text and the line in a pin (PGFplots)

I need to reduce the distance between annotation text and the line which together form a conventional pin in pgfplots, see the figure below. Could anybody help me with this, please? MWE: \begin{...