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
1answer
53 views

Clipping 3D plots using pgfplots

This is a follow-up question to Plotting a function on a triangular domain using tikz. I am interested in plotting three functions on a triangular domain, specifically x*y ...
0
votes
0answers
26 views

Linear Regression with symbolic x-coordinates

I have been having difficulty with this problem for a few days now so I'm hoping you can come to my aid. I am trying to create a line of linear regression for a very small chart using pgfplots. ...
3
votes
1answer
37 views

Reverse Axes of pgfplots Ternary Plot

I am trying to make a ternary plot, however the default axis is opposite of what I need to accomplish. Here is an example: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.9} ...
1
vote
1answer
40 views

pgfplots tikzpicture node to the right of axis is cut

I have a piecewise-defined function and would like a describing node to the right end of it. Unfortunately the node is cut and not visible using this code: \begin{tikzpicture} \begin{axis}[ ...
3
votes
0answers
30 views

Labeling only one tick mark but having other tick marks on x-axis

The code provided has pgfplots mark 5 tick marks on the x-axis (at increments of 5 starting at 5). I would like to have only one extra tick mark labeled - the one at 2. \documentclass[10pt]{amsart} ...
3
votes
1answer
120 views

Plotting a function on a triangular domain using pgfplots

I would like to draw a function on a triangular domain using tikz. For example, I would like to draw the function x*y on (-1, -1) -- (-1, 1) -- (1, -1). This is a MWE for the rectangular domain (-1, ...
1
vote
1answer
29 views

Externalizing figures in consistent size

I'm using pgfplots to plot figures, then I'm using the externalize library to output standalone pdfs, which I include in another document. The problem is that the outputted standalone figures have ...
3
votes
1answer
24 views

Moving one tick mark on y-axis to the right of the y-axis while keeping others to the left of y-axis

I have a plot for the function y = 15x - (1/4)x^{3}. I am labeling the local maximum value of the function with 20\sqrt{5} on the y-axis. I also have other tick marks on the y-axis. I want the ...
2
votes
0answers
28 views

Centre plot inside a node (Sigmoid Neural Node) [on hold]

Essentially I want to make a graph topology of a neural network. Since I have different type of nodes (rbf, sigmoid, linear) I want them to have in the node a shape of the function, something almost ...
1
vote
1answer
35 views

pgfplots very small Y values

I need to plot the following function: ...
3
votes
1answer
31 views

pgfplots “every quiver plot” style key?

I would like to add the same set of options to every pgfplots “quiver plot”. PGFPlots provides style like every axis plot to add to every plot, but quiver plots are created inside a quiver={...} ...
4
votes
1answer
26 views

pgfplots cannot read file

I am trying to use package pgfplots to read data from a file. This code is compiled on MacTeX 2014 under OSX 10.8. Here is a snippet from the file in question: etotal.dat T Y 0.7618 0.060 ...
6
votes
3answers
143 views

Text projection onto plane in 3D pgf plots

I'd like to have text that appears as though it's written "on" one of the walls of a 3D tikz plot. MWE: \documentclass{standalone} \usepackage{tikz,pgfplots} \usetikzlibrary{positioning,3d} ...
0
votes
2answers
84 views

Rectangular Approximation Method (Riemann Sums) Diagrams

Does anyone know how to make relatively simple diagrams like the images below? Is there a some sort of "template" I could use perhaps? I'd like to code my Calculus notes but I'm not sure how to make ...
7
votes
3answers
203 views

cannot combine \foreach and \draw

I just cannot debug this code. After typesetting it keeps on giving the error of: "Undefined Control Sequence" When individually coding rectangles for each set of coordinates the code works though, ...
0
votes
0answers
41 views

Pgfplots externalizing figures: (inconsistent) white borders

I'm using the external library \usepgfplotslibrary{external} \tikzexternalize[prefix=tikz_figures/] to externalize my figures from one document and include them in another. The problem is that the ...
10
votes
1answer
132 views

Draw closed section of sphere using pgfplots

I want to draw a section of a sphere to represent its volume. I have currently got the following: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.11} \begin{document} ...
3
votes
1answer
56 views

How can I add a reasonable padding to this bar chart?

I’m trying to add a uniform padding to all sides of this bar chart. In a different answer on tex.SE I have found the following code, however, I wasn’t able to find values for xmin and enlarge x to ...
1
vote
0answers
28 views

pfgplots: customize annotation for one point

I have the following scatter plot: \documentclass[class=elsarticle]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ enlargelimits=0.2, xlabel=Depth, ...
2
votes
2answers
36 views

Reducing space between annotation text and the line in a pin (PGFplots)

I need to reduce the distance between annotation text and the line which together form a conventional pin in pgfplots, see the figure below. Could anybody help me with this, please? MWE: ...
2
votes
1answer
27 views

pgfplots is skipping first ytickslabel from file

Rendering the MWE below pgfplots skips the first 'Adiff' label of the CSV. I'm sure this is a no-brainer and easy karma points for experienced pgfplots users, but I am stomped. ...
1
vote
1answer
24 views

Removing multiple scaling factors in pgfplots

I would like to place a single scaling factor in the top left corner, which seems to be default normally, instead of having factors of 10^n at every y axis tick. In other words, I would like to ...
1
vote
0answers
39 views

How to group box plots in pgf / tikz?

Grouping bar charts is easily done using pgf / tikz, e.g., \begin{tikzpicture} \begin{axis}[ width = 0.85*\textwidth, height = 4cm, major x tick style = transparent, ...
4
votes
2answers
115 views

Draw cosine and sine function with periods 1?

I want to draw $\sin(2\pi x) and $\cos 2 \pi x$ $\in [3/4, 5/4]$ in the same coordinate system. How do I do this ? \begin{tikzpicture} \begin{axis}[domain=3/4:5/4,legend pos=outer north east] ...
4
votes
1answer
79 views

Invoke gnuplot through pgfplots to get a matrixplot

I have a code which gets two parameters and depending on them the code has different runtimes what I want to illustrate in a matrix plot. I'm writing the thesis in LaTeX the obvious method for me, ...
-1
votes
0answers
59 views

Figure plot using pgfplots

Please help me code this figure in LaTeX. I am a beginner in LaTeX.
5
votes
2answers
196 views

Reducing the white space about a tick mark

I have two tick marks on the x-axis: -\sqrt{3} and \sqrt{3}. I have shifted both of them horizontally to reduce the amount of the sketch of the function they obscure. (I used the option axis on top.) ...
3
votes
0answers
47 views

Compactifying histogram at empty tick values

I have the following histogram: \begin{tikzpicture} \begin{axis}[ x tick label style={ /pgf/number format/1000 sep=}, ylabel=Throughput, enlargelimits=0.15, legend style={at={(0.5,-0.15)}, ...
5
votes
1answer
97 views

Add circle to Smith chart using PGF

I'm using the Smithchart library with PGF/TikZ, and I'm trying to add a simple circle in the middle of the chart. However, the circle is plotted using the "smithchart coordinate system" so it looks ...
3
votes
1answer
75 views

combined legend for a pgfplots layered style plot

Based on a question and the answer I have provided for it; now I have a question about adding legend to a plot which is made by means of the layered feature of the pgfplots. As far as the legend ...
5
votes
1answer
73 views

Plot histogram and add already fitted density function

I want to combine a histogram with a probability density function. Following the advise of Jake drawing a histogram drawing a gamma density function My plan now is to combine the two in one plot, ...
1
vote
2answers
82 views

pgfplots figures in publications

Journals usually ask for the figures in a publication to be in some specific formats (e.g. eps, svg, tiff etc). Now that I have used pgfplots to make all the figures in my article, what is the best ...
1
vote
1answer
44 views

How to create a large table with Pgfplots and string entries?

I tried to hack this here for a larger case but it is firing errors. What is causing the too many columns error and is Pgfplots ideal for this kind of table generation? Goal: table that I am trying ...
3
votes
1answer
68 views

Problem with plotting 3d plot in Latex, I have a sample Matlab plot

I have a Matlab plot shown below which I want to replicate in Latex. The data for Matlab is: i_whole=[ 0 0 0 0 0 3.7000 3.8000 3.8000 4.2000 3.7000 ...
5
votes
1answer
76 views

Drawing bonds between atoms with pgfplots

I'm trying to draw a molecule using pgfplots. I have successfully drawn the atoms with the code below: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \usepackage{tikz} ...
1
vote
2answers
36 views

Moving one tick mark on the x-axis leftward

I want to move one extra tick mark on the x-axis leftward by about 2pt. I have tried using the spacing command \hspace*{-2pt} before the label and \hspace*{2pt} after the label. The tick mark is not ...
5
votes
1answer
43 views

Enable a default static frame for incompatible browsers with the animate package

I am working on a document where I want to embed animations using the animate package. A minimal compilable example of such would be the following: \documentclass{article} \usepackage{pgfplots} ...
4
votes
1answer
57 views

Interpolate grid data to obtain 3d smooth surface

I use this code \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \pgfplotsset{ ytick={0,0.2,...,1}, xtick={0,0.2,...,1}, xlabel={$x$}, ylabel={$y$}, ...
6
votes
1answer
90 views

How draw from an intersection down to x axes?

Based on How to draw in pgfplot until intersection with plot line? I have come up with this: \documentclass{memoir} \usepackage{tikz} \usepackage{pgfplots} \usetikzlibrary{intersections, calc} ...
3
votes
1answer
68 views

Multiple plots with error bars

I want to plot two graphs with error bars from an external file. The data file contains the columns x, y1, y1+, y1-, y2, y2+, y2-, where y1+ etc. are the error bars for the corresponding y-values. ...
1
vote
0answers
15 views

Beamer, booktabs, empheq, pgfplots incompatability [duplicate]

The following minimal example \documentclass{beamer} \usepackage{booktabs} \usepackage{empheq} \usepackage{pgfplots} \begin{document} \begin{frame} Test \end{frame} \end{document} gives the error ...
3
votes
1answer
57 views

\draw not working inside axis environment

Judging from the pgfplots manual I expected the following code to work: \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{figure} \begin{tikzpicture} \begin{axis}[ ...
3
votes
3answers
86 views

How to make pgfplots obey non-rotated boundaries along the axes for a rotated graph?

I'm trying to rotate a simple Gaussian, but when I try to rotate the graph, it seems clear that pgfplots is simply cropping the graph to match the boundaries specified: The above picture shows two ...
1
vote
1answer
46 views

pgfplots with gnuplot: 3d-surface/mesh plot and problems with number of samples

I want to plot a 3d-surface/mesh of a given function via 'gnuplot'. Of course the smoothness of the surface depends on the number of samples. But here I run into a small problem. Take the following ...
3
votes
1answer
36 views

Providing legend for pre-rasterized data

I have a plot containing several million data points (real-time sensor, 50 samples/s, multiple channels, 5 hours). To keep the file size of my document down, I made a bare PNG with the line graph in ...
1
vote
1answer
37 views

Moving a tick mark on each axis but keeping the default tick marks

I would like to move one tick mark on the x-axis and one tick mark on the y-axis. The only tick mark, labeled 16,000/3\sqrt{3}, should be moved to the right side of the y-axis, and the tick mark, ...
16
votes
2answers
265 views

How to make a longitudinal sine wave shading with pgfplots?

At the moment I use TikZ shadings to show up longitudinal waves in my document like this: The shading is white where the sine is –1 and blue where the sine equals 1. This looks ok, but ...
3
votes
1answer
34 views

PGFplots: Tweak two plots to achieve equal heights

The heights of the plots in the following example are slightly differ. Can one get them to equal heights without \resizebox (would mess with fontsize) or setting the height in absolute quantities. ...
3
votes
1answer
55 views

PGFplots: Can I do vector addition/substraction?

I'd like, in the following MWE, to draw a vector from P to P+v and to P-v for some given point P and directional vector v in the axis coordinate system of a pgfplot. Can it be done? ...
3
votes
0answers
38 views

Error message: Dimension too large

I am graphing the restriction of a cubic function on the domain [0, 20]. The function has a maximum value of about 3,079 at about 11.5. To get some view of it, I use the specification unit vector ...