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

pgfplot fill one bin with color

I am using pgfplot to draw a ybar graph. It can fill color for full graphic but I wish to only fill one bin with red color. e.g. fill bin 3 with red. Current code fill all bins with red color as ...
1
vote
1answer
20 views

Stacked ybar problem

The figure I'm looking to reproduce is the following: I have been able to produce a stacked ybar chart before by using coordinates by following the examples given in the pgfplots manual chapter ...
2
votes
2answers
57 views

add vertical line of equation x=2 and shade a region in graph by pgfplots

I would like to plot these four equations : $$y=\dfrac{3}{2x+1}, y=3x-2, x=2 y=0$$ and i don't know how to draw vertical line of equation x=2 and shade a region like the picture below ...
3
votes
1answer
16 views

Plot Width Error with pgfplot's groupplot in Beamer

I am making a 3x3 matrix of plots in a beamer slide. Position (1,1) is empty, the rest of the first row has column titles and the rest of the first column has row titles. Positions (2,2) to (3,3) ...
4
votes
1answer
69 views

Drawing Fourier expansion using pgfplots

I need to plot the case with M = 16: Unfortunately, the way I'm doing it seems completely wrong: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{figure}[h] ...
1
vote
1answer
33 views

Naming Externalized Images via MD5 Sum

I have a large presentation with over 200 figures (mainly created through stepping through each image). I'm using the external library to cache the results to great effect. Each figure is cached in ...
2
votes
1answer
19 views

Plot data row-wise with pgfplots

I have some data stored to file, that I would like to plot with pgfplots. The data is stored row-wise, that is the file looks something like this: a 1 2 3 4 5 b 6 7 8 9 0 c 2 4 6 8 0 ... ...
3
votes
1answer
48 views

Centering group plot figure

Can anyone show me how to center this group plot? I've tried every trick in the tex.stackexchange book of similar posts (e.g., How to center large figures in LaTeX and how to fix short justified ...
3
votes
1answer
35 views

Horizontal space between subcaptions

I have the next graphic As you can see, the subcaption (b) is not centered from the corresponding subfigure like (a). If I increase the value for [.51\linewidth] unwanted things happen. I'm using ...
2
votes
1answer
44 views

pgfplots conditional data filtering

I'm wondering if there's a way to filter data points within the \addplot arguments. I have a data set (see MWE below) whose values correspond to one of three conditions (C). I'd like to be able to ...
1
vote
1answer
27 views

Replace axis line which has been set as a style before

I can't figure out how to override the axis line style from "with arrow" (set in a style) to "without arrow". Here is a MWE: \documentclass[]{scrartcl} \usepackage[utf8]{inputenc} ...
1
vote
0answers
22 views

Set limits of colormap in pgfplots

I am plotting three surf plots in a groupplot environment with pgfplots. For the third groupplot, I have enabled the colorbar. I would like the colorbar to represent all three plots, so equal z values ...
3
votes
2answers
110 views

plotting a function with smooth curves

I am trying to plot the following function The issue is I do not know what is the best setting for the coordinates. I tried different coordinates with no success. Here is my code: ...
1
vote
0answers
33 views

Pgfplots' groupplots, automatic legend and axis name placement

So, I've been working on an answer to this question and worked on adapting it to groupplots, i.e. placing automatically legend on the outside margin, axis ticks and labels on the inside I'm facing two ...
1
vote
0answers
21 views

errorbars in pgfplots using raw gnuplot

I use pgfplots always in combination with the 'raw gnuplot' option because I like it better to preprocess my data using gnuplot. (curve fitting, complex calculations etc.) Now I am facing a problem ...
3
votes
1answer
63 views

Drawing Sinusoids with Phase difference

My first goal was to draw sinusoid plots similar whit these images: This is what I've done (similar to one code in this forum): What I'd like to know is (if possible) how to change integral ...
1
vote
0answers
21 views

Use pi in x labels with pgfplots [duplicate]

