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

Animate several pgfplots with different value

I have come to look on how to draw a student law with Tex and I have been very pleased with the first answer I found here Nevertheless, I found that the animation displayed in the first answer is ...
0
votes
0answers
33 views

Precompile pgfplots

I have a latex document that includes a lot of plots built with pgfplots. As of now, I just include a tikzpicture that loads the plot data from a CSV file. This is starting to take up quite some time ...
4
votes
1answer
291 views

pgfplots: Plot only parts of table and in “random” order

I have been lurking around stackexchange for a long time and so far been able to find solutions for my newbie problems but now I'm really stuck! My problem is probably not that complicated, yet a bit ...
1
vote
1answer
32 views

Matlab2tikz breaks major tick weight

matlab2tikz breaks my tick weights on both x-and-y axis. The figure in MATLAB looks like following. After running it through matlab2tikz with all possible known options of ExtraAxisOptions, I ...
3
votes
1answer
89 views

Basic Bar Plot with long text legend, horizontal guides and percentage values

I am new to pgfplots and actually I want to create something pretty basic. Yesterday, I started modifying my chart with the help of the pgfplot manual and the help of Google but unfortunately, I ...
2
votes
1answer
46 views

How to have unconnected points on a plot?

I'm trying to create a graph which has all of the datapoints from an inline table plotted, without a line connecting them, but still having the points on the graph. The issue with the MWE is the line ...
2
votes
1answer
51 views

2x2 Array of PGF Plots

How would I properly layout 4 PGF plots on one page. Currently I have the plots spaced horrifically, and am not sure how to correct the problem. Ideally, I would like all 4 plots on one page, but even ...
3
votes
1answer
212 views

pgf-plot: y-axis shows comma instead of decimal point

The ticks of the y-axis have to be displayed with a decimal point instead of a comma. I have no idea how to do that. I'm using \usepackage[english]{babel} and even the commad \decimalpoint does not ...
2
votes
1answer
128 views

How to remove the border in axis with pgfplot?

As illustrated in the circle in the image, there's a little gap between the 0 and the border. How can I remove that little gap? MWE Sample code to generate above plot % in preamble ...
2
votes
0answers
59 views

Why the `.tex` file is running indefinitely in PdfLaTeX?

I am using the following code to plot a set of graphs from the experimental data given in book1.txt. This .txt file is also kept in the same folder along with .tex. My book1.txt file is A B ...
1
vote
1answer
144 views

Embedded axis Pgfplots

So I need to display data as follows: every day for a month I have a set of values obtained in different hours. I want the axis to contain the date but between a date an another I want to have the ...
4
votes
1answer
112 views

I am trying to plot area vs volume

I am writing a lab report in chemistry discussing the surface of catalysts. I want to show that area doesn't increase proportionally to volume. I have been trying to plot a function vs against another ...
3
votes
1answer
123 views

pgfplot error bar in foreground

I would like to get the error-bar of the lower y-bar ontop of the stacked bar. Which command can I use to get the error bar to the foreground? Thank you in advance. ...
4
votes
1answer
50 views

Producing x and y-intersections automatically

How does one produce a picture of a function (say, a polynomial) and indicate the $x$- and $y$-intercepts automatically? I have some code that produces 1 of the $x$-intercepts and the $y$-intercept, ...
2
votes
1answer
54 views

Place multiple external images in a PGFPlots axis from a PGFPlotsTable

I am trying to create an environment in which I can place several georeferenced images into a PGFPlots axis. I have working code that reads in the specified image, reads in the world file (a text ...
4
votes
1answer
52 views

Problems with pgfplot and multiple graphs

I've been trying to do this there's a few days and the following code was the best that I got until now. This is supposed to be one graph; Because I say axis y line=none the last three "blocks" of ...
3
votes
2answers
103 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} ...
1
vote
1answer
60 views

How to draw stacked area chart

I want to plot a stacked area chart. Stacked area chart => All values get stacked and the areas under the lines get's colored. Something like this: My data in a minimalistic example: ...
2
votes
1answer
41 views

