{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

4
votes
2answers
159 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 ...
3
votes
1answer
47 views

Horizontal alignment of ytick labels

I am working on a population pyramid. With some sort of hard-code I managed to overlap the ytick-labels of the age in the middle of the graph (but not properly). My question is, how to 1.) suppress ...
4
votes
1answer
39 views

lower and upper case in axis-labels

pgfplots output for labels is only capital letters, I would like to make the axis labels case sensitive but can't seems to find a way todo this. \documentclass[12pt, %Schriftgröße a4paper, ...
3
votes
1answer
50 views

How do I change the font size of the labels along the axes in pgfplots [using scaling]?

This is a continuation of a question that was asked and 'answered' here: How do I change the font size of the labels along the axes in pgfplots?. The suggested answers all involved using LaTeX's ...
2
votes
1answer
47 views

Two ordinates - gray tick lines overlay black axis line

I want to plot two data series with different y-coordinates over the same x. Therefore a second ordinate is drawn with a second axis environment. When I now limit the range to be drawn, the gray tick ...
1
vote
1answer
127 views

Convert from rectangular coordinates to polar coordinates

The following code gives me the display that I want. The only modification that I want is to specify the points in polar coordinates with the same radius. (These points are on a unit circle centered ...
3
votes
1answer
110 views

Conflict tikzscale and matrix group plot

I want two axis environments next to each other in one figure environment. I want them to be vertically aligned and scaled to the width of the text. I am trying to achieve this by means of the ...
3
votes
1answer
98 views

Colored circles from data

I have a data file which gives x-position (xpos), radius, and color. I wish to draw a circle at ever (xpos,0) with appropriate radius and color. How do I achieve that? I have used two approaches. ...
3
votes
0answers
51 views

Pgfplots: Draw time-series without missing data

I have time-series data which I want to draw with pgfplots. The data only covers weekdays, thus no weekends. Still pgfplots inserts new ticks for datapoints having essentially no data, this results in ...
3
votes
1answer
103 views

Set limits of colormap in pgfplots [duplicate]

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 ...
2
votes
1answer
90 views

Adding a 2D plot to a 3D plot without closing the ends

I want to add 2 parabolas to a plot of a hyperbolic paraboloid, but I can't figure out (and couldn't find any information on the internet) how to keep pgfplots from closing the ends of the graphs. My ...
3
votes
1answer
82 views

Why doesn't this example from the pgfplots manual compile?

I copied this example from page 134 of the pgfplots manual (version 1.12.1): \documentclass{article} \usepackage{pgfplots} \pgfplotsset{width=7cm,compat=1.12} \usepgfplotslibrary{patchplots} ...
0
votes
1answer
702 views

Title distance to axis/labels [duplicate]

The answer to this question is a duplicate to Pgfplots: title covers scientific notation. However, the title/topic of this question is broader and therefore for some people easier to find. How can I ...
9
votes
2answers
1k views

Fading of horizontal lines is impossible?

The path fading option in TikZ is obviously not working for horizontal lines. For plotting constant functions as well as for drawing a line between two points. Making them slightly tilted solves the ...
3
votes
1answer
40 views

pgfplots: replace scatter markers with custom text

I'm wondering if it's possible using pgfplot to plot a 3D scatter plot with lines between each point where the point is replaced with a value. Image is shown below. Currently I am populating the ...
3
votes
1answer
54 views

How to refer to pgfplot legend labels with hyperref?

I would like to \refer to a pgf legend label in the caption of a figure (to explain symbols). I create my figures with externalization. Without the hyperref package, everything works fine. But as soon ...
11
votes
2answers
2k views

pgfplot: groupplots — how old?

I'm trying to reproduce some examples from the pgfplot documentation, but \usepgflibrary{groupplots} does not succeed, while shapes does. In the documentation I can't find a hint if this feature is ...
5
votes
1answer
190 views

How to plot a system model like in Microsoft Visio with tikz and pgfplots?

