{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

15
votes
3answers
2k views

PGFPlot - Missing values in table data

I am using PGFPlot with external table data. However, some values are missing for some plots. This causes data in column 2 does not exists error. Is there a way to solve this. The value does not ...
3
votes
1answer
44 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
36 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
2answers
93 views

Unable to typeset LaTeX maths characters in pgfplotstable table header

I am typsetting a simple table with pgfplotstable and attempting to include units in the headers. I've noticed that certain math macros e.g. \circ or \gamma (2 random test cases) fail to typeset. When ...
0
votes
1answer
27 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 ...
2
votes
1answer
73 views

How to plot with TiKz the following performance?

I would like to plot some percentages as lines. So I tried the following: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.12} \begin{document} \begin{tikzpicture} ...
6
votes
1answer
287 views

Tick labels in pgfplots data time format

I tried to plot a data set containing seconds and milliseconds with pgfplots. I’ve found a solution for my task here (pgfplots data time format), which I changed a bit. This principally works very ...
1
vote
0answers
17 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
62 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 ...
2
votes
1answer
41 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 ...
20
votes
3answers
360 views

Plotting a graph with several values of a parameter

I'm trying to plot the function q(t) = (4.9/ (w^2))*(cosh(w*t)-cos(w*t)) for several values of the parameter w. That is, I want to plot whole graphs of q vs t, where I plug in say w=1, w=2, w=100, or ...
0
votes
0answers
36 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} ...
3
votes
1answer
45 views

pgfplots Producing Incorrect Plot

Why is this not working properly: \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[xmin = 0,xmax= 1,ylabel = $C_A/C_A^*$,xlabel=$z$] ...
2
votes
0answers
78 views

Plot data and the mean of each column

I have a data file which looks like this: 1 256 2 197 3 190 4 188 5 219 6 169 7 179 8 181 9 182 10 178 where the first column are timesteps and the second column contains the ...
4
votes
1answer
94 views

I am trying to assemble a picture with four png pictures

I would like to assemble the following four pictures in a 2x2 matrix (filling rows first): Is there a possibility to put the letters A-D at the bottom left of each figure to label them? Thank ...
3
votes
1answer
42 views

How to add one mark to one line in pdfplot

I am attempting to differentiate each line in the graph. Then I try to use marks, however it looks messy. Is there a way to make it looks more tidy? I am open to any suggestion that works. ...
5
votes
1answer
51 views

I am trying to extend the regression line

I have the following code: \documentclass{standalone} \usepackage{pgfplotstable} \pgfplotsset{width=12cm,compat=1.9} \usepackage{filecontents} \begin{filecontents*}{all_women.csv} a,b ...
4
votes
1answer
53 views

Change colors of several pgfplots functions plotted in foreach gradually

In answering this question I actually caught myself unknowing how to solve the following issue. In the code below I'm dealing with many graphs, which I intend to gradually change in color based on ...
3
votes
0answers
39 views

pgfplot - how to make horizontal error bars

Hello I would like to add horizontal error bars to my plot, that's picture is below. There is code of my plot \begin{tikzpicture}[thick,scale=1, every node/.style={transform shape},trim axis left, ...
4
votes
1answer
111 views

pgfplots + gnuplot: why does setting clip = false in axis options completely ruin graphs of implicit functions?

Here's a MWE: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{axis}[xmin = 0, xmax = 1.5, ymin = 0, ymax = 6.2831853072, ...
6
votes
1answer
115 views

Drawing an intersection of two equations in 3D

I'm trying to draw the intersection of the following two equations: x^2+y^2=4 (a circle of radius 2) and z=x+4. I got kind of close with tikz-3dplot (which has preferrable output in my opinion), but ...
3
votes
0answers
34 views

Making axes line up

I'm working on the following graphic: I would like the y axis of the plot in the upper right corner to line up exactly (i.e. have the ticks line up) with the x axis of the rotated plot to its left. ...
1
vote
0answers
19 views

Draw line across axis environments [duplicate]

I have placed a plot below another plot in pgfplots. The two plots reside in a separate axisenvironment each, like so: \documentclass{scrartcl} \usepackage{pgfplots} \pgfplotsset{compat=1.12} ...
1
vote
2answers
62 views

yticklabel pos=right has no effect

I am using pgfplots to draw a simple 2D function. I'd like to display all of the ytick labels on the right side of the plot. So far I had no success using yticklabel pos=right, I do not get an error ...
4
votes
2answers
45 views

Scaling a plot axis to keep the same size unit vectors over multiple plots

I have a PGFplots set of grouped plots that somewhat resembles the following MWE. The top row of plots has a larger range than the bottom row. Is there a way to have the height of the top row ...
0
votes
0answers
56 views

Creating a generic Asset Life curve in Latex

Good afternoon all, I need to ask another question today in a slightly different format. I am trying to create a figure that resembles the one below and I would like some help regarding the ...
1
vote
1answer
53 views

How to arrange the key in this plot?

basically I have plot like this: It looks bad because two reasons: The middle figure, five keys are overlapped with lines The 6 key in the third figure, even they are not overlapped, they are not ...
2
votes
3answers
63 views

Text beneath two function graphics inside of a figure

Is there a way to put extra text under some function plots in the following code? I need them to appear side by side on the page in the same figure and I do not what to use an extra caption. The text ...
2
votes
1answer
33 views