Forget used ticks

This is a follow-up question of pgfplot dateplot discrete dates on axis, which is answered by Peter Grill. The solution for plotting discrete dates is to use only unique dates. However, when making ...
3
votes
1answer
87 views

Bar diagram strange behaviour

My code is: \documentclass[border=10pt]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[title = some title, xbar, y axis line style = { opacity = 0 }, ...
2
votes
1answer
41 views

How to add two waveforms in pgfplots

In my example code given below, I have two plots. I wanted to add a third and fourth plot that is the sum and then product of the original two plots. Is there a simple way to do this in pgfplots? ...
4
votes
1answer
124 views

How to create a date and time plot with TikZ and pgfplots

What I want to achieve is a graph, which shows the working hours per day. Input should be the triple of date, arrival time and leaving time. The x-axis holds the dates and the y-axis shows the working ...
1
vote
1answer
80 views

pgfplots ybar - how to adjust spacing between sets of data

I would like to plot some data in a bar chat using ybar. The data corresponds to years on the x-axis. Now, for some years I have three data values to plot and for others only one value. The problem is ...
4
votes
2answers
41 views

Alignment of nodes with \addplot table

In the MWE below, I would like the nodes to align vertically. Giving them the same pos doesn't seem to do that. I can try to align them by adjusting the pos using trial and error but this is tedious, ...
3
votes
0answers
90 views

Position of y axis with pgfplots

I am currently trying to create a plot with pgfplots and can't seem to properly position the y axis like I want to. Here's my MWE: \documentclass{standalone} \usepackage{pgfplots} ...
4
votes
1answer
62 views

pgfplots layer issue

I'm trying to define my own layer set which enables plots above gridlines, but below the axis lines, ticks, etc. I've made the MWE based on chapter 4.27.2 of the pgfplots manual. However it's not ...
7
votes
2answers
1k views

pgfplots import data from table with comma as decimal separator

I am trying to plot data from data files which are using the comma as decimal separator instead of a point (as is normal in SI style (French version): ...
5
votes
1answer
599 views

How to produce a 3D surface plot by rotating the 2D plot of a function?

What I want to do is to produce a 3d plot of a surface of revolution. So far I have achieved the following code... \documentclass[border= 5mm]{standalone} \usepackage{pgfplots} ...
2
votes
0answers
62 views

Blurred colormap using matlab2tikz to export Matlab imagesc picture

I'm using matlab2tikz to export imagesc figures into TikZ/pgfplots code. This process gives me a TikZ file and a rasterized png version of the image with colours matching the colourbar at the time of ...
7
votes
1answer
87 views

pgfplots - disable smoothness

I am using following pgfplots to draw a simple function: \begin{center} \begin{tikzpicture} \begin{axis}[ domain=-4:4, xscale=2.25,yscale=1.125, xmin=-4, xmax=4, ymin=-2, ymax=2, ...
1
vote
0answers
53 views

PGFPlots generates extra margin with restricted x axis and two y coordinates in standalone class

I noticed that there are cases where pgfplots package makes undesirable (to me at least) margins. The conditions I've found is as follows: use standalone class use y coordinate on the right side ...
3
votes
1answer
78 views

Scatter Plot with Marginal Dot Diagram

I want to create a scatter plot that has marginal dot diagrams. I can find plenty of help on how to construct a scatter plot with marginal histograms, but not with marginal dot diagrams. Something ...
5
votes
1answer
82 views

Error 'thisrow_unavailable' with manually positionned (anchor) labels in 'tikzpicture' plot

I want to set labels with manual anchors in my graphic to allow for reading the captions and am trying to apply everything I've read so far. I have an external file for data, given below. The problem ...
4
votes
1answer
55 views

Misplaced nodes near coords in stacked ybar plot

I have this stacked ybar plot and having trouble to proper align the nodes near the coords. It works fine on all bar but the one with offset 65. I already tried \ifnum as @Jake suggested here: How can ...
3
votes
0answers
42 views

How to fill an area outside spheres?

The problem is the same as explained in my previous question: How to fill an area outside circles?. The only difference that now I need to fill the green area in three-dimensional space, i.e., the ...
5
votes
2answers
219 views

Tufte-handout caption overlapping figure

I am attempting to display three figures, side by side in a table. I've placed the table inside the figure* environment to make the table the full width of the page, however the corresponding caption ...
0
votes
0answers
34 views

Regression on a portion of the graph with columns

Based on the MWE of this question, I want to apply the regression only to a portion of the graph as in this other question, but not just the last portion. I want to do regression on the beginning so ...
27
votes
6answers
2k views

Given a list of primes, how can I plot π(x)?

Given an arbitrarily-long list of primes (or any sequence, I suppose), I'd like to calculate and plot the pairs (x, count of numbers in my list less than or equal to x) Bonus points for skipping ...
8
votes
2answers
259 views

How to fill an area outside circles?

I have the following code: \documentclass[tikz,margin=15pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.10} \usetikzlibrary{pgfplots.fillbetween} \begin{document} \begin{tikzpicture} ...
4
votes
1answer
48 views

pgfplots ignores xmin/xmax with 'axis equal' option

It seems that if I set axis equal option with pgfplots, the xmin and xmax options are not obeyed. The MWE below yields: Note that the ymin and ymax are as desired in both cases, but the limits on ...
1
vote
1answer
40 views

Change xlabel and remove title from pgfplots plot

I got the Tex file. But it is not compiling due to error \pgfplotsset{width=12cm,compat=1.12}. A minute change I want. A graph is all right but I want to replace the caption of X- axis namely " ...
6
votes
1answer
100 views

PGFplots: Logarithmic scale showing 1020 insteead of 1024?

I am trying to make a plot with a base-2 logarithmic axis and everything is turning out great, except that the labels are 32, 64, 128, 256, 512, and 1020. The last one should be 1024. I assume that ...
7
votes
2answers
195 views

How to match color of user-placed labels to contours in pgfplots?

This question is a follow-up to this one about manually placing contour labels in pgfplots contour plots produced with the contour prepared option. Briefly put, the problem I'm faced with now is that ...
6
votes
1answer
1k views

How can I add color AND a node label to a scatter plot?

I'd like to produce a scatter plot from a data file. The data file could look like this: x y color myvalue 0.5 0.2 1 test 0.2 0.1 2 uniform I'd like to ...
0
votes
1answer
70 views

Drawing a graph in latex? [duplicate]

I need help with this code It is my first time using latex \documentclass[10pt]{article} \usepackage{tikz} \usetikzlibrary{calc} \usepackage{graphicx} \usepackage{listings} \usepackage{pgfplots} ...
4
votes
3answers
411 views

Plotting matrix image data

I have data from infrared measurements in a file with 194 rows and 194 columns, each value representing the temperature at a certain pixel. As the image from the camera does not look nice, I would ...
4
votes
2answers
157 views

imagesc in tikz with non-symmetric matrices and squared axis

In principle the problem is the same like in matlab2tikz imagesc TikZ/pgfplots equivalent Can somebody tell me how to adopt this snippet to plot non-symmetric matrices but with squared axis (without ...
5
votes
1answer
129 views

Drawing function in tikzpicture

I have to draw function with \plot but it says "Dimension too large", this is my code: \begin{tikzpicture} \begin{axis}[grid=major, xmin=0, xmax=3, ymin=-1.5, ymax=1.5, xlabel=$t$, ylabel=$x(t), ...
6
votes
3answers
1k views

matlab2tikz imagesc TikZ/pgfplots equivalent

I'm using matlab2tikz to export imagesc figures into TikZ/pgfplots code. This process gives me a TikZ file and a rasterized png version of the image with colours matching the colourbar at the time of ...
7
votes
4answers
181 views

How to use colors from a pgfplots colormap in own draw

Let's consider a set of ellipses (or say a signal), here 3, but in general that might be a huge array of 64x64 \documentclass{standalone} \usepackage{tikz,pgfplots} \usetikzlibrary{calc} ...