The diagram that I would like to reproduce using tikz/pgfplots is given below: I tried to do it but I did not succeed (I am new to pgfplots and tikz). Here is my code and my output file. For ...
2
votes
2answers
404 views

pgfplots: Color a 3D surf plot based on y-value

I'm not sure if things have changed since version 1.7, but this is the closest thing I could find. I'm wondering if there's an easier way to use the y-value with a colormap to determine the color, or ...
7
votes
3answers
104 views

How to do a surface plot of a function

I would like to create a surface/contour plot of (y+ln(1-x))^2/y^2 for the range of x=0:0.5 and y=1:30. Here the wanted result from Wolfram Alpha. However my attempt in PGF fails miserably: ...
6
votes
1answer
83 views

Extra tick label on opposite axis

I would like my extra x tick label to be on the top of the graph, so that it would not interfere with the others tick labels. How can I manage to do that? Here is a minimal working example: ...
1
vote
0answers
54 views

Pgfplot with logarithmic x-axis to zero

I'm busy creating a learning curve, however I am unable to get my plots (blue) and my baseline (black) to zero. I use a logarythmic x-axis with fixed tick points. When i use xmin > 0, my whole plot ...
4
votes
3answers
122 views

How to remove the white spaces in the margin of pgfplots?

I have the following code from pgfplots's web site. I execute it but I get a full pdf file as shown below: However, I would like to reproduce the figure as given here ...
0
votes
0answers
49 views

Quiver plot with scaled arrowheads

This is a follow-up question to this one. Here is a MWE showing the problem: \documentclass[tikz]{standalone} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{pgfplots} ...
3
votes
1answer
44 views

Draw axis line on top macro does not work with colorbar

I have a macro from here: Force "axis on top" for plotmarks in pgfplots Which allows me to draw the axis line on top of the markers. However, if I use it in conjunction with a colorbar, it ...
2
votes
1answer
59 views

PGFPlot no line between data points when reading from table

I have been searching stackexchange aswell as the pgfplots and pdfplotstable documentation. My problem is that when i read into the data from a *.txt file and I select the columns and rows i want to ...
2
votes
0answers
44 views

Box plots from dataset with metadata in one column and data in another

How can I instruct pgfplots to generate a boxplot from a dataset with an identifier in one column (Label in the example below) and the data in another column (Value in the example below)? I would like ...
0
votes
0answers
39 views

Auto label points read from file

