{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

4
votes
1answer
420 views

pgfplots: using macro for tick label

I would like to use a macro to define the label of an extra tick in a pgfplots picture. When the macro uses a greek character it generates an error: ! Missing \endcsname inserted. Here is my MWE: ...
4
votes
1answer
528 views

Missing mark at legend for tikz bar chart

I have the following code: \begin{tikzpicture} \pgfplotstableread{ % Read the data into a table macro Label First Second Third test 30 30 40 }\datatable \begin{axis}[ xbar ...
3
votes
1answer
1k views

pgfplots - Number above one of the bars in the bar chart

I want to put a number above only one of the bars in the bar chart. For example, above the bar A, I want to put a number say 200. Other bars will not have any number at the top. This is my code. ...
3
votes
1answer
585 views

Externalize pgfplotstable with csv file

This is a direct follow-up question to this: Adding units to pgfplotstable header After fixing the output I tried outsourcing the table. After figuring out that standalone does not work with ...
10
votes
1answer
1k views

Group together two and two bars in pgfplots

I have a bar plot and i would like to emphasize that two and two pairs belong together. So i need some padding between Cornell Box and Conference Room, and Conference Room and Sponza. Also maybe a ...
5
votes
1answer
555 views

Draw box around plot or fill plot area in tikz/pgfplots

I want to create a plot in tikz/pgfplots with a number of \addplot table commands. Each of the tables is the result of a simulation. I need to add a box around each simulation's result or fill the ...
2
votes
1answer
1k views

Create 2x2 groupplot with +1 plot to the side?

I want to create a 2x2 + 1 plot like... ---------------------------| | Plot 1 | Plot 2 | | ------------------- Plot 5 | | Plot 3 | Plot 4 | | ---------------------------| How can I ...
4
votes
1answer
709 views

Expanding tick marks and labels beyond data set

I am looking to expand the y- and x-axis values beyond the data for visual reasons. I tried to force the ticks and labels, but it did not work. I wish the two axis to start at zero and end beyond the ...
5
votes
1answer
298 views

using symmetry of axis / point in pgfplot?

Is there a way to use symmetry of axis or a point in pgfplot? So that you have only to define half numbers of the coordinates or only one quarter? e.g. for doing things like this: with less ...
5
votes
1answer
1k views

Undefined control sequence on \frac?

I'd like to generate PDF's for some ad hoc screenshots, but I'm getting an undefined control error. I tried \usepackage{amsmath} after the line \usepackage{pgfplots} but that didn't work. I thought ...
8
votes
1answer
418 views

proper tool for charts in tex

I have scanned data graphics in a large ms written in TeX (of course). For copyright reasons I need to redraw these. My publisher may (sadly) decide not to use my source directly, so will need access ...
2
votes
1answer
542 views

pgfplots: fill the volume under a 3d surface

I have a very simple 3d graph. \begin{tikzpicture} \begin{axis}[view={60}{20}, %axis equal image=true, xlabel=$X(T)$, ylabel={$D(T)$}, zlabel={$V(T)$}, zmin=0 ] \addplot3[surf,shader=flat,z ...
9
votes
2answers
6k views

Linear regression - trend line with pgfplots

I am trying to display a trend line with pgfplots. I followed the instruction in the manual and looked around. I though I had implemented it correctly, but there is no regression line, and although ...
9
votes
3answers
2k views

draw Fourier Series Expansion with tikz/pgfplots

This is a MATLAB code T=0.3; A=0.3; t=0:0.01:4*T; n1=length(t); N=100; s=0; signal=0; for i=1:n1 s=0; for n=1:N s=s+A*4/(pi*(2*n-1))*sin(2*pi*(2*n-1)/T*t(i)); end signal(i)=s; end plot(t,signal); ...
5
votes
0answers
764 views

PGFPlots pattern bug [closed]

I tried to compile the example in How to combine fill and pattern in a pgfplot bar plot? to answer the question here PGFplots ybar patterns not showing and the pattern doesn't appear when I use ...
9
votes
1answer
668 views

Generic point labels in pgfplots

I have loads of pgfplots which have one thing in common, they all containt one or two addplot with four points that I want to label with the same labels, namely: \tau_c= n \theta. Lets for simplicity ...
4
votes
1answer
391 views

PGFplots calculations at coordinates and rescale the axis

I need to redraw some plots using PGFplots. For those plots I only have the eps file. With Inkscape I could generate a tex code and grab the points listed in the MWE. However, in the plot, the x-axis ...
7
votes
2answers
2k views

Particular bar plot with pgfplots: bar color = category

I want to create a bar plot using pgfplots. In this plot the bars should be represent categorys. So that one color suggest the category. The categorys are: 0-8 None 9-13 Minimal 14-19 Slightly ...
9
votes
1answer
1k views

Polar Plot x and y ticks and units

I'm having some trouble with polar plots. I generate the plot coordinates using Scilab and then plot them in Latex. I can't figure out how to remove the points (mark = \empty does nothing, but ...
1
vote
1answer
275 views

Automate Controls for Curves

I am looking to automate (simplify) the path drawn in blue on my MWE. I am trying to avoid nodes if possible as this is nested in a tikzpicture. Ideally I was hoping to simply specify the begin and ...
0
votes
1answer
748 views

PGFplots ybar patterns not showing

I have a bar plot graph and I want to use patterns to fill the columns. However it seems that patterns are not working. For compiling I use pdflatex or lualatex. I also wanted to use pattern width ...
6
votes
1answer
867 views

Making one bar in a bar-graph stand out pgfplots

I have a grouped bar-chart, in which I would like to highlight in some way the two bars corresponding to EU-24. Perhaps by giving them a different colour, or pattern. Does anything jump to mind? ...
6
votes
1answer
786 views

PGFplots marks mandatory for 1st and last point

I want to plot values from a big table. Since it has too many numbers, I want to draw the line and only some marks (because there is other lines in the plot, therefore, to avoid confusion). I know ...
2
votes
0answers
53 views

pgfplots: Plot around a Pole of a rational function [duplicate]

I'd like to use pgfplots to plot the function (x-1.2)*(x-3)*(x-4.8)/((x-1)*(x-5)) for x-values from 0 to 6. However, pgfplots does not seem to want to show me the whole plot - it doesn't show anything ...
4
votes
1answer
211 views

How not to draw the first/last marker

I have to plot multiple lines in the same figure, using different markers to discriminate them. All these lines start from point (0,1) and end in (1,0) that are also the limit of the axes. I'd ...
5
votes
1answer
954 views

Rectangular spy in pgfplots without scaling

I'm trying to copy the behaviour of this question: Using tikzlibrary spy without magnifying line width and/or mark size. I would like to change the shape of the spy to rectangle, but I'm failing at ...
6
votes
1answer
3k views

Calculate numerical value for node text in TikZ

I am using a tikzpicture environment to draw a Temperature v composition plot. I do not have exact data so am only mimicking it. I am aware that I could/should use pgfplots but the issue could be ...
18
votes
1answer
21k views

How can I change the legend's location in a pgfplot?

For a report I am preparing several figures that I exported from Matlab using the matlab2tikz script. However, the location of the legend does not please me. Here is an example plot: I want to move ...
5
votes
1answer
560 views

Making a log plot with negative values “continuous”

I'm trying to plot some data on a log axis using PGFplots. The data include negative values. Obviously, these can't be displayed on the plot, but I'd like the plot to "run into" the lower edge to ...
4
votes
1answer
257 views

PGFPlot/Tikz Legend Error

I wish to add a legend to my two plots - red and black, but the legend seems to have some scaling issues. I think it may be due to the changes made in shifting and domains, but I am not sure! ...
3
votes
0answers
50 views

Tikzpicture: Fill refuses to work with integer node names [duplicate]

I want to create a 3D-grid of named nodes using nested for loops and then fill some polygon based on the names. For some reason tikzpicture doesn't fill the polygon, although it draws the path ...
4
votes
1answer
571 views

FOSS for real-time PGFPlots

Any FOSS for real-time PGFPlots? Is it worth opening a feature request for KtikZ (QtikZ)?
0
votes
2answers
324 views

LaTeX: plotting function, formatting axis

I've got some problems with plotting a function in a diagram with logarithmic axis: I doesnt give me any errors, but I don't see a graph. Do I need to include any other package? \begin{tikzpicture} ...
8
votes
2answers
796 views

overlapping labels in tikz

This might be closed for being too localised, in which case I don't know where to get help from but here goes. I am drawing a histogram with Tikz (using the ybar interval bar chart) and labelling the ...
0
votes
0answers
32 views

externalizing the caption together with legend [duplicate]

I have the following plot: \begin{figure} \centering \begin{tikzpicture} \begin{axis}[ scale only axis, width = 0.8\columnwidth, height = 0.8\columnwidth, enlargelimits = 0.15, xlabel = {\# Classes ...
7
votes
1answer
2k views

Pattern in \addplot inherits dashed option from previous \draw

I want to fill the area between two curves with a pattern, let's say horizontal line. Since I want some other dashed lines below these curves, I use \draw[dashed] and then \addplot[pattern=horizontal ...
8
votes
1answer
656 views

Error when creating a surf plot with matlab2tikz

I'm using matlab2tikz to generate the tikz code for my figures. When compiling the document with the figure code as below, i get an error: Package pgfplots Error: No such element: ...
12
votes
3answers
808 views

Draw a cylindrical spiral with TikZ

I want to make a tikzpicture to illustrate the construction of a spiral capacitor. These are made of spiral coiled films. So imagine a rectangular paper that you tail around one side. Thats basically ...
4
votes
0answers
52 views

pgfplots: How to move bar labels [duplicate]

2 questions: 1) How do I move my data labels to the center of my bars? 2) How do I make the labels be purely data labels, and not cumulative values? eg I want the red bar labels to be the value of ...
7
votes
1answer
438 views

PGFPlots append text to all contour labels

Is it possible to append a text suffix (in my case a unit) to all labels in a PGFPlots contour plot? For example, consider the following plot: \documentclass{article} \usepackage{tikz} ...
2
votes
1answer
773 views

Nodes near coords gives Undefined Control Sequence

I have the following example of a graph. I want to place the items in the table "Restart" next to the nodes. Everything works until I add "nodes near coords", I get a bunch of errors saying "Undefined ...
6
votes
1answer
1k views

Semantics for parametric plots with pgfplots

I wasn't able to find in the pgfplots manual the exact semantics for pairwise mathematical expressions. Could you clarify the following variations? % Assume x(t) is parametrized by t in [0,1] and ...
7
votes
1answer
6k views

pgfplots scale legend position when below xlabel

When using matlab2tikz to generate a .tikz from Matlab where the legend location is set to 'SouthOutside' (below the ylabel of figure), the position of the legend will cover the ylabel unless the ...
8
votes
1answer
741 views

How to reuse the plotmark styles from PGFPlots outside the tikzpicture environment?

In a figure caption or in the main text I want to reuse the style of the plotmarks or the combination of line and symbol as in the figure legend. As I did not find a command to reuse the legend image ...
2
votes
0answers
42 views

How to add PGF plot marker separately to document? [duplicate]

Say I have some PGF plot, which uses some custom plot markers, for instance: \newcommand{\scaleofcirc}{0.85} \pgfdeclareplotmark{manualcirc} { ...
8
votes
1answer
2k views

New line in pgfplots/tikz not displaying in TeX

I have a multiple-line legend entry to preserve the width of my figure. I can use \newline in Matlab and the legend entry is split between two lines. When I produce a .tikz of the figure however, I ...
18
votes
1answer
4k views

Simpler boxplots in pgfplots - is this possible?

When I wanted to plot boxplots in pgfplots, I started using the solution proposed by Jake in the question linked to above. However, as I wanted to plot more than one set of boxplots in the same figure ...
20
votes
5answers
9k views

Can I use pgfplots to make a boxplot

My current plotting tool for my papers is pgfplots for nice consistent plots. Now I would like to add a boxplot. Is this possible with help of pgfplots, or any helper package?
1
vote
1answer
405 views

Add labels to y ticks in bar chart [duplicate]

I'm just starting to mess with pgfplots and just had a quick question in formatting bar charts. Specifically, I was trying to add labels to each of my y ticks and i couldn't figure it out. ...
7
votes
2answers
269 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}[ ...