Using pictures / images as x-axis label in pgfplot?

is it somehow possible to use external pictures as explicit labels in pgfplot? Or can I use the draw environment within the label definition? I tried it in two ways: \begin{tikzpicture} ...
1
vote
1answer
28 views

pgfplots ignores “thick” option for axes

I'm having a problem with the following code \documentclass{standalone} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} \usetikzlibrary{patterns} \begin{document} \begin{tikzpicture} ...
2
votes
1answer
86 views

How to add subtitles to a group of plots?

I have the following group of plots: \documentclass{article} \usepackage{fullpage} \usepackage{pgfplots} \usepgfplotslibrary{groupplots} \pgfplotsset{compat=1.12} \begin{document} ...
3
votes
1answer
57 views

Specifying markers in tikzpicture

I have the following chart...the below code won't build without the data files, but an image follows \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{figure} ...
1
vote
0answers
18 views

pgfplots: swap x and y axis [duplicate]

I'm looking to swap the x and y axes of a pgfplot (it was generated by matlab2tikz if that makes any difference). I've tried the solution here but it just leaves an empty plot Example of what I want ...
0
votes
1answer
60 views

Externalize Tikz Figures with Latex

I want to use the externalize option for tikz pictures to save up compilation time. Because of the need for psfrag, I want to compile via latex, i.e. dvi-->ps-->pdf. I use texStudio. My Latex specs ...
6
votes
1answer
118 views

Pgfplots: plot text along function

I want to illustrate a material model, especially the identical loading and unloading path, which are illustrated via arrows that follow the material model in the following picture. I want to put ...
3
votes
1answer
42 views

Changing global settings for makers doesn't work in pgfplots

Often I have documents where I need plots without makers. In this case I set globally a \pgfplotsset{ no markers } However if I have some special plots in the file which require (only) ...
0
votes
0answers
45 views

Plot the sum of two inverse normal CDFs in three dimensions

I am interested in plotting the sum of two inverse cumulative normal distributions in pgfplots but I am not quite sure how this can be done. Could you please lend me a helping hand here? Thank you in ...
3
votes
1answer
86 views

How to add one single legend entry for several plots?

How can I create a single legend entry for 4 plots at the bottom of the group of plots?. Something like this: Title Title -------------- ---------------- - ...
1
vote
1answer
41 views

Multiline legend external to pgfplot

I'm building a plot with pgfplots where there's no good location inside the chart box for a legend, so I'm trying to place the legend outside. Below is the code...it obviously won't build without all ...
4
votes
1answer
76 views

Label each row of plots in groupplots (pgfplots)

I am using groupplots to display 12 plots in 2 columns and 6 rows. The two plots in each row are related to some method, and I want to specify the method name in the title. The problem is, that ...
3
votes
1answer
72 views

How to plot the maximum and the minimum

I am interested in drawing the minimum and the maximum of two variables, i.e. min(x,y) or max(x,y). The way I was going about doing it so far was to get the contour plots using gnuplot but my attempts ...
2
votes
1answer
71 views

Default tikz arrow style in pgfplots

I'm trying to change the axis arrow style used in pgfplotsto the default one obtained in tikzusing ->, i. e. I've done some research but can't seem to find a way to do that.
3
votes
2answers
126 views

Vertically stacked group plot with different horizontal scaling

I've 4 data sets that I'd like to present as a stack using pgfplots' groupplot library. What I'm struggling with is that the first data set has a larger horizontal range to the remaining three. I'd ...
1
vote
1answer
29 views

pgfplot bar chart with no X labels?

Is it possible to produce a bar chart in pgfplots with no X labels? I'd like to simply fill the bars and have an external legend that provides a color code. I'm making a 3x1 group plot that shows ...
0
votes
0answers
42 views

matplotlib2tikz - compilation error for 2D

Situation: I am using matplotlib2tikz to export a two dimensional plot (comparison). Exported to pdf it looks like this: Including the tikz file (and compiling) yields an error though: Package ...
3
votes
1answer
76 views

How to integrate pgfplot inside a pre-existing tikz picture?

I'm trying to put together a pgfplot inside a pre-existing tikz picture. But somehow the axis I create with pfgplot has different units and I'm not sure how to make the two things fit. The code is: ...
11
votes
1answer
198 views

I am trying to add a trend line to this plot

I have this graph: \documentclass{standalone} \usepackage[utf8]{inputenc} \usepackage{textcomp} \usepackage{pgfplots} \pgfplotsset{width=10cm,compat=1.9} \usepackage{filecontents} ...
2
votes
1answer
44 views

How to disable the spaces before the first bar and after the last bar?

\documentclass{article} \usepackage[adobefonts]{ctex} %支持中文就靠这一行了 \usepackage{fontspec} \usepackage{tikz} \usepackage[active,xetex,tightpage]{preview} %这一行有改动,将pdftex换成xetex ...
2
votes
0answers
50 views

3D plot from file

Hi I am currently learning how to do plots in Tex and I found a problem which I cant solve. I would like to do 3D surface plot from file but all what I get is a 3D line. For learning purpose I used ...
1
vote
1answer
77 views

Drawing Q–Q plots (pgfplots)

I can see from the PGFplots documentation, that there is no native support for Q–Q plots. However, since I am using PGFplots for all my other figures, I would also like to use it to display the Q–Q ...