{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
2answers
287 views

Using pfg plots to plot unit simplex in 3 dimensions

I am trying to plot something that looks a little like this: I am using the following code: \begin{tikzpicture} \begin{axis}[ grid=major] \addplot3[ surf, ] coordinates { (1,0,0) (0,1,0) (...
3
votes
3answers
165 views

pgfplot fill one bin with color

I am using pgfplot to draw a ybar graph. It can fill color for full graphic but I wish to only fill one bin with red color. e.g. fill bin 3 with red. Current code fill all bins with red color as ...
3
votes
3answers
80 views

Text beneath two function graphics inside of a figure

Is there a way to put extra text under some function plots in the following code? I need them to appear side by side on the page in the same figure and I do not what to use an extra caption. The text ...
3
votes
3answers
209 views

Sizing a pgfplot so it fits in a multicol column

I'm very new to TeX but I'm trying to put together a document that has a multicol layout with a chart inline in the column. The chart always seems to overflow the width of the column and I can't ...
3
votes
1answer
977 views

Plotting f(x) = sin x and f(x) = cos x on pgf/tikz

I'm new to graphing on TikZ/pgf and have been trying to figure this out but can't seem to find any helpful info for what I want. I want to plot the above functions over one period, i.e. on the ...
3
votes
1answer
135 views

Display plot pgfplots multicolumns

I have the following data & I'm trying to display a plot similar to the screenshot items,section_1,section_2,section_3,section_4 10,82,42,38,22 20,38,24,20,63 30,44,49,39,40 40,58,48,47,47 50,58,...
3
votes
1answer
529 views

Footnote on graph title

I'd like to add a footnote to the graph title. After adding the footnote, it disappears! Here is my MWE: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \pagestyle{empty} \...
3
votes
2answers
2k views

Changing circle to “-stealth”

I took an example from pgfplots % Preamble: \pgfplotsset{width=7cm,compat=1.3} % [See the TikZ manual if you’d like to learn about nodes and pins] \begin{tikzpicture} \tikzset{ every pin/....
3
votes
2answers
588 views

pgfplots - lack of one bar

I want to make a chart with nine bars. As you can see they are in the code (0-8). Unfortunately it's making only eight bars. \documentclass[12pt]{report} \usepackage{polski} \usepackage{pgfplots,tikz}...
3
votes
2answers
64 views

pgfplots adding unwanted dashed lines

I'm using pgfplots to plot multiple lines, but after a certain number of lines, they seem to revert to dashed lines regardless of line style. Is there a way to fix this? The code to generate the ...
3
votes
2answers
153 views

plotting discrete signals

I would like to plot several discrete signals with pgfplots. So far, I've done the following \documentclass[border={10pt}]{standalone} \usepackage{tikz,pgfplots,filecontents,amsmath} \pgfplotsset{...
3
votes
3answers
239 views

Draw a spline with pgfplots

Is it possible to simplify the code, that is to say not to use three times the command \addplot[] ? \documentclass[tikz]{standalone} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \...
3
votes
2answers
299 views

How to insert degree Celsius symbol in node text in pgfplots/tikz?

Here is my code. \resizebox{\textwidth}{!}{ \begin{tikzpicture} \selectcolormodel{gray} \begin{axis}[xlabel=Voltage,ylabel=Current,title=IV Characteristics of PV Module] \node[label={Set 1}] at (axis ...
3
votes
3answers
136 views

Pgfplot logaxis customization

I am trying to reproduce the following picture: but currently I am able to: There are a lot of issues: log scales are not logarithmic, i.e. 256, 512, 1020, 2050. I would like to have 256, 512, ...
3
votes
1answer
267 views

Pgfplots: Add curly rotated braces to a graph

I created a simple graph of a demand function so far. Is there an easy way of addition curly rotated braces and labels to the graph (like in my sketch). Those should mark the intervals for a value ...
3
votes
2answers
805 views

Calculation of coordinates for TikZ annotations in PGFplots axis environment

I'm trying to do some annotation with TikZ in a PGFplots axis environment by means of nodes. However, the placement of the nodes is going wrong all the time, see the minimum working example below. How ...
3
votes
2answers
210 views

Draw points inside or outside of a polygon (TiKZ)

Hello I have this plot and I would like to draw two points at coordinates (3,1) and (4,4) in colour red. \begin{tikzpicture} \begin{axis}[ title={Low capacity scenario (Scenary=2)}, axis x ...
3
votes
2answers
640 views

plotting a function with smooth curves

I am trying to plot the following function The issue is I do not know what is the best setting for the coordinates. I tried different coordinates with no success. Here is my code: \begin{...
3
votes
2answers
1k views

How to align two pgfplots that are overlapping?

I'm fairly new to pgfplots. I'm trying to graph two things, and have them plot side by side. However, when I use subfigure, my plots (and axes labels) overlap. How can I fix this? \documentclass{...
3
votes
2answers
458 views

Aligning subfigures in a 2x3 grid with tikz

I have a number of plots obtained with matlab2tikz. Now I want to align these plot in a neat way. I used the subfigure package, but the result is not aligned very nice, see My latex code is: \...
3
votes
1answer
488 views

PGFplots and GNUplot with addplot3

I am trying to plot the following: \documentclass[tikz, convert = false]{standalone} \usepackage{pgfplots} \pgfplotsset{compat = 1.9} \begin{document} \begin{tikzpicture} \begin{axis}[view = {70}{...
3
votes
2answers
663 views

Create groupplot 3 x 6

I asked a similar question before: Create 2x2 groupplot with +1 plot to the side? For that time using the subfigure environment wasn't a problem. But I do not want to use the subfigure environment ...
3
votes
2answers
285 views

Add straight line beneath a plot

I would like to add straight lines beneath a scatter plot for instance in order to delimit the region where |y| < x and |y| < 2 * x. I wrote something similar to th code below which give ...
3
votes
2answers
212 views

How do I arrange diagrams in pgfplots vertically with labels?

I have two ternary diagrams I put side by side on the same page using pgfplots.How can I arrange them vertically and as well label them? An example of what I have is given below: \documentclass{...
3
votes
3answers
2k views

TikZ exits with “do not know the key '/tikz/restrict y to domain”

When I try to compile, I get the following error. Runaway argument? samples=60, domain=0:10, xmax=10.5, restrict y to domain=0:10, axis l\ETC. ! Paragraph ended before \pgfplots@@environment@axis ...
3
votes
1answer
1k views

Importing .mat file to pgfplots

I am using pgfplots to create figures, and I have a (large) set of simulation data generated from Matlab. It is in the .mat format. The data are of the form (two column) (1,0.2) (1,0.3) ... (1,0.2)...
3
votes
1answer
189 views

Compile time optimized “area under analytical curve” plotting with pgfplots?

There are some question regarding how to plot an area under a curve with pgfplots. But as far as I can see, all the answers have in common that a function has to be plotted twice with different style ...
3
votes
1answer
169 views

How to fill a rectangle with two corners on the function

I would like to be able to apply the same thing in the following figure for any function: Right now my code is like this(which is an edited version of some post here in Tex.sx): Wich only fills ...
3
votes
2answers
321 views

Use \def without including the square bracktes with pgfplot?

I would like to define a line style to use in my pictures. But would still like to retain the flexibility to be able to tweak these if needed in the actual picture, as in the third picture (...
3
votes
1answer
1k views

Can't replicate this graph using TikZ

I'm having trouble replicating this graph I know it's silly to do a graph with so little info, but my teacher demands it.. go figure... I can't seem to make the bars stick together. It's my first ...
3
votes
1answer
78 views

Plot that shows that largest root tends to 1

I am considering x^{i+2}-x^{i+1}-1. As i goes to infinity, the largest root tends to 1. I would like to have a plot in latex, for example with pgfplots, that shows this, maybe one could plot the ...
3
votes
1answer
106 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
140 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
149 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
1answer
601 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
428 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
869 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
145 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
780 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
431 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
219 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
282 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
581 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 \...