{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

3
votes
1answer
37 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
80 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 ...
3
votes
1answer
64 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 ...
5
votes
1answer
90 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 ...
1
vote
0answers
30 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
36 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 ...
0
votes
1answer
51 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 ...
4
votes
1answer
60 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 ...
3
votes
0answers
64 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
2answers
214 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 ...
5
votes
1answer
35 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} ...
4
votes
1answer
109 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 ...
8
votes
3answers
124 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 ...
1
vote
1answer
56 views

How can I print the axis descriptions only once in a groupplot? (background: symbolic x coords breaks “xlabels at=bottom edge” option)

I am using symbolic x coords in a groupplot. This proves problematic as I can't disable the ticks and tick labels for the upper plots without losing the xmajorgrid. I can't seem to find the ...
3
votes
1answer
51 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 ...
1
vote
1answer
76 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
75 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 ...
3
votes
3answers
156 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. ...
2
votes
0answers
54 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
44 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
1answer
99 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 ...
4
votes
1answer
71 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 ...
6
votes
2answers
138 views

Why does PGFplots not recognize my expression?

I want to graph two quadratic equations using pgfplots. The first one work fine, however when I add the second equation, I get the following error message: Package PGF Math Error: Unknown operator ...
8
votes
1answer
106 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} ...
2
votes
2answers
81 views

Drawing and labeling asymptotes

How do I label the asymptotes for the rational function y=(x+1)/(x-1)? I copied the code \draw[dashed,latex-latex] ({{1,0}}|-{{axis description cs:1,1}}) -- ({{1,0}}|-{{axis description cs:1,0}}) from ...
3
votes
1answer
76 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} ...
5
votes
1answer
82 views

Pgfplots: picture moves with sample size!

I'm quite new to pgfplots and I must be doing something wrong. I'm plotting a piecewise function using the following code: \documentclass{amsbook} \usepackage{pgfplots} \pgfplotsset{compat=1.8} ...
7
votes
3answers
260 views

How can I plot the F distribution

I wish to plot the F distribution by declaring its density function. However with the following code I get an error saying that fdst has not been declared: \documentclass[border=5mm]{standalone} ...
2
votes
1answer
118 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}} ...
2
votes
1answer
93 views

Half filled circle marker

How can I draw a half filled circle on my axis. I would like the marker to be at the origin and be filled on the left half of the circle. \documentclass[12pt,]{article} \usepackage{graphicx} ...
3
votes
2answers
134 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 ...
3
votes
1answer
26 views

plot data with pgfplots if meta column meets criteria

I have a data file with many columns, and I want to plot bwgstar vs servers for n=2. So n is the meta column, servers is on the x-axis, and bwgstar is on the y-axis. I want to do this within the ...
6
votes
1answer
195 views

Why is my 3D graph not compiling?

I'm new to LaTeX, and I'm trying to create 3D graph with 180 points. I tried to compile it, but after 25 minutes it still hadn't compiled, although my computer sounded like it was working quite hard. ...
6
votes
1answer
86 views

Plotting multiple lines with a colormap in pgfplots

I have a similar question to Steve Hatcher from this thread: Spectrum colormap for multiple curves I have a data file (mwe_data.txt) which contains multiple columns. The first column is the x-axis, ...
2
votes
0answers
18 views

Changing max/min a function will be plotted with pgfplot [duplicate]

I was hoping someone could shed some light on this issue: When I plot a function using something like \addplot+[mark=none,smooth,] (\x,{2 * \x^2 + 4 * \x + 1}); the line of the function does not ...
2
votes
1answer
36 views

TikZ with multi colum datas

I have a data file containing 3 columns, X, Y and Z. X Y Z # datas from the natural movement of a robot 0.0000000e+00 3.3891017e-01 -1.3249598e-01 ...
2
votes
1answer
68 views

axis alignment for 3D graph using matlab2tikz

I am trying to include multiple 3D figures (created in matlab) into a latex file. The original 3D figures in matlab look like this: In the .m file that creates these figures, I use ...
2
votes
1answer
52 views

Not distinct x values and different domain in one graph

I want to plot data like this \pgfplotstableread{ x y 5 10 6 12 6 12 7 11 }\dataA \pgfplotstableread{ x y 5 8 5 15 6 10 7 13 8 14 ...
8
votes
2answers
442 views

Plotting 1/(x^2) - graph looks weird near x = 0

I'm a beginner to LaTeX, so the amount of variables I can change to modify a graph/plot get confusing. I found similar questions on the site, however all of them propose different solutions with ...
1
vote
1answer
58 views

How to put a table next to a plot?

I made a plot and a table, and I want to put the table next to the plot, how can I do that? \begin{tikzpicture} \begin{axis}[ axis y line=center, axis x line=middle, axis equal, grid=both, ...
0
votes
2answers
88 views

Scale Y and X axis in pgfplots

I made the following plot, and the numbers are print to close together. How can I scale the the y and x axis? \begin{tikzpicture} \begin{axis}[ axis y line=center, axis x line=middle, axis equal, ...
0
votes
1answer
25 views

how to make a plot with consecutive numbers in x and y axis?

I made this plot but I want consecutive numbers from 1 to 10 in the labels for the x and y axis. The current plot shows 0 then jumps to 5 and 10. \tikzpicture \begin{axis}[ axis y line=center, axis ...
3
votes
1answer
75 views

Clipping plots to other plots in pgfplots

I'm plotting a convex frame as shown below, with the given MWE. Inside this frame, the idea is to plot additional functions to create an image. In order to avoid manually computing the domain ...
5
votes
1answer
102 views

pgfplots: horizontal distance between two plots

I'm trying to plot the following graph using pgfplots: This plot was generated with matlab. I can easily plot the two curves with pgfplots but I have no clue how to add the vertical line with the ...
2
votes
1answer
106 views

Is there a reliable way to define the scale label's position in a groupplot in relation to the respective label?

I was asked to try and put the scale labels for the yticks not right above the north west corner of the plot as it is rather unusual. Personally, I tend to agree. It works easily but above left might ...
5
votes
2answers
119 views

pgfplots - How can I change an option (e.g. xlabel) for all subsequent groupplots?

If xlabel or ylabel are defined in the groupplots options, the values are used for all subsequent plots. Same with other options. Can one change the xlabel for all following groupplots from one point ...
0
votes
0answers
79 views

How can I plot Binomial and Poisson Cumulated Distribution Functions?

I know that \begin{tikzpicture}[ declare function={binom(\k,\n,\p)=\n!/(\k!*(\n-\k)!)*\p^\k*(1-\p)^(\n-\k);} ] serves to declare the p.m.f. for the binomial distribution with TikZ, and that ...
2
votes
1answer
83 views

Shaded area in graph behind axes and plot, plot in front of axes

I want part of the graph shaded. The problem is of course that shade is above axis and grid, like in MWE below. Of course, I also tried axis on top option, but the problem is that in this case plot ...
2
votes
2answers
134 views

octopus-graph tikz/pgfplots

EDIT:I found a solution. See below. i'm trying to get something like this: I have small dots and big dots, and some small dots are connected to one big dot. I can "plot" all points with pgfplots: ...
2
votes
1answer
89 views

Contour plot using pgfplots where some data entries are NaN

I would like to make a contour plot of data that has been saved in a text file that consists of three columns where the columns are x_i, y_i and z_i and some elements z_i are NaN. I use MikTex 2.9 ...