{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

1
vote
1answer
212 views

Place vertically centered legend to the right of groupplots

I want to place the legend to the right of groupplots using the pgfplots package, and for the legend to be vertically aligned at the center. In other words, I want the legend to be placed at the point ...
3
votes
1answer
99 views

Markers (xtick) in PGFplots with higher precision

Graphic The following MWE shows a figure with all identical axis markers (because the scale is too narrow). The option xtick has not "high enough precision". MWE Code I did not find a suiting ...
3
votes
1answer
92 views

Groupplots become misaligned with axis equal image

I have several images I want to align in a groupplot environment. All of the images have the same width, whereas the images fall into two categories when it comes to height, one with "small height" ...
0
votes
1answer
86 views

Failed to put two functions in one graph [duplicate]

I was trying to put two plots of different functions in one graph, but the second one didn't show up in the graph. Does somebody see the mistake? Here is the code: \documentclass{article} ...
1
vote
1answer
156 views

Tikz won't plot the function properly

I tried to plot the following function but it didn't work: y = 300 + 1000/x + 2.5x. This is the document, but instead of the plot it only shows the axis. \documentclass{article} ...
2
votes
2answers
127 views

Linewrap in legend in pgfplots [Solved]

I try make plot with long text in legend. \documentclass{report} \usepackage{pgfplots} \pgfplotsset{ every axis legend/.append style={at={(0.5,-0.13)},anchor=north,legend cell align=left}, tick label ...
4
votes
1answer
129 views

How to plot the following function using Tikz

I am new to LaTeX and I want to know how to plot the following function using TikZ: y = 300 + 1000/x + 2.5x. at the interval 0:250
2
votes
0answers
22 views

Xticklabels with exponential to the end of the axis [duplicate]

I've this problem with tikz package. I'm creating a plot in the x-range [0; 10000] (in my real plot, up to 100000) but the xticklabels are in the form [0, 0.2, 0.4, 0.6, 0.8, 1] and at the end of the ...
6
votes
1answer
409 views

Polar pgfplots radial axis tick labels

I want to overlay Cartesian axes on a polar plot. The vertical axis sits on top of the polar radial (horizontal) tick label. How can I move the tick label(s) so they are below the horizontal axis or ...
3
votes
0answers
79 views

How to automate right node alignment for labels from table AND marker size AND marker color of scatter plot?

Problem: Labels from table are placed right, but overlap. Is there a way to automate alignment of the labels near nodes so that labels do not overlap? This is a small example but I have bigger table ...
7
votes
1answer
602 views

Plotting experimental data using data files with 5 thousand lines?

I want to illustrate various experimental data in my thesis e.g.: X-ray powder diffraction data (thousand lines) FTIR data (5 thousand lines) TG-/DTA data (5 thousand lines) and I am wondering ...
4
votes
1answer
156 views

xticks steps using Pgfplots / dateplot

I am using pgfplots to plot the following diagram with monthtly data over 20 years. However, I am not quite satisfied with the labels on the x axis. I'd like to have steps of say 3 years (e.g. 1994, ...
3
votes
1answer
87 views

How to save a list as a macro for pgfplots

I want to create and store a list then use that list in a pgfplots scatterplot. My attempt is \documentclass{standalone} \usepackage{pgfplots} \begin{document} \newcommand{\listA}{ (1,2) (2,3) ...
3
votes
1answer
142 views

plot pgfplots graph similar to facet_wrap from ggplot2

I need to plot a 2x2 grid of graphs as shown below: Note: The above graph was generated using the ggplot2 library from the statistical programming language R. Graph taken from link. Here are the ...
7
votes
2answers
170 views

Spacing between image and text in pgfplot legend

Using the following code: \begin{tikzpicture} \begin{axis}[ xmin=0, xmax=4, ymin=0, ymax=10, width=9cm, height=6cm, legend style={draw=none}] \addplot[only marks,color=red] coordinates { (0, 10) ...
3
votes
1answer
133 views

Marking (multiple) intersection points sinus function and constant function

The intersection of a sinus and a constant function, has multiple results. So my question is how to mark these points. My code \documentclass[11pt,a4paper]{article} \usepackage{geometry} ...
5
votes
1answer
249 views

Does pgfplots ignore the minor grid?

I'm trying to plot an easy function and I would like to enable the minor grid. But it seems that this instruction is ignored. I used the grid=both option but it has no effect. The only grid I can see ...
5
votes
1answer
106 views

Plot using pgfplots from a text file in long form (vs wide form)?

In the statistical programming language R, there are two different forms to represent data. The wide form looks like the following: subject time age weight height 1 John Smith 1 33 90 ...
5
votes
1answer
427 views

unit circle sin(x) radians on x-axe [duplicate]

Adapting the code from another question, but still having one problem: \documentclass[11pt,a4paper]{article} \usepackage{tikz} \usepackage{tkz-euclide} \usepackage{pgfplots} \usetikzlibrary{calc} ...
0
votes
1answer
203 views

Import selected rows without header in pgfplots

Import of selected rows of a data set (without header line) The import should make use of the column numbers instead of row headers. The pgfplots' manual presents the possibility to use the command ...
2
votes
0answers
136 views

Histogram improvement or to plot histogram in 3D

I have created this histogram! I wanna ask: Can I further improve it as at one "normalized frequency, 41" I have two "frequency shift values, 4 and 11"? Is it possible to plot such histogram in 3D, ...
6
votes
1answer
79 views

Incorrect plot values using pgfplots

I'm trying to plot the following function: \begin{tikzpicture} \begin{axis}[ ymin = 0, width=17cm, height=19cm, grid = major, use units, x unit=mm, y unit=j.u, xlabel=x, ylabel=I] ...
6
votes
1answer
519 views

Single stacked bar, values and legend

\documentclass{article} \usepackage{pgfplots} \begin{document} \pgfplotsset{testbar/.style={ title=strookdiagram sporten, xbar stacked, width=10cm, axis y line*= none, axis x line*= bottom, ...
1
vote
0answers
102 views

inserting tikzstyle objects into sty files [closed]

I am trying to put a tikz object (pie chart) into the sty file so it will update its shape as the presentation proceeds (instead of \insertframenumber/\inserttotalframenumber). the code for the pie ...
4
votes
0answers
221 views

Multiple ternary plots and pie charts in pgfplots

I'm trying to plot lots of ternary plots and pie charts. Ideally it should look smth like this: The pie-chart (ternary plot) on the left-hand side serves as an explanation of what is happening, ...
7
votes
3answers
284 views

histogram + frequention polygon

This is my code \documentclass[11pt,a4paper]{article} \usepackage{tikz} \usepackage{tkz-euclide} \usetikzlibrary{calc,intersections,through,backgrounds,snakes} \usepackage{pgfplots} ...
4
votes
2answers
98 views

Reuse a series style in PGFplots

I have a lot of PGFplots in my document with a consistent style throughout, managed through a shared cycle list. Now I'd like to re-use a previous plot style within the same PGFplot. As an example, ...
7
votes
2answers
161 views

Using plot instead of text in pgfplot legend

I am curious if it is possible to use a custom image (e.g. plot) instead of text inside the legend of a chart generated with pgfplots. Specifically, given this MWC: \documentclass{standalone} ...
1
vote
0answers
116 views

PGFplots - bold nodes only at ticks

The following code produces the diagram below: \begin{center} \begin{tikzpicture} \begin{axis}[date coordinates in=x, axis background/.style={fill,bottom color=gray!50,top color=white}, ...
3
votes
1answer
189 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 ...
6
votes
1answer
93 views

Strange result in plotting data using pgfplots

I'm trying to plot this: \begin{tikzpicture} \begin{axis}[ height=5cm, width=\linewidth] \addplot[smooth,blue] plot coordinates { (27,177) (28,223) (29,240) (30,227) ...
3
votes
1answer
263 views

Latex fonts causing “Undefined control sequence” error in pgfplot

I am trying to modify the font size of some text labels in a pgfplot graph I'm playing around with, but it seems pgfplot doesn't understand certain font sizes such as \normal etc. Yet the pgfplot ...
1
vote
1answer
192 views

Positioning of node label in pgfplot

I am using pgfplot to make a 2D plot with the nodes labelled. However, some of the text labels interfere with each other as they're too close. The default positioning of text labels in pgfplot seems ...
9
votes
1answer
405 views

Plot a triangular grid inside of a hexagonal grid?

I have made the following grid: With the following code: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{shapes} \begin{document} \begin{tikzpicture} [hexa/.style= ...
7
votes
1answer
173 views

pgfplotsset{compat=1.9} causes y=0 error bar to disappear

I am producing a stacked bar chart or two series with error bars that describe the uncertainty in their sum. I apply the error bars as properties of the second plot. If I use ...
1
vote
1answer
99 views

Reduce vertical distance of “above right” to label a plot

How can I label a plot using above right but with reduced vertical distance? I tried a syntax like above right= value1 and value2 but this isn't working for me. For example in the following plot: ...
6
votes
1answer
70 views

Reference to pgfplot with margincap

I was using references to parts of a pgfplots plot, which worked perfectly. However, when I changed the document to use margincaps, this breaks: I get a warning that one reference is undefined, and ...
11
votes
2answers
442 views

How can I create a polar plot on a Cartesian grid?

I'm currently using tikzpicture and pgfplots to plot this polar function: \documentclass{article} \usepackage{pgfplots} \usepackage{tikz} \begin{document} \begin{tikzpicture} \begin{polaraxis} ...
3
votes
0answers
194 views

pgfplots 1.9 on Mac [closed]

I have an iMac with TeX Live 2011. It came with pgfplots version 1.4, which I am able to use without a problem. I just downloaded pgfplots version 1.9 which has new environments like polar axis, smith ...
5
votes
1answer
82 views

How to prevent extra yticks within a Tikz Grid?

I created a nice scatter diagram based on the example at http://www.dgsiegel.net/news/2011_12_05-creating_beautiful_graphics_with_pgfplots. The problem I have now is that in order to show all the ...
5
votes
0answers
174 views

Tick labels in pgfplots data time format

I tried to plot a data set containing seconds and milliseconds with pgfplots. I’ve found a solution for my task here (pgfplots data time format), which I changed a bit. This principally works very ...
2
votes
0answers
127 views

How to make a tidy grouped and stacked barchart?

I found this chart in a recent paper. I've emailed the author about it but they didn't reply. I want to create something similar but I don't know what the correct software to use is. I need the ...
3
votes
0answers
114 views

How to color groups of bars in a graph, coming form an external file?

I have a graph displaying bars and error bars, the numbers comming from an external .dat, being simply black and white. And this is how I got there: \documentclass[12pt]{report} ...
5
votes
1answer
106 views

labels disappearing in pgfplot bar chart

Only the third label appears for this bar chart. If I put only one data row, the label shows up fine. If I put two data rows, both the labels are hidden. If I put three data rows (as below), only the ...
2
votes
1answer
141 views

How to define optional arguments for custom pgfplots style

I see from other question that it is possible to create styles with parameters. Like \pgfplotsset{ custom style/.style 2 args{ % code that uses #1 and #2 } } However, I can't find a way of ...
6
votes
2answers
331 views

Path with complicated colormap in TikZ

I want to draw a path in tikz whose local color is a function of position. Here are two examples of what I have in mind: I found the answers from Path following color gradient in TikZ very ...
3
votes
1answer
78 views

Label placement in pgfplots

I want to have the label arrows look that I get when using axis lines=center but I also want my x and y label to be on the outside of the plot and not inside the actual plot area. I have been looking ...
0
votes
1answer
209 views

How can I draw with coordinates of intersection in pgfplots?

When using pgfplots, the command \pgfgetlastxy works well without axis environment and with axis environment set as default. But it is hard getting the correct coordinate of intersecting, when ...
2
votes
1answer
447 views

Collapse range in x-axis with pgfplots? (break x-axis)

I want to plot data from a table file. The data has quite big gaps in the x-axis, making the actual data barely readable. Is it possible to tell pgfplots to kind of collapse the x-axis in a given ...
5
votes
1answer
149 views

Horizontal lines in bar plots without first line

I'm starting to learn pgf-plot and this is my first plot: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \begin{document} \begin{tikzpicture} \begin{axis}[ ybar, ...