Tagged Questions

{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
2answers
47 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
117 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
81 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
144 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
115 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
92 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
86 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
92 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
280 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
128 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
106 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
146 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
31 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
196 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
109 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
84 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
53 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
458 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
63 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
106 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
29 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
77 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
116 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
115 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
132 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
89 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
97 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
149 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
123 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 ...
3
votes
1answer
65 views

Conditionally use bold font for table cell with pgfplotstable

I am trying to conditionally use bold font for table cells with values according to a condition. It works nicely with changing the text color as illustrated in the example below, but I am not able to ...
6
votes
0answers
47 views

What is this glitch in pgfplots? Plot seems cropped [duplicate]

I have this plot generated following the answers proposed here. \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \pgfkeys{/pgfplots/x axis shift ...
8
votes
4answers
403 views

How to Draw This Free Body Diagram on TikZ or PGFPlots

This is not a duplicate question of the one titled Creating a Free Body Diagram in TikZ. I am confused as to how one might draw this specific diagram: Say we want to describe two masses on a pulley ...
5
votes
1answer
113 views

Why is July Printed Twice on X-Axis?

\documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \usepgfplotslibrary{dateplot} \pgfplotsset{compat=1.11} \begin{document} \begin{tikzpicture} \begin{axis}[ date coordinates in=x, ...
2
votes
1answer
90 views

Modifying some features on the graphs of a function and its inverse

The following code is compiled by pgfplots to graph an exponential function and its inverse. I have some questions about the code, and I would like to modify some of the features of the graphs. How ...
2
votes
2answers
96 views

Plotting standard error

I am trying to create a chart with the std error but I can't seem to get it to work the way I want it to. I want to get rid of the line between every entry. This is what I have right now: ...
1
vote
0answers
75 views

Unequal bin widths in pgfplots density histogram

In the pgfplots manual, it talks about density histograms with equal bin widths/ranges. Is it possible to make a density histogram with specified unequal bin widths/ranges? For example, if I set ...
4
votes
1answer
98 views

Hide y labels in pgfplots, and make coordinates fit inside of the pdfplot box

I want to compare time spent on different simulation with bars from a pgfplot that show my simulation time. Here is the code: \begin{figure}[htbp] \centering \begin{tikzpicture} ...
5
votes
1answer
92 views

How can I add open and closed circles on either side of a jump discontinuity?

How to indicate "including" and "excluding" dots on the graph? \documentclass[paper=a4, fontsize=11pt]{scrartcl} \usepackage{pgfplots, pgfplotstable} \usepackage{tikz} \begin{document} ...
6
votes
1answer
140 views

Plotting one x- vs multiple y- using custom color map

I am trying to plot data that comes in the form of one x-axis vs multiple y-axis on the same plot. I would like the color of each line to spread itself out through my desired color map (spectrum ...
4
votes
2answers
89 views

pgfplots axis abbreviation

Suppose I have a pgfplot with the following axis text: |-----|-----|-----|------| 0 500 1000 1500 2000 Is there a way to change axis text to: |-----|-----|-----|------| 0 0.5K 1K 1.5K ...
6
votes
1answer
93 views

3D surface plot with axis inside plot

I try to draw the energy surface of a magnetic particle. For this i want the axis system to come from the inside of the particles pointing to the ouside. Ist ist basically the example below, but with ...
4
votes
1answer
85 views

pgfplots interpolation

Whats the best way of interpolating a graph and show the interpolation like this (using pgfplots): I have the following code for my plot in an axis environment: ...
1
vote
1answer
180 views

Miktex 2.9 pgfplots, circuitikz library collision problem

In my book, I use both libraries. After Miktex update yesterday evening (circuitikz ver 0.3 pgfplots 1.11), I have problem with compiling following code: \documentclass{article} \usepackage{tikz} ...
8
votes
1answer
189 views

How to fix this interaction bug between pgfplots and babel-french module?

Here is an example of a minimum non-working case which is generating the bug: \documentclass{standalone} \usepackage{luatextra} \usepackage[frenchb]{babel} \usepackage{pgfplots} \begin{document} ...
4
votes
1answer
121 views

pgfplots generating incorrect boxplots

While trying to reproduce some boxplots using pgfplots (and analyzing samples automatically), I noticed that in some cases I was getting different plots from Matlab. I have left all the settings in ...
2
votes
1answer
80 views

Scatter plot with a grid and axis lines going through the origin

I want to make a scatter plot with error bars (using pgfplots or tikz) with two characteristics; I need the two axes to meet at (0,0), and a grid in the background. I tried to google this a number of ...
2
votes
1answer
89 views

Is it possible to assign to two extra x-tick labels different colors?

I think the question says it all. I'd like to have two extra x tick labels with different colors. I thought of using a cycle command, but I couldn't figure out how it should work. I changed the color ...
1
vote
1answer
56 views

pgfplots - How can I address the coordinates of a plot's title in a groupplot?

Say I provide a title to a groupplot via title={Word} Is there a way to address the area of this node, e.g. via .north west and so on (as detailed on page 314 in the manual)?