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

Weird axis number placement in pgfplots

I'm having a problem with my axis. I'm not entirely sure axis is the right word, but take a look at the output and you will understand Upper right corner, first of all, the multiplier 10^-3 is placed ...
2
votes
0answers
65 views

pgfplots: gnuplot fails to plot series [duplicate]

I want to plot a function containing a (converging) series. To plot this function I changed the series to a finite sum. \documentclass{standalone} \usepackage[utf8]{inputenc} \usepackage{tikz} ...
28
votes
3answers
1k views

Tufte like axis with pgfplots

How to achieve this kind of axis with pgfplot ? Image taken from Szymon Beczkowski's awesome PhD thesis design (thesis link) I may provide you with some data to play with. ...
1
vote
1answer
69 views

Pgfplots, problem with pin and [francais]{babel}

When I don't use babel package, pins are ok. I suspect there is a problem with the colon, in french we put a space before and after, but how to tell pgfplot not to do it? \documentclass{standalone} ...
1
vote
1answer
453 views

Plotting a function when date coordinates are used (pgfplots)

I want to plot a simple function on a plot where date coordinates are used in x but it seems that pgfplots cannot accept both. Here's a MWE of what I'm trying to achieve: \documentclass{standalone} ...
6
votes
1answer
172 views

Graph with date x-axis: How to show non-military time?

Sample code: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \pagestyle{empty} \usepgfplotslibrary{dateplot} \begin{document} % requires \usepgfplotslibrary{dateplot} ! ...
4
votes
1answer
64 views

compilation error with `legend entries={…}` and `y filter/.code={…}` [duplicate]

The following example doesn't compile, unless I remove either the y filter/.code={...} or the [legend entries={...}] option: Is it a bug? \documentclass{article} \usepackage{pgfplots} ...
3
votes
1answer
131 views

filter coordinates for specific \addplot

I want to use \addplot twice and I want to filter the x values in one of them. However, x filter/.code={...} goes into the axis options and thus is applied to all \addplots. How can I select a ...
3
votes
0answers
132 views

How to scale both data and error bars in pgfplots

I am able to scale the data using the y filter option in pgfplots plot object (like here How to scale existing coordinates data in pgfplots?). However the error bars are not rescaled as expected. Is ...
3
votes
0answers
104 views

Using \onslide in Tikz and pgfplots [duplicate]

I am having trouble with using beamer's \onslide in TikZ and pgfplots. The issue I have encountered is that if I use \onslide then the specific parts of the picture I want to appear on a specific ...
4
votes
1answer
539 views

pgfplots: filled markers without border

I am trying to draw a PGF plot with markers only. I want the markers to be filled squares, but pgfplots keeps adding a differently colored border to these marks. How can I stop that from happening? I ...
9
votes
2answers
285 views

pgfplots function x^(0.5) skipping first sample, sqrt is not

In the following example, you will see that the sample at (0,0) is not drawn using x^(0.5) (blue), with sqrt it is (green). How can you explain that? \documentclass{standalone} \usepackage{pgfplots} ...
1
vote
1answer
325 views

Force 10 base multiplier

How can I get a 10 base multiplier at every tick? I only get 1 multiplier that has a strange position scaled y ticks={base 10:-3} I can't recreate it right now, however by default I got the lowest ...
0
votes
0answers
53 views

x axis label on pgfplot [duplicate]

Hey all! I can't get rid of the 10:2 base at the x axis. I tried changing the precision, defining the ticks manually via xticks={...}. Everything works well on the y axis, I just can't figure out ...
3
votes
1answer
443 views

pgfplots: how to load distinct symbolic ticks/labels from file?

I want to plot a matrix of color-values from a csv file. Inspired by this website, I set out to write my MWE below, to which I added this way of dynamically loading symbolic ticks/labels from my data ...
3
votes
1answer
149 views

pgfplots: `nan` in `meta expr` causes “Missing number” error

I want to draw a table/matrix of color-values, where some of the values are missing. Despite having tried using unbounded coords=jump (see this answer), I get the following error: ! Missing number, ...
3
votes
0answers
132 views

tikzscale and \tikzsetnextfilename

I'm using Windows 7 or 8.1 with MiKTeX 2.9. I still have the problems, described here and here. I updated the packages with the package manager and I use \documentclass{report} ...
3
votes
1answer
331 views

Label for y-axis on both sides of a pgfplot

Is there an easy way to have two y-axis labels, on both the left and right side of a pgfplots ? It is possible to create two overlapping axes, however this isn't a nice solution. Is it possible to ...
8
votes
1answer
107 views

Fixed position for pgfplot area

I use pgfplots to generate graphics for a beamer presentation. The graphics are placed on consecutive slides. This works great, but the graphic position is slightly moving from slide to slide, which ...
4
votes
1answer
198 views

pgfplot number format: scientific notation on ticks, without factor 1

I have a pgfplot that is supposed to give me only a colorbar, no other plot. My code was inspired by this question. The logarithmic colorbar code was recycled from this answer and this answer. The ...
8
votes
1answer
185 views

legend looks strange for joint line and bar plot in pgfplots

I am trying to draw both a line plot and a bar plot in the same plot. However, the legend for the line plot looks wrong. Question: How do I make the legend look like the legend for a regular line ...
4
votes
2answers
279 views

pgfplots: use `colormap` color for `jump mark` line

I have a ybar interval pgfplot with variable width intervals. On top of each interval I am drawing a line with the interval's width (using a second plot with jump mark left). However, I cannot find a ...
2
votes
1answer
301 views

pgfplots: marker size relative to interval size

I am trying to create a ybar interval pgf plot with horizontal lines as markers on top of each interval/bar. Intervals widths are specified by my external CSV data file. I defined my own plotmark ...
3
votes
1answer
214 views

Cyrillic text in symbolic x coords

I make bar plot with pgfplots: \documentclass{report} \usepackage[T2A]{fontenc} % Поддержка русских букв \usepackage[utf8]{inputenc} % Кодировка utf8 \usepackage[english, russian]{babel} % Языки: ...
5
votes
4answers
2k views

How to compute an histogram (plot bars) binning the values from a .csv using TeX?

I've a .csv with a column of acquired measures. I would like to make the histogram bins using TeX from the measures distribution so I have to create the bins first. I haven't found any reference to ...
9
votes
2answers
297 views

Adding to a \foreach variable in pgfplots

How can I say sum multiple columns of a table using y expr while also using \foreach I was hoping something like this would work but apparently it requires some sort of expression evaluation I can't ...
1
vote
1answer
353 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
122 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
116 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
113 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
187 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
187 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
152 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
24 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 ...
7
votes
1answer
606 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
91 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
759 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
189 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
103 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
178 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
252 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
186 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
528 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
120 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
560 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
314 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
156 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
92 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
666 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
122 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 ...