{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

2
votes
1answer
53 views

How to prevent rounded and duplicated tick labels in pgfplots with fixed precision?

I have a plot whose y axis is linear with fixed precision and without scaling. \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.11} \begin{document} \begin{tikzpicture} ...
2
votes
1answer
57 views

Adding arrows to axes using pgfplots

Using axis lines=middle in the brackets after \begin{axis}, I can get arrows to appear on the x and y axes of a graph in the positive but not the negative direction. How do I add arrows in the ...
5
votes
1answer
96 views

Creating interactive plots in tikz with pop-ups

I'm trying to create a 2-d plot in LaTeX. I am facing two issues: I am using the ocg package to make the plots appear/disappear by clicking on the legend. It partially works as the markers in the ...
1
vote
0answers
40 views

How do I place table below plot so that category matches axis ranges?

Here is something that I'm trying to do is to align my table with x-axis category or range so that column below the x range is corresponding of the data So As example is shown, I want to create ...
4
votes
2answers
108 views

Plot file could not be opened

The following code is from the "gallery of examples in the manual - PGFPlots". \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \pagestyle{empty} \begin{document} ...
3
votes
1answer
53 views

Draw grid lines for grouped bar chart/diagram

Me again.. I have a grouped bar chart and I would like to add vertical grid lines for each group because with a smaller width all bars are too close to each other making it hard to look at. My MWE: ...
0
votes
2answers
55 views

Modifying some features in a scatter plot (Version 2)

I have a scatter plot that needs some modifications. Why isn't O being typeset with the command \node (origin) at ($(O)+(225:10pt)$) {$O$};? I would like O to be typeset in the same font as the tick ...
3
votes
1answer
73 views

Plots large number of data

As you all know, TikZ has to face the limits in terms of memory, that is given by the TeX compiler. For most of my plots, I have a maximum time step of around 1us and I record several waveforms over ...
1
vote
0answers
53 views

Why can't I plot (x+2)^{1/3} properly using pgfplots? [duplicate]

I'm using the code \documentclass{book} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ xmin=-5, xmax=5, ymin=-5, ymax=5, axis x ...
1
vote
0answers
79 views

Drawing a solid angle vector/cone in TikZ?

I would like to draw a "solid angle vector/cone" pointing in a specified direction in spherical coordinates and having a specified opening size (dσ or a in the examples below), akin to the examples ...
3
votes
0answers
59 views

How to label areas in pgfplots fillbetween library

Is there any simple way put a label say $A$ roughly at the "center" of an area created by the pgfplots fillbetween library? Take for example the following example: \documentclass[tikz]{standalone} ...
2
votes
1answer
44 views

Use separate colors for a multi-bar diagram plotted from file

Based on my origin question here: Broken bar diagram with tikz package I am trying to color each single of a group differently. In my preamble I have defined the colors I want to use: ...
2
votes
2answers
174 views

Modifying some features in a scatter plot

