{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
1answer
99 views

Indicating the differential on a graph

i would like to indicate on a graph the error in estimating f(x) using a linearization to the graph of f. To indicate the distance between points A and B, I would like a thin vertical line, with ...
2
votes
1answer
56 views

“Dimension too large” while working with serial date numbers

I export plots using matlab2tikz and pgfplots from MATLAB to TeX. Most of my plots contain "serial date numbers", which are the days since January 0, 0000. As you can guess, the numbers get quite ...
2
votes
0answers
39 views

X label in multiple bars and problem in bars

Can someone help me in this problem? I am trying to draw an histogram, but I am having some problems. This is the histogram I have made so far: \begin{center} \pgfplotstableread{ 1 800 900 ...
1
vote
0answers
109 views

PGFplots (windows and linux) compile problem

So I am writing a report with a group where I am using Debian with texlive and my groupmates are on both Win 7 and Win 8 with miktex. I have made some plots using PGFplot on my machine, looks like ...
2
votes
0answers
23 views

Removing commas in x-axis values for pgfplots graph [duplicate]

I want to remove the commas in the x-axis values for a pgfplots graph. Here is an example with commas: Is there a way of removing these commas only in the x-values (not in the y-values)?
3
votes
1answer
75 views

Combining surface plot, explicit colour and legends in pgfplots

This question is a result of this one. I would like to make a surface plot using tikz/pgfplots using explicit colour and including legends. Is this possible? I have gone through the entire manual for ...
1
vote
0answers
37 views

matlab2tikz/pgfplots: Tick-labels in axis cannot be overwritten [duplicate]

I want to export plots from MATLAB to tikz and use matlab2tikz to do so. Most of the data I have has dates on its x-axis. In MATLAB I use serial date numbers to store the time. I override the ...
2
votes
1answer
60 views

How to change the color of extra grid lines according to the extra tick color

My problem is similar to the one described in Is it possible to assign to two extra x-tick labels different colors?, so I just took the code from there. Additionaly to the different colors of the ...
4
votes
1answer
81 views

pgfplots: extending a regression line beyond the tables points

How can I extend a regression line made in pgfplots? I would like to extend the line to just shy of the top of plot boundary and just above the bottom of the plot boundary. ...
4
votes
2answers
199 views

Drawing a Cube with Tikz/PgfPlots Looks Stretched along X-Axis

I'm trying to draw a cubic structure (fcc crystal structure) with Tikz. I'm using pgfplots' axis cs function for the 3D projection. But the result looks like a rectangle stretched along the x axis. ...
2
votes
0answers
54 views

Mosaic/Marimekko charts; does this answer still work?

I found this answer How can I produce a mosaic chart / Marimekko chart? and have used it before to create beautiful charts. Under Texlive-2014, with pgfplots version 1.10, I receive a lot of white ...
7
votes
1answer
102 views

Pgfplots: styling the grid properly

I have to draw a grid with coordinates and lines. I was going to do this manually with TikZ, but it seems like pgfplots might be the cleaner way to go. Right now this is what I have with pure TikZ ...
3
votes
1answer
101 views

pgfplots: bar plots and xticklabels display

I have a bar plot and I would like to set x labels but when I do so, the x-axis is not appropriate: \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
6
votes
2answers
236 views

Plotting a distribution with tikz package

I'm trying to generate a plot of a censored Gamma distribution. I've managed to make the plot of the Gamma-pdf and reference the censoring point, but I'm failing to suppress anything beyond it. In ...
3
votes
0answers
88 views

Pgfplots: How do I make a style with consistent width while using `axis equal image=true`?

Workaround: If I set height very large, the width of the resulting plot is what I want and the resulting height is no more than it needs to be. In my case, I can set height=11in, which is the height ...
6
votes
1answer
103 views

How to recreate this graph?

I'm quite new to drawing graphs. I have the following table: \begin{tabular}{rrrr} \firstrow Frequency/[Hz] & $V_{pp}$/[V] & $V_{rms}$ DMM/[V] & $V_{rms}$ scope/[V] \\ 50 & ...
5
votes
1answer
117 views

Unintended line thickness variation with pgfplots

I admit that I may be abusing pgfplots somewhat, but I want to add a plot of a function into a tikz-picture in a certain way. I have now managed to get this to run, I'm just wondering why the line ...
2
votes
1answer
53 views

Choosing the bar size with symbolic x coords option

When I use both "bar width" and "symbolic x", pdflatex gives me the following error message: ! Package pgfkeys Error: I do not know the key '/pgfplots/bar width' and I am going to ignore it. ...
7
votes
1answer
202 views

TikZ/PGF 3.0 datavisualization vs pgfplots

To follow-up on a previous question TikZ datavisualization or pgfplots?, the current release of TikZ 3.0 has a flexible datavisualization engine that creates the same kind of plots as the more mature ...
4
votes
1answer
210 views

Glitch in 3D surface plot using pgfplots

I want to plot a surface plot in two parameters with pgfplots. A part of the surface which should appear behind the main surface as above it, which looks like a glitch. If I reverse the y axis, ...
3
votes
1answer
97 views

Tikz: Position dodge on the x axis?

For my 2x2 factorial data, I want to create a line plot with confidence intervals in Tikz. The x-axis ticks are supposed to have a small offset so that the confidence intervals of the two plots do not ...
0
votes
1answer
168 views

Mapped grid color for pgfplots colorbar

I am trying to use a variation of the mapped color for a prepared contour plot. The line color is correctly adjusted using draw color=mapped color!50!black, but I am unable to use the mapped color ...
4
votes
1answer
365 views

Scatterplot with data from CSV file and trendline

I have created a scatterplot with code from this previous asked question. \documentclass[varwidth=true, border=2pt]{standalone} \usepackage[utf8]{inputenc} % this is needed for umlauts ...
4
votes
1answer
135 views

outline a plotted graph?

To outline a path in white, one usually the draw the path larger and fill it in white, then copies the original path filled in black over it. This is to better separate it from the background. But ...
6
votes
2answers
197 views

Drawing a sawtooth waveform ontop of a sine wave PGF plots

I have a fully rectified sinusoidal wave that I am trying to place a sawtooth wave form on top of as the image bellow, I originally had a messy solution but it was not very good, I have a tex sine ...
2
votes
1answer
56 views

symbolic x coords not aligning correctly, missing data

When I compile this code: \documentclass[11pt,a4paper]{article} \usepackage{geometry} \geometry{margin=1in} \usepackage{tikz} \usepackage{tkz-euclide} \usepackage{pgfplots} ...
5
votes
1answer
121 views

Extreme pgfplots — Improve 3d polar plot resolution and prevent “TeX capacity exceeded”

So I have this 3d polar plot describing an antenna's radiation pattern, generated with the data exported from the simulation program. The spike in the middle is the main feature of the radiation ...
3
votes
1answer
55 views

Add custom entry into legend in pgfplot

I want to add some manual entry in the legend for explanation of the characters 'A' and 'B' on the left side of the plot. I have no other idea where to put the definition of them. So, below "Plot ...
0
votes
1answer
94 views

pgfplots move colorbar scaled label to top right

Hi I was wondering how to shift the scaled label on the colorbar to the top right? The has been autogenerated by matlab2tikz, but I would like to move the .10^-3 to the top right like it was ...
2
votes
2answers
157 views

A voltage graph in PGF plots

Would it be possible to achieve this in PGF plots? I can manage to get a sine wave and draw the sawtooth looking wave but cant get it all together
1
vote
0answers
53 views

pgfplots xbar stacked with grouping

I want to make a plot with xbar stacked style but some ylabels should be grouped together. I found this question and solution How can I mix an “ybar” and an “ybar stacked” with pgfplots?, but it is ...
1
vote
1answer
53 views

Axis labels shifts off centre when using the xscale function

I have a plot to go into a report that needs to have the horizontal width increased, whilst maintaining the original vertical height. I am currently using the an xscale=1.7, however this shifts the ...
8
votes
3answers
184 views

atan2 does not work with pgfplots

Trying to plot the amplitude and argument of two sine waves in terms of their amplitudes and phases using pgfplots, An error appears while compiling the atan2 function (supported by pgfmath). Here is ...
4
votes
1answer
77 views

Pgfplots closes paths in polar plot

I'd like to create an antenna radiation pattern in the form of a polar plot like this one: (image credits: C.A. Balanis; Antenna theory, analysis and design) What I've done so far is the following ...
2
votes
2answers
348 views

How to draw the graphs of sin x and cos x on two separate grids next to each other in TikZ

I got stuck and decided to go here. How would I draw two graphs of sin x and cos x next to each on TikZ with intervals of -2π to 2π? This seemed like something easy to do in TikZ but I'm having ...
3
votes
0answers
72 views

Creating a tornado plot with pgf and force a break in one of the horizontal bars

To display a sensitivity analysis I want to produce a Tornado plot. In the plot a specific base case value is compared to the values produced after changing parameters in the model. I started from ...
2
votes
1answer
136 views

How can I renew /pgfplots/xmin (and the other 3 values) after a coordinate transformation?

I use "hybrid" coordinates made out of \ymin and raw x- and y-values. It's pretty comfortable to use, thanks to Gonzalo: \newcommand{\getpgfkey}[1]{\pgfkeysvalueof{/pgfplots/#1}} ...
5
votes
1answer
46 views

extra y ticks not shown as yticks with scaled y ticks

How can I show the extra y ticks as the rest of the labels on y axis? Here is my MWE, I tried scaled extra y ticks=real:1000 commented out in code but without success. \documentclass{standalone} ...
3
votes
3answers
208 views

Moving a tick mark

I would like to move the tick mark -2 on the x-axis from its usual spot to above the x-axis. I drew a dashed line from (-2,0) to (-2,-4) and I don't want it drawn over this tick mark. ...
3
votes
1answer
58 views

Problem with plot using pgfplots

I'm trying to plot the exponential function using pgfplots, but no matter what I change, I get only a part of the plot. Here's the code (the code and the image were made using exp(0.25x) instead of ...
3
votes
1answer
139 views

How do I make a Bezier curve with control points in pgfplots

I would like to create a Bezier curve with control points. I'm having no success finding what I want in the pgfplots manual. I was hoping someone could help me. What I would like to do is create a ...
1
vote
1answer
109 views

Connecting points on graph via dotted lines

How could I connect these points with dotted, vertical lines? \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[axis lines=center] \addplot [only ...
3
votes
1answer
130 views

Horizontal Movement of a Rotated Label in PGFPLOTS

In the following code I have a long label at one of the arrow heads. I would like to rotate the label by 90 degrees and then place it right below the arrow head. I used the rotate option and the pos ...
8
votes
1answer
118 views

How to draw Area Charts [duplicate]

I want to draw an area chart, something like this I dont know how to fill the area with colors, here is what I have \documentclass{standalone} \usepackage{pgfplots} \usepackage{xcolor} ...
3
votes
1answer
89 views

more precision on the barplot pgfplots

I would like to change the graph to show the 14.047 is less than 15, more decimal precision \documentclass[12pt,a4paper,onecolumn, openright]{report} \usepackage{xcolor} \usepackage{pgfplots} ...
2
votes
0answers
65 views

Part of specified graph is missing

I have the code to graph a rational function f(x)=(3x^{2}+5x)/(2x-3) with a vertical asymptote and a slant asymptote. The equation for the vertical asymptote is x=3/2. I decided to have two parts to ...
3
votes
2answers
55 views

Pgfplots labels jump between beamer slides

Below is a MWE that demonstrates my problem. The problem is how the labels move through each slide. It seems as though they are first right aligned and then become centered for the next slide. How can ...
3
votes
2answers
158 views

Fitting the asymptotes and graph of a function onto the pictured Cartesian plane using pgfplots

I would like the code that instructs TikZ to plot the asymptotes to the graph for the rational function y=(x+2)/(x-1). What is the code for plotting these lines as a dashed lines with arrowheads? (I ...
4
votes
1answer
84 views

One line drawn longer than another line on the same Cartesian plane

Why are the two lines drawn to different lengths? The slanted line should be shortened a bit - maybe by 2ex - and the vertical line should be lengthened to obtain the same height that the slanted ...
1
vote
1answer
58 views

Problem with documentclass memoir + pgfplots from data file

I'm using the documentclass memoir and I want to make a plot from a file.dat of two rows, nothing special. But I keep getting that pgfplots could not open the file. The point is that if I make a new ...