{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
0answers
29 views

PGFPlots consistent multiplier at ticks labels

I need a little help with multiplier format in the PGFplots. The MWE is: \documentclass{standalone}% \usepackage{tikz}% \begin{document}% \begin{tikzpicture}[baseline]%, \begin{axis}[ ...
1
vote
0answers
22 views

Tikzexternalize failed in pgfplots, using TeXShop

I am dealing with a picture with a very large database. I tried to turn on the --shell-escape mode and use tikzexternalize but it doesn't work. Though I have tried so many ways suggested on the ...
2
votes
0answers
37 views

pgfplot not showing first data point loaded from external file [closed]

This is my first time using pgfplot, I'm trying to get data plotted from a file but for some reason the very first data point is not plotted. Here's the data that is written to an external txt file (...
4
votes
1answer
56 views

Embedding pgfplots' plot3 into a tikz-3dplot

I'm trying to embed a 2D Gaussian into a tikz-3dplot, but I'm having problems transforming the coordinate systems. As a simplified example, I'm plotting a plane in pgflots' \addplot3 and I'm embedding ...
2
votes
0answers
35 views

Setting the coordinate style in the environment of axis

I change the coordinate of x, errors occur. The x coordinates I want to show are 10^-3, 10^-6, 10^-9, 10^-12. By now I only write a test. In the test there are only two coordinates. It can compile ...
2
votes
0answers
21 views

Label in xbar stacked not shown

I'm using pgfplots 1.7. In the following plot the labels for the bars are not shown. \documentclass{article} \usepackage{pgfplots} %\usepackage{pgfplotstable} \pgfplotsset{compat=1.7} \begin{...
3
votes
1answer
37 views

Adding a break to y axis in a stacked bar plot

I would like to add a break to the y axis of my stacked bar plot. It looks now like this: It would be great, if it would look similiar to this, but without the mistakes: Here is the tex code: \...
4
votes
1answer
34 views

PGFPlots: Automatically forcing ticks at the end of an axis

I would like the ticks of the colormap from the first picture below to show the maximum and minimum of the data like in the second picture, in this case 1.35 and -0.26. I know I can do it through ...
0
votes
1answer
30 views

Using a comment line of a table as title?

I have data sets with tables like this one: @ DATE %s 16/06/16 @ TIME %s 17-01-45 NAME POS XY.1 10 XY.2 20 XY.3 25 Plotting and reading the table in general works with \addplot[] table[...
2
votes
1answer
41 views

fill between in pgfplots changes legend font [duplicate]

I am working on a document in which several plots are placed alongside each other. Some of them use "fill between" and some of them don't. The problem now is that depending on whether this is used or ...
0
votes
1answer
46 views

pgfplots: using a list generated with \foreach as symbolic coords

I would like to create some bar charts using pgfplots. Each chart will have a similar format, but with some different labels and values. I am trying to make a command that will generate my chart from ...
1
vote
1answer
23 views

How to get the spaces properly on the x axis, how to place the y values on the corresponding bars?

I am using the following commands to draw a barchart. \begin{tikzpicture} \pgfplotstableread{ % Read the data into a table macro Label Female Male 2006-2008 ...
0
votes
0answers
27 views

Adopt axis range from other plot with pgfplots

How can I read and store the automatically computed values of xmin and xmax from one axis and apply it to another? My use case is a plot consisting of two subplots. I have a main plot in which I plot ...
1
vote
0answers
37 views

Multiple lines plot from a CSV file

I am trying to plot a multiple lines graph (154 lines) with LaTex. This is done improving a previous code here obtained: \begin{filecontents*}{Dataset.csv} ... \end{filecontents*} \documentclass[...
5
votes
1answer
40 views

Can be \pgfplotsset named?

For example, that in a document I have a set of pgfplots images with two or three distinctive common subsets of \pgfplotsset{...}. Is it possible to write them in document preamble and in particular ...
3
votes
1answer
34 views

tikz xbar extra coordinate

I am trying to plot a comparison of numbers with \documentclass[border=10pt]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ xbar, y axis line ...
3
votes
1answer
44 views

colorbar with definite number of discrete colours; with matching ticks placement

Why is it so difficult in Pgfplots to configure a colourbar with a user-defined number of discrete colours and with ticks exactly placed on the borders between the colours? Consider this example: \...
1
vote
1answer
36 views

Specify xtick/ytick with multiplication in Pgfplots

I often use plots with a second x/y-axis which is proportionally related to the first one. Therefore, I would like to calculate the tick-values by multiplication. Let's say the first one is a time and ...
2
votes
0answers
28 views

Out of place sloped fading with fillbetween library

The following code generates the next plot: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepgfplotslibrary{fillbetween} \usetikzlibrary{fadings} \tikzfading [name=...
1
vote
1answer
26 views

Removing lines from pgfplots plots

How do I remove the line segment joining (0, 0) and (1, 1) when 'twopoints' contains: 0 0 0 1 1 0 in the following example? \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{pgfplots}...
3
votes
1answer
46 views

Automatic labelling of isolines based on table's column name

I would like my code to use the column name (from pgfplotstable) to automatically label the lines. Here is a MWE: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.13} \...
1
vote
1answer
41 views

Changing commas and dot on bar graph

Here's what I have right now: Is there a way to change commas for dots and vice versa? This table was made using the answer from this question, so it's basically the same thing. This isnt't an ...
4
votes
1answer
79 views

Quiver plot in polar coordinates

I need to plot an analytically given vector field in polar coordinates. I would like to get something like the picture in this answer by Christian Feuersänger, but in circular axes. I tried to use the ...
2
votes
1answer
50 views

How to indicate error bars on the legend symbols in pgfplots

I am transitioning to using pgfplots to do most of my plots these days, however I am not always able to get the plots looking as I want them to. I am plotting some data points with error bars, and it ...
16
votes
2answers
247 views

How to draw a graph with several axes?

I would like to draw a graph as you can see it on the picture below: All I got was this one here: \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ ...
3
votes
1answer
98 views

Plot that shows that largest root tends to 1

I am considering x^{i+2}-x^{i+1}-1. As i goes to infinity, the largest root tends to 1. I would like to have a plot in latex, for example with pgfplots, that shows this, maybe one could plot the ...
2
votes
2answers
88 views

Add and mention some pages in another page

How can I add some pages in another page like the following picture, and how can I mention them with this free arrows on the text!
3
votes
1answer
53 views

Pgfplots - automatically distinguish multiple plots in one figure

I'm writing some app, which generates a TeX code. My program creates variable number of plots and I'd like to use visualize them using pgfplots. In the old version of this app (not created by me), ...
1
vote
1answer
55 views

3D spherical coordinate system in pgf plots

I just learned 3d rectangular graphs in pgf-plots, and now I need to graph in spherical coordinates. Ive been reading the manual and cant find an answer. Is there a simple way to plot something such ...
2
votes
0answers
18 views

PGFPlotsFill intersection of several inequalities

I have the following figure using pgfplots. Currently the green area---the intersection of the yellow, blue, and red shadings---is hand-drawn using TikZ's \filldraw. I wonder if there's way to ...
0
votes
0answers
26 views

Pgf surface plot - Not getting the proper plot

I have produced a surface plot in matlab which looks like this I want to reproduce the same using pgfplot to include in my latex document. The data for the surface plot can be found here. But when ...
2
votes
1answer
66 views

Pgfplot - Plotting with arrows to indicate direction between two consecutive data points

Is there any easy way to automatically create arrow between two consecutive data points read from a table? (in addition to adding a mark). See attached picture. For large data set, I find adding node ...
1
vote
0answers
26 views

Expand variable in pgfplots key

In the example below I am trying to set explicitly some numbered styles and then loop through those styles in a plot. However the variable \i doesn't seem to expand correctly in mystyle\i (however it ...
2
votes
0answers
16 views

Filling bar chart with patterns for black and white printing [duplicate]

I am trying to plot a bar chart like below: \documentclass{standalone} \usepackage{graphicx} \usepackage{tikz} \usepackage{pgfplots} %\usepackage{subcaption} \definecolor{blues1}{RGB}{198, 219, 239} ...
0
votes
0answers
20 views

Pgfplots with gnuplot - list of coordinates, not file

I want to do a simple graph, where its points will be assigned by a list (NOT a file) of coordinates. So, I know, that I can do something like this: \addplot gnuplot [raw gnuplot, color=blue]{plot "...
3
votes
1answer
97 views

Pgfplots and large exponents in expression and domain

After I discovered the fpu library for increased precision, I tried to make a plot involving large exponents. I choosed as an example a plot of the gravitational force of the moon on a test mass in SI-...
0
votes
1answer
29 views

Pgfplots domain [duplicate]

I have three columns of data and one which stops at a moment, but the other continues. But LaTeX creates the values as a constant, and I don't want them to appear, how to do? \begin{figure}[h!] ...
2
votes
0answers
19 views

Scaling axis in addplot

When using the following code \documentclass[border=1cm]{standalone} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{axis} \addplot[...
2
votes
1answer
25 views

Pgfplots does not print one bar

I have this really simple pgfplot: \documentclass{standalone} \usepackage{pgfplots} \usepackage{pgfplotstable} \begin{document} \begin{tikzpicture} \pgfplotstableread[row sep=\\,...
2
votes
1answer
32 views

tikzpicture fails with date input coordinates taken from file

I have a problem implementing a tikzpicture. I want to plot the file with date and TIME and a climatic variable. I followed the PGF manual in section 4.21.2 "Dates as Input Coordinates" and if i do ...
3
votes
3answers
93 views

How to color tick label background when curve overlaps it

I have lots of pgfplots in my document with curves that pass vertically through points where I want an x tick label. This makes those labels hard to read. I do want those labels to still be there. I ...
2
votes
1answer
23 views

'Undefined control sequence' with \addplot

When trying to insert a TikZ figure, using \addplot, I've got an 'undefined control sequence'. My code is: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=newest} ...
2
votes
1answer
54 views

understanding how to have one legend for a group plot

I know this question has been asked in various forms before, but I just do not understand the syntax of one of the solutions that I would like to use. I have checked the documentation of Tikz and pfg ...
2
votes
1answer
47 views

Adding 3d axis to a 3dplot figure

I have 3D surface plot obtained from matlab. I would like to add axes to it with labels using latex. What is the proper way of doing this? Or do I have to just guess and draw lines (trail and error). ...
10
votes
0answers
93 views

Is there a general rule when to write pgfplots keywords together?

When using tikz especially pgfplots I find it often difficult to remember if a keyword is written together or separaded. Examples for keywords written together are: xticklabels enlargelimits ...
2
votes
1answer
41 views

bar chart with pgfplots

I am trying to create a bar chart with pgfplots. My code is similar to example : \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{figure}[h!] \begin{tikzpicture} \...
0
votes
0answers
51 views

How to make a grouped bar plot with different sized bars?

I want plots with grouped bars, two y axes and bars of different size shown in the Pictures below: What i got so far: \documentclass[x11names]{article} \usepackage{pgfplots} \begin{...
3
votes
1answer
37 views

Rounding off before plotting

Is it possible in latex to directly round off numbers from tables before plotting? I tried using round-precision from siunitx package, but this does not seem to work. MWE \documentclass{...
1
vote
0answers
39 views

Problem using `siunitx` with `fourier` in `tikz`

For my reports I'm using both the packages fourier and siunitx at the same time. I recently noticed that units automatically enclosed in brackets using the library units for pgfplots are shown in a ...
1
vote
0answers
43 views

Space-saving plotting technique

My goal is to create a template for a report (see the figure) that will be used to programmatically generate reports from a data source. The approach I have thought of is to use a table combined with ...