With \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[samples=10, domain=0:pi] \addplot {x-sin(x)}; \end{axis} \end{tikzpicture} \end{document} ...
4
votes
2answers
85 views

Adapt style (e.g., position) of single tick

Consider this MWE: \documentclass[tikz]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.10} \usetikzlibrary{pgfplots.groupplots} \begin{document} \begin{tikzpicture} \begin{groupplot}[ ...
2
votes
0answers
25 views

Legend image arguments for the command `\addlegendimage`, 3d legend image

In the 3d plot I want to modify the third legend entry to only show the marks and not the line. From http://tex.stackexchange.com/a/113765/28093 I understood that I'm supposed to use something ...
1
vote
0answers
28 views

Selectively add legend entries to plot on large CSV

I have a plot with 63 lines, only some of which I would like legend entries for. The full legend takes up half a page, and using the \ref method does not give me consistency with the surrounding ...
2
votes
0answers
29 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 ...
5
votes
1answer
108 views

TikZ/pgfplots: how can I generate a figure like this one?

What's the easiest way to produce a figure like this one? The curve is meant to look wiggly and random, and always non-increasing, except for the jumps up. I have tried using decorations with random ...
3
votes
2answers
76 views

fontawesome scaling, deedy-resume pgfplots axis, XeTeX, LuaTeX issues

I am currently working on a document using the deedy-resume template http://www.latextemplates.com/template/deedy-resume-cv in LaTeX and I have two issues which result in a dilemma and I can't ...
4
votes
0answers
31 views

Group style key does not work in pgfplotsset

When I want to set a style using groupplot, I will do something like this: \begin{groupplot}[ group style={ group size=1 by 2, vertical sep=1cm, }, ] However, I've found that if I try ...
2
votes
0answers
34 views

Mark nodes/coordinates by label (pgfplots)

I am drawing a scatterplot, where the data is in a table and the values are labeled. I want to connect certain nodes with straight lines and in order to do so, one has to label the nodes/coordinates. ...
3
votes
1answer
36 views

Why are my symbolic x coordinate labels printed twice in a tikz plot?

I'm trying to plot a bar graph, using symbolic x coordinates. For some reason, the name of some symbolic coordinates appears under the x axis more than once. If I increase the width (e.g. 12cm) ...
1
vote
1answer
48 views

Get node text inside filled region in tikz

I have made this figure from this code: \documentclass[tikz]{standalone} \usetikzlibrary{patterns} \begin{document} \begin{tikzpicture}[domain=-90:200, x=0.025cm, y=0.15cm] \draw[->,very ...
2
votes
1answer
37 views

How to draw a z-simple paraboloid in a “clean” way

I'd like to draw z=x^2+y^2 on the interval 0<z<9. So normally I've just been using pgfplots with the addplot3 command, and for rectangular domains that doesn't seem to cause too much trouble. ...
2
votes
1answer
36 views

How to plot mark on every nth point?

I have a long CSV data file: x,y1,y2... 1,v1,v1... 2,v2,v2... .... I use pgfplots to plot all the lines. I also want to add mark shapes. But the problem is that the data is too dense, and I have a ...
2
votes
1answer
26 views

pgfplots: change vertical position of node label in addplot

In the MWE below, how can I change the vertical position of the label associated with the curve? For example, if I wanted to put it below the curve? \documentclass{standalone} \usepackage{tikz} ...
4
votes
1answer
76 views

A question about ticks on a graph

I am trying to make a graph with a grid in the background. I want it to be standard windows size, but I only want numbers next to the -10 and 10 on both the x axis and y axis. I am using this code ...
3
votes
1answer
63 views

How does PGFplots calculate trig functions?

In plotting the graph from my last question I have discovered that the plots I'm getting from PGFplots are not entirely correct. I was attempting to plot (4.9/(w^2))*(cosh(w*x)-cos(w*x)) for multiple ...
4
votes
1answer
62 views

How to compute and show new value from linear regression

The following MWE shows a template I use in university to show calibration data and the corresponding linear regression. Now I was asking if I can compute an $X$-value for a given $Y$-value and show ...
5
votes
1answer
54 views

Option for Coloring the Background of pgfplots

I have been looking for a simple answer for this with no success. I want to plot the function y=x^2, and color the background of the whole box made up by the axis environment. Intuitively, one would ...
1
vote
0answers
42 views

Tikz spy makes move hyperref links [closed]

I have some troubles with the Tikz library spy. When I use the spy, it creates a new hyperref link at a new position. Thus there is 2 links where only one is wanted (see the image with 2 cyan box ...
3
votes
1answer
22 views

pgfplots bar plot number format

I was just trying to compile some data into a bar chart using pgfplots. Things seem to work apart from the following: The annotation for the bars has low precision, i.e. only 3 decimals, it is shown ...
2
votes
1answer
32 views

Duplicate values when writing value near coordinate

I am using this code, taken from my question here. The problem arises when two x values have the same y value. Then the label I want to write near the coordinate overlaps with the other one. How can I ...
3
votes
1answer
38 views

Write a value near a coordinate in a plot

I want to do it from a file, rather from inside the document like I do it now: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \begin{document} \begin{tikzpicture} ...
2
votes
0answers
25 views

pgfplots: Fixing overlapping X axis labels

I am trying to create a time series plot but my X axis labels overlap: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{width=14cm,compat=newest} \usepgfplotslibrary{dateplot} ...
2
votes
1answer
28 views

Problem connecting nodes from and axis environment and using /tikz/scale

Consider this almost-MWE: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots}\pgfplotsset{compat=1.9} \begin{document} \begin{tikzpicture}[] \begin{axis}[clip=false, width=12cm, ...
6
votes
4answers
166 views

How to point an equation to a curve

I have the following code: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.7} \begin{document} \begin{tikzpicture}[>=latex] \begin{axis}[grid=both, axis x ...
0
votes
1answer
23 views

pstool + pgfplots/tikz + parskip conflict resolved

A while back a question about a conflict between pstool, pgfplots and parskip packages was asked. I came across a similar problem using the pstool, tikz and parskip packages in concert, and happened ...
3
votes
1answer
38 views

Adding manually a grid to a .tikz file generated by matlab2tikz

I asked this question here Stackoverflow Now, I know of the existence of the problem with the conversion with the matlab2tikz script and the inclusion of a grid. GridProb How can I manually add a ...
0
votes
1answer
26 views

Can't span width of date plot to linewidth

Aim: Set the width of a plot to \linewidth. Current Status: Setting the width option of the axis environment to \linewidth yields the Dimension too large. error. And indeed, in the resulting ...
1
vote
0answers
16 views

How to adjust one 'meta' label position in pgfplots when it overlays with another?

My MWE: \documentclass[12pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \usepackage{amsmath} \usepackage{mathspec} \setmainfont[Ligatures=TeX]{Times New Roman} ...
4
votes
1answer
57 views

Shade around curve in pgfplots

I am using the pgfplots package to make a plot of my data. As you can see in the plot below, I've got quite some data points which makes it hard to see the fit, so I decided to use a shade around the ...
0
votes
0answers
27 views

pgfplots axis label positions change unexpectedly

I want the axis labels to appear at the ends of the axes -- the arrows should "point" to them. They are correct in this MWE: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} ...
1
vote
1answer
53 views

Simple import of data with special characters for table

I'm currently trying to import a set of data from a file (comma or tabbed delimited, doesn't matter) for creating a table. Below is an example of this data (DH parameters in case you're curious): ...
2
votes
1answer
26 views

How to change the mark in a pgfplots boxplot

I have my own custom style for boxplots which I like very much. I like it so much I would like to use it everywhere. I used it with the old boxplots, and it did everything I wanted. However, the ...
4
votes
0answers
78 views

Draw the plane x+y=1 in three dimensions in pgfplots

I want to draw the plane x+y=1 in pgfplots. In this example, z is free and is not explicitly a function of x and y. So I cannot use \addplot3[surf, fill=blue, opacity=0.1, fill opacity=0.4] ...