{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

16
votes
1answer
823 views

TikZ datavisualization or pgfplots? [duplicate]

I want to create a few plots that should have the same style as my main document and it seems tikz is more than capable of achieving that. Now while browsing the current tikz documentation (2.10 ...
4
votes
2answers
431 views

Why do I fail to import external 3D plots with pgfplots?

I have tried to import external 3D plots from Matlab et.al, but to no avail. To show what I managed to accomplish, I present a minimum non-working example below. Any ideas of what I'm doing wrong? ...
1
vote
0answers
37 views

Extract x and y coordinates when using intersectionlibary [duplicate]

Possible Duplicate: Coordinates of intersections I have the following minimal plot \documentclass{standalone} \usepackage{pgfplots} \usetikzlibrary{intersections} ...
9
votes
1answer
2k views

How can I filter/select data from a table and plot it?

I have a table with data from a file and before anything, I sort the data. Then I would like to filter only the rows that have a specific value. There has been a similar question which almost contains ...
4
votes
1answer
318 views

How to have extra row of tick labels appear only once per row of plots?

This is a follow up to How to add another row of tick labels? I currently have another row of tick labels for every plot in a group of plots. What I want to do is to have the descriptions for the ...
2
votes
1answer
161 views

Error when there are plotting macros before \pgfplotsinvokeforeach

Why does \pgfplotsinvokeforeach produce ERROR: Undefined control sequence. when there are plotting macros before it inside a groupplot? \documentclass{article} \usepackage{pgfplots} ...
6
votes
1answer
553 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 ...
5
votes
2answers
224 views

How to draw a plot with an axis that resets?

To show the properties of a function with two variables two-dimensionally I want to fix one variable but let it increase between plots that are placed horizontally next to each other, e.g. plot the ...
1
vote
1answer
614 views

pgfplots: plot smaller range of table and still use enlargelimits=true

I am using pgfplots to plot two simple (x,y)-plots of the same data from a table file. The first plot shows all of the data points and in the second plot I want to zoom in on some specific range of ...
1
vote
0answers
43 views

pgfplots: How to change the alignment of one single node [duplicate]

Possible Duplicate: How to display labels on points of a tikz plot I plot a scatter plot using pgfplots and automatically label every single mark with its description. When two marks are ...
5
votes
2answers
1k views

PGFPlots: line opacity gradient?

Imagine a very simple PGFPlot, e.g.: \begin{tikzpicture} \begin{axis} \addplot+[no marks]{x^2}; \end{axis} \end{tikzpicture} How can I have the line "fade out" from the left to the right of the ...
8
votes
1answer
1k views

pgfplots black and white line graph

hi refered the pgfplots user manual but found no instructions as to how one can proceed with creating a black and white line graph. My graph is as follows \begin{figure}[H] \begin{tikzpicture} ...
8
votes
1answer
451 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: ...
7
votes
2answers
882 views

TikZ/PGF: Simple function is not plotted. Where is the mistake?

I'm just starting to learn TikZ/PGF. I would like to draw a simple function, f(x) = x² to start with. \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} ...
8
votes
0answers
398 views

Switching math fonts and back to normal fails in figures?

For my current document I want to use a normal serif font for the main text. Most diagrams from other sources and myself are with sans serif fonts (TeX Gyre Heros). Now I want to use pgfplots to ...
3
votes
1answer
566 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 ...
6
votes
1answer
430 views

PGFplots, two colours under and above curve

I'm using PGF plots and would like to fill two colours to my plot. One colour indicates a positive value, while the other colour for negative values. What I have so far is one colour for the entire ...
6
votes
1answer
3k views

3D surface plots in TikZ

I need to plot a surface plot using TikZ. I have the (x,y) coordinate and the corresponding function value in a table form. I have not done 3D plots before in TikZ and hence I would appreciate any ...
2
votes
1answer
763 views

pgfplots: putting marker labels outside of the plot

the following code: \documentclass{article} \usepackage[english]{babel} \usepackage{pgfplots} \usepackage{tikz} \usepgfplotslibrary{groupplots} \begin{document} \begin{figure} ...
6
votes
1answer
558 views

Legend referencing in caption *and* externalization

I am trying to make a reference to a plot inside a figure's caption while using the externalize library. The issue of plot reference using externalization has already been raised in this question. I ...
5
votes
1answer
2k views

PGFplot histogram using multiple barplots

I'am trying to create a colored histogram using barplots using the following code: \begin{tikzpicture} \begin{axis}[ybar, ymin=0, bar width=0.2cm, axis x line*=left, nodes near ...
8
votes
1answer
485 views

remove y scaled label in pgfplot graph

I wanted to divide the y coordinate values by 1050 so i used scaled y ticks=real:1050 Here is my code \begin{figure}[H] \begin{tikzpicture} \begin{axis}[ scaled y ticks=real:1050, height=9cm, ...
1
vote
0answers
58 views

How to split y axis in pgfplots to display differing datasets in one graph? [duplicate]

Possible Duplicate: Axis break in pgfplots I'm trying to convince pgfplots to display my measurement results. It works quite well except the fact that the datasets vary in numbers. Most of ...
6
votes
1answer
1k views

how to remove pgfplots circular points

In the graph below, there are large circular point marks. Is there a way of removing them? My graph code is \begin{figure}[H] \begin{tikzpicture} \begin{axis}[ height=9cm, width=12cm, ...
1
vote
2answers
489 views

pgfplots - axis xmode/ymode in user-defined style

I would like to specify xmode and ymode for the axis with \pgfplotsset (or any other way, so that the mode can be changed by an if statement) The error message which I get is: ! Package pgfplots ...
9
votes
1answer
701 views

pgfplot: use pgfmathdeclarefunction defined function within coordinate

This code snippet defines a simple function using \pgfmathdeclarefunction (e.g. f()) and \pgfmathparse. I would like to use the defined function f() within other coordinate, e.g. (0.2, f(0.2)) vs. ...
3
votes
2answers
293 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} ...
4
votes
2answers
823 views

How do I get a % sign in symbolic x coords in pgfplots

I have some data I want to plot in a bar chart where the name on the x-axis should have a % sign in it. So this works: \documentclass{article} \usepackage{pgfplots} \begin{document} ...
6
votes
2answers
738 views

Pgfplots and beamer: how to fill the area under a curve with oblique lines (hatching) as a pattern?

This is a follow up question to Jake's solution to that post. Although I got Jake's solution there work in LaTeX document perfectly fine, I could not get it work in beamer. Here's Jake's code but ...
4
votes
1answer
2k views

Using pgfplots in beamer

I want to plot the following data in one slide %----------------------- \documentclass{beamer} \usepackage{tikz} \usepackage{pgfplots} \usepackage{filecontents} \begin{document} \begin{frame}[t] ...
7
votes
1answer
2k views

How to format y tick label into a consistent decimal style in pgfplots

I have this plots . It is generated by the pgfplots code at the bottom. For the y tick labels, instead of the one shown in the figure, I would like to have {2, 4, 6, 8, 10} by the y ticks, and a ...
4
votes
2answers
956 views

Enlarge limits by absolute value when using symbolic coordinates

How can I expand the x-axis by, say 1cm, in both directions in the following bar plot? \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ybar,symbolic x ...
4
votes
1answer
482 views

How can I mark a x-coordinate?

I made a little plot for the birthday paradox. It looks like this: This is perfectly fine, but I would like to mark x=23. So my question is: How do I get the following lime line? This is the ...
8
votes
1answer
2k views

Drawing node in tikz with both background fill and grid pattern?

Is it possible to use the grid pattern on a node but also setting a background color to it, say blue? I want to use something like \node (b) [fill=red, pattern=grid] {b}; I am aware of the ...
8
votes
1answer
893 views

pgfplots need help with complicated stacked bar chart using selected rows from data table

I'm trying to recreate this bar chart from the data table found in the MWE below. It involves doing a couple things that I can't figure out: stack positive and negative bars on the same axis, ...
5
votes
1answer
208 views

How to reference plot in legend?

I want to reference a plot in the legend. The problem is, that the little legend image from the blue plot is shown distorted in the legend. Here a minimal example: \documentclass{minimal} ...
4
votes
1answer
580 views

How to sort table for plotting with pgfplots?

Is it possible to sort a table at the point that is included in a pgfplot. In the example below, the point x=3 and x=4 are ordered for plotting. I am looking prefereably for an 'in-place' solution, ...
10
votes
3answers
2k views

Disabling the arrows that appear in pgfplots on the axes

By default in PGFplots, when axes are only shown in the bottom left corner, arrows appear at the end of the ends of axes lines. How can I change the defaults so these arrows do not appear? Edit: ...
2
votes
1answer
593 views

Automatic data recognition and plot processing in pgfplots

I am a beginner in LaTeX, trying to use it for industrial documents, such a measurements report. One example is the true position graph of the MWE. The circle represents the true position tolerance. ...
5
votes
2answers
879 views

PgfPlots with labeled plots extend outside the graph box

Sorry for the confusing title. The MWE \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture}[scale=0.75] \begin{axis}[ylabel=Y-Axis, xlabel=X-Axis, ...
6
votes
1answer
500 views

PgfPlots Vertical Asymptotes Are Cut Short

The following MWE \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture}[scale=0.75] \begin{axis}[ylabel=Y-Axis, xlabel=X-Axis, xmin=0.000, xmax=0.9, ...
6
votes
3answers
1k views

Use TikZ foreach variable in node

This MWE \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture}[scale=0.75] \begin{axis}[ylabel=Y-Axis, xlabel=X-Axis , xmin=2, xmax=10, ymin=0, ymax=12, ...
8
votes
1answer
3k views

PgfPlot with Y-axis only on the right hand side

I'm trying to draw graph similar to the one below with the Y-axis only on the RHS. The following MWE produces something close the desired result: \documentclass{standalone} \usepackage{pgfplots} ...
1
vote
1answer
943 views

TikZ Label multiple plots outside of axis box

I'm endeavouring to make a graph similar to the following using PgfPlots and TikZ. I can make all of this work, except for the placement of the R=2, R=3, R=5, and R=10 markers on the left-hand ...
5
votes
1answer
541 views

PGFPlot formatting help

I have the following pgfplot: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{every axis legend/.append style={ at={(1.05,1)}, anchor=north west}} \begin{document} \begin{tikzpicture} ...
12
votes
1answer
4k views

pgfplots using strings *from data table* as x axis labels in bar chart

I've seen some of the other threads on using strings as x axis labels, but nothing that fits my situation. I'm trying to create a bar chart from a CSV file. I can do it so long as everything in the ...
5
votes
1answer
1k views

Package pgfkeys Error: I do not know the key '/tikz/ '

I have an error when I want to compile the LaTeX code below when I set \var to 1. Otherwise I have no problem. The error I got is: Package pgfkeys Error: I do not know the key '/tikz/ ' Could you ...
30
votes
2answers
4k views

What is the clearest way to graph a piecewise function?

I have a function defined as: How can I graph that using functions instead of coordinates? I'm currently working with pgfplots but I'm open to something else if it's better.
2
votes
1answer
508 views

Create a ybar interval from given bar widths

I am collecting data using the NASA Task Load Index, which gives 6 scales and has a weight associated with each scale. I am trying to plot the mean value for each scale using a ybar interval graph, ...
4
votes
1answer
590 views

How can I produce a mosaic chart / Marimekko chart?

I would like to make a stacked ybar plot with three stacked components on each bar, with each component divided vertically into three percentage components (the total width of these components stay ...