My question is the following, I read data from txt file where the data are stored as: North,East 1,5 4,7 a file with code \pgfplotstableread[col sep=comma, header=true {data.csv}\table; \addplot ...
2
votes
1answer
115 views

How can i use the content of the \usepgfplotslibrary{fillbetween} in the LaTeX Code WITHOUT the order: \usepgfplotslibrary{fillbetween}

Hey I have to use LaTeX in Wordpress with the plugin Quicklatex. There is a problem while using the pgfplots package. When I type \usepgfplotslibrary{fillbetween} in the preamble, i get the error: I ...
4
votes
1answer
43 views

my centering command does not work! why?

I am going to plot a bar histogram using the following command: \documentclass[a4paper]{report}‎ \usepackage{pgfplots}‎ \pgfplotsset{compat=newest}‎ \begin{document}‎ \begin{tikzpicture}‎ \centering‎ ...
0
votes
0answers
31 views

Animate pgfplots of data stored in external files

Can I generate an animation plot of data stored in external file as txt file? The data are stored as X Y Z 20 20 20 40 50 60 ... And I want generate in a single file two plots animated: x vs ...
5
votes
1answer
74 views

pdfpages-PDF appears in background of pgfplots-plot

I'm using pgfplots with the externalize feature, which creates external pdfs for all my plots. But there seems to be a strange interaction with pdfpages when externalize is used. The pdf I'm including ...
3
votes
0answers
90 views

Pgfplots Boxplots with a thick line at the mean value

pgfplot produces nice looking plots, that have consistent look and feel. But sometimes you have a good reason to change that look, and I found it tricky to change style of an specific line, circle, ...
1
vote
1answer
44 views

Shared legend below a group of horizontally aligned figures in pgfplots [duplicate]

How should I run the following example code using /pgfplots/legend to name={<name>} to put a shared legend below a group of horizontally aligned figures? The example code using ...
4
votes
0answers
236 views

Batman Equation in LaTeX

Based on the answer from Gonzalo Medina, the Batman Equation in LaTeX is nearly finished. \documentclass[border=10pt, tikz]{standalone} \usepackage{pgfplots} \usetikzlibrary{arrows} \tikzset{ ...
3
votes
1answer
94 views

Coordinate System in Tikz with plottet with one equation

I would like to have this coordinate system (with numbers on the axes): I know how to make it in Tikz; but the numbers on the axes are missing and I would like to add a plot: ...
0
votes
0answers
26 views

Print issue 3D pgfplots, shader=interp

I have some trouble with printing a 3D plot created with pgfplots. With using an interpolation shader, the map is not printed. The same problem accours when I copy and past my pdf, the map disappear ...
3
votes
1answer
64 views

pgfplots external with large dataset (lualatex?)

I have fairly large datasets with densely strucutred data that i cant downsampe much without loosing structure. I use TexMaker on Ubuntu 14.04LTS. I use \usepackage{tikz,pgfplots,pgfplotstable} ...
8
votes
3answers
1k views

Helix on a cylinder

I want to plot geodesics on a cylinder. These are straight lines, circles or helices. I can plot the first two, but I don't know how to draw the helices. To be precise, I would like to know how to ...
2
votes
1answer
37 views

pgfplots: locally activating linear scale in a log scale plot

I have the following short example: \documentclass[tikz,10pt]{standalone} \usepackage[utf8]{inputenc} \usepackage{amsmath,amsfonts} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
2
votes
1answer
160 views

Scaling inset plot relative to main plot axis length

I want to create a plot with a second, smaller plot as an inset. This is easy enough using the following code, where the widths of the plots are defined. However, I often use figures in several ...
2
votes
1answer
48 views

Filling in with pgfplots and draw

I created the following polygon: \tikz \draw[very thick,name path=A] (0,15) to [out=0,in=270] (15,30); \draw[very thick, name path=B] (0,15) to [out=0,in=90] (15,0); \draw[very thick,name path=C] ...
1
vote
1answer
65 views

Default curve style in pgfplots

Can I set a default style for curves in pgfplots? E.g. I want all my curves in my document to be blue, axes black.
3
votes
1answer
124 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} ...
6
votes
1answer
91 views

Can I increase the accuracy of pgfplots?

Working on a pgfplots solution to this question, I faced the following problem. When I plot only one branch of a square root function, the plot seems to be OK; but when I add the minus part of the ...
0
votes
0answers
44 views

Latex bar graph PGFPlots

Im trying to create a bar plot but something doesn't go quite right the bar plot is sort of scrambled and i can figure out where it goes wrong . Here is what is have ...
4
votes
2answers
166 views

my first animate project times out

The last few days I have been working on a visualization of the clark/park-transformation used in electrical engineering. It's look like this: This whole file is "dynamic", meaning that if I change ...
1
vote
0answers
48 views

Calculate pearson correlation, r in pgfplots

Is it possible to calculate the pearson correlation, r or r^2 value from a linear regression using pgfplots? I already have the curve and would like to display the r value in the legend. I couldn't ...
5
votes
1answer
1k views

pgfplots - how to create a horizontal line plot in a bar chart with symbolic x axis labels

I was wondering if there was a way to get the line plots "Unseamed" and "Requirement" to span the whole width of the graph not just from the centre points of the first and last x axis labels. Is there ...
4
votes
1answer
96 views

How to make a nice legend for a histogram with pgfplots

I am trying to make a histogram with the fitted curve plotted on it. Here's the mwe: \documentclass[a4paper]{scrartcl} \usepackage{tikz} \usepackage{pgfplots,pgfplotstable} ...