I would like to have the following modifications to the scatter plot. The title should be typeset on two lines. I would like a break on each axis indicating a skip from 0. (When I was in junior ...
2
votes
1answer
24 views

How to set the color and width of your plotline using the third column in your table?

I would like to use the third column in my table to color code my plotline e.g. blue-red (-1 to 1) and set the width according to the absolute value of the third column (0 thick, 1 ultra thick (or ...
2
votes
1answer
100 views

Broken bar diagram with tikz package

I am trying out tikz package to create bar diagrams and following the code example in the manual on page 82 ...
2
votes
2answers
70 views

Can we get references into externalized pgfplots images to work?

I have some plots created with TikZ and pgfplots. In the captions, I use \ref{...} with plot labels in order to get the marker printed there; a neat feature indeed. Now, when submitting to arXiv one ...
1
vote
0answers
41 views

Bar graph with large points

I want to plot a bar chart with 128 points with 2 in a group but the vertical bar overlap each other and representing in a square plot but i want in a rectangle plot, (where the length of x-axis is ...
4
votes
1answer
147 views

TikZposter does not work with pgfplots

I can't use axis environment in tikzposter, when I add \usepackage{pgfplots}, I will get: Package pgf Error: Sorry, the requested layer 'backgroundlayer' is not part o f the layer list. Please verify ...
1
vote
4answers
105 views

Help with grid lines in a pgfplot (Version 3)

The following display is that of a line and of a parabola on the Cartesian plane with grid lines. The grid lines are drawn nicely ... but to draw the grid lines I have included the axis options ...
3
votes
0answers
88 views

Drawing Cross Sections of (Contours over) Torus

I have this simple torus \begin{figure} \begin{center} \begin{pspicture}(-6,-4)(6,4) \psset{viewpoint=30 10 25 rtp2xyz,Decran=30,lightsrc=viewpoint} \psSolid[object=tore,r1=2.5,r0=1.0,ngrid=36 ...
2
votes
0answers
43 views

Adding Arrows and Text in tikz figure

I need your input on something again. I'm playing around with Tikzpicture and creating plots within the latex environment. I am trying to produce this graph (or something similar to this): So my ...
1
vote
1answer
65 views

multi-Figure with pgfplots with one legend and rotation

I would like to have in a page two figures like the one the code below at the same page using subcaption and sidewaysfigure. The first problem is that probably there is a mistake at the position of ...
3
votes
1answer
62 views

How to project nodes created by relative position on curve to axis and below?

In case I have two curves created with pgfplots I can draw a line between two relatively positioned nodes on each. In this example there is an arrow between the points at 50% of each curve. ...
4
votes
1answer
110 views

Vertical spacing and item separation between entries in pgfplots' legend

One could find a lot of questions on how to change the horizontal spacing between legend entries in pgfplots, but I can't find anything on the vertical spacing between the entries. For example, when ...
1
vote
1answer
74 views

How to remove 10^5 in x-Axis of time series plot generated with matlab2tikz

I generated the following simple plot in Matlab: Date=720000:730000 y=Date plot(Date,y) y=log(Date) plot(Date,y) datetick('x','yyyy') matlab2tikz('test.tex') which converts the date serial numbers ...
0
votes
0answers
68 views

How can I draw a 3D cross-section of a 3-torus embedded in 4D Euclidean space?

I found this question and very nice solutions of Mathematica Stack Exchange. I have a 3D-torus (\mathbf S^1\times\mathbf S^1\times \mathbf S^1) embedded in 4D Euclidean space. How can I draw the ...
2
votes
0answers
54 views

'parula' colormap in pgfplots

I try to implement 'parula' Matlab colormap in pgfplots drawings. Here is the MWE for that palette with 10 points for interpolation: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{ ...
2
votes
2answers
65 views

PGFPlots: calculate a linear regression, ignoring some data

I know that I can use PGFPlots to calculate a linear regression with the create col/linear regression command. I have a set of data that is curved for the first few points, but linear for the ...
16
votes
2answers
4k views

Using a pgfplots-style legend in a plain-old tikzpicture

I am using a plain-old tikzpicture to produce a pie-chart-like plot. Now, all other plots in my paper are handled using pgfplots (which doesn't do pie charts) and have their legend typeset by ...
1
vote
1answer
46 views

External graphics + axis + additional plots

my issue is related to the sequence of layers in pgfplots. I have 3 layers: External graphics, which is included by \addplot graphics Axis grids and ticks Additional 'quiver' drawing from \addplot ...
1
vote
1answer
67 views

Help with Grid Lines in a pgfplot (Version 2)

This is a follow-up question to Help with grid lines in a pgfplot I edited the code in that post to get a grid on the Cartesian plane that is closer to what I want. Here is what I have. By ...
0
votes
0answers
86 views

Customize PGF bar chart bars

Ideally, I'd like to write a macro which specifies how to draw the bar of a PGF bar chart, given its height, width, and location. This seems nearly equivalent to asking how to specify a non-repeating ...
3
votes
1answer
58 views

Using a character as mark in pgfplots

I have a scatter plot in pgfplots which shows dots in 4 different colors belonging to 4 different sources. I would like to use a character (e.g., "A") instead of a circle as the marker. For instance, ...
2
votes
1answer
80 views

Oriented curves

Can someone link me to a tutorial or some examples of how to make oriented curves using pgfplots? Something along the lines of I'm not asking for someone to spend the time reproducing the above ...
5
votes
2answers
674 views

pgfplots - draw boxplot without outliers

I am creating a boxplot with pgfplots, using the builtin statistics library. I load the input data from a table file. \usepackage{pgfplots} \usepgfplotslibrary{statistics} ... \begin{tikzpicture} ...
5
votes
1answer
109 views

Uniformly spaced line markers

I'm reading line data from file and plotting it. By default, the curve has markers, where are the original data points. The data points are very uneven, but I would like to have evenly distributed ...
1
vote
0answers
36 views

How to label data with the real value in pgfplot?

Taking this example from PGFplot gallery. \begin{tikzpicture} \begin{axis}[ x tick label style={ /pgf/number format/1000 sep=}, ylabel=Population, enlargelimits=0.15, legend ...
2
votes
1answer
94 views

Help with grid lines in a pgfplot

Nothing exciting here. I have a plot with xmin=-11, xmax=11, ymin=-11, and ymax=11. I would like to use the grid option in the axis environment to draw a particular grid. All horizontal and ...
2
votes
1answer
44 views

PGFplots within Environ format mistake

I try to write an environment for a simple barplot with pgfplots to reduce the needed markup. For that I use the environ package. For some reason tikz complains about a format mistake at the ...
2
votes
0answers
39 views

How to set axes limits for two types of plots when using groupplots

I have a rather big figure with two rows of plots where the first row has one y-axis and the second row has another y-axis. I would like to set the axis limits for these two sets of y-axes without ...
2
votes
1answer
92 views

How to draw a graph from specific lines of CSV file?

I would like to know if I can use cases when taking input from a csv file: Instead of generating multiple csv files, I would like to do the following In my tex file: Input from line 1-10 of ...
2
votes
1answer
77 views

Help with Help Lines

I am plotting lattice paths to two points. I would like to have help lines drawn on top of the Cartesian plane so that any line that is an integral distance from an axis is a solid line and any line ...
1
vote
1answer
67 views

Position of `groupplot` Titles in TiKz

Can I customize the position of the titles in tikz groupplots? In the following example, I would like to place the titles (a, b, c, and d) inside the axis (near the upper-left corner). ...
2
votes
0answers
68 views

Legend entry for each point in scatter plot with matching color

I have a file with multiple columns, of which I create scatter plots where positions are given from column 1 vs column 2, while the mark color is based on column 3. I now wish to automatically create ...
3
votes
3answers
71 views

Pgfplot logaxis customization

I am trying to reproduce the following picture: but currently I am able to: There are a lot of issues: log scales are not logarithmic, i.e. 256, 512, 1020, 2050. I would like to have 256, 512, ...
1
vote
0answers
50 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 ...
1
vote
0answers
22 views

pgfplots decimal seaprator for extra ticks

I'm trying to format all y tick labels in a pgfplotsplot so that comma is the decimal separator. What I've tried is: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat = 1.12} ...
1
vote
1answer
73 views

PGF colorbar cuts off max value

I need to generate a whole load of colorbars with custom min and max values. From reading this SE I have managed to get this working: \documentclass{standalone} \usepackage{pgfplots} ...
1
vote
1answer
51 views

putting(-) sign in the axes and working out a graph in pgfplots

I need pgfplots to show (-) sign in the y axis, somehow it does not read it. \documentclass{article} \usepackage[margin=0.5in]{geometry} \usepackage[utf8]{inputenc} \usepackage{textcomp} ...
6
votes
0answers
86 views

Add break node to plot in pgfplots

I was able to 'break' the vertical axis using pgfplots, but some issues came along with it: Most importantly, I can't find how to add the 'break sign' (the two parallel lines) to my plot as well, ...