{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

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 ...
5
votes
1answer
77 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} ...
3
votes
1answer
69 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 ...
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 ...
4
votes
1answer
59 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
94 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} ...
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
60 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
88 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
49 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
57 views

Pgfplot : problem with common exponent for ticklabels [closed]

I have plotted 2 similar graphs with Tikz Pgfplot and I am not able to explain why their axes tick labels are not rendered the same way : both use exponent scientific notation (which is what I want), ...
1
vote
1answer
39 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, ...
3
votes
1answer
35 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. ...
0
votes
1answer
109 views

Matlab2tikz, alignment of subplot ylabel (large distance from plot)

Matlab2tikz came to my attention in the past month and have been using the simple tutorial from HowToTeX. It has worked great so far only one issue remains, I am unable to anchor the ylabel to the ...
3
votes
2answers
94 views

Z-order of points in scatterplot

I have the following scatter plot done with pgfplots: The meta value of each point represents its "importance", hence red points are more important of blue ones. The problem is that red and orange ...
3
votes
1answer
56 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 ...
3
votes
1answer
46 views

Format a PGF Plot

I have a simple PGF plot using this code \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{figure*}[htpb] \centerline{ \hbox{ \begin{tikzpicture}[scale=0.6] \begin{axis}[enlarge x ...
3
votes
0answers
56 views

PGFPlots only have one 0 at the origin

When I create a figure using tikzpicture, tikz adds two 0's at the origin for a plot (one for the x-axis and another for the y-axis). I think it looks cleaner to only have one zero at the origin. I ...
3
votes
0answers
101 views

How to draw the vectors from point to point

I have the file "gradmethod.dat" that contains the values ​​of the 3D coordinates: "gradmethod.dat" is 0.4166337995 -0.0003214561 0.1735863062 0.0036860331 0.0076438475 0.0014742969 ...
2
votes
1answer
55 views

pgfplots: Why does samples quantity has such effect on the shape of the plot?

By varying the value of the samples in drawing such plot in pgfplots, the shape of the plots changes so much; is it because of some instability in drawing plots or the function has such behaviour? ...
1
vote
1answer
55 views

How to adjust the legend line length in pgfplots

I have a plot using pgfplots but I need to adjust the length of each legend. I can modify the width of each legend line, but I don't know how to modify the length of them. Is there any option to ...
4
votes
1answer
100 views

Quiver plot with pgfplots: scale arrowheads with arrowsize

It is my understanding that the quiver plot with pgfplots keeps a constant arrowhead size, irrespective of the size (should I say length) of the arrow itself. Is there a way to have the arrowhead size ...
2
votes
1answer
43 views

Label faceted surf in pgfplots

I have a series of X,Y,Z points and like to create a discrete surf plot and label each point. I am using \addplot3[surf...] to generate the plot but I can't figure out how to label the colors. I don' ...
1
vote
0answers
41 views

Pgfplotstable: column math is wrong!

I am using the following code with pgfplotstable to generate a new column that represents the difference of two other columns. \pgfplotstableset{create on use/iqr/.style={ create ...
11
votes
2answers
802 views

plot 3d graphs of functions defined implicitly

How can I plot 3d graphs of functions defined implicitly (quadratic forms, for Linear Algebra course notes -- I'd like to include lots of examples)? As far as I can see it is not possible with ...
1
vote
1answer
78 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 ...
1
vote
1answer
82 views

Side-by-side tikzpicture (use of axis causes problems)

I am struggling with putting three graphs side-by-side in one line. Every solution I could find caused errors because of the usage of axis. \begin{tikzpicture} \begin{axis}[ ...
4
votes
1answer
79 views

Removing exponential numbers from pgfplots

I'm doing a horizontal bar chart, but in my x axis and in the number in each bar is exponential and I want a "normal" number. How can I do that? \begin{figure}[h] \centering \begin{tikzpicture} ...
15
votes
1answer
4k views

Option clash for package xcolor

Im doing a report, and having a rather large table in my appendix. And want to emphasize some specific values by coloring some single cells. I'm trying to do it with xcolor. But receiving the error: ...
4
votes
1answer
68 views

Moving a tick mark horizontally

I have asked about moving a tick mark from below the x-axis to above the x-axis. (I used the specification xticklabel shift=-16pt.) In the following graph, the tick mark is at a point where the ...
5
votes
1answer
59 views

How to use cycle list = black white properly

I am not getting the black white cycle list working. All three graphs are solid black lines. I want them to have different dash patterns though! \documentclass[11pt, a4paper]{article} ...
4
votes
1answer
57 views

Change color of individual bars in histogram of binomial distribution

With the help of Positioning of Pgfplot axis labels I managed to create histograms of binomial distributions. What I still need is to select some of the bars and fill them with a different color or ...
3
votes
0answers
125 views

Illustration of Lagrange multipliers

I want to draw with pgfplots and/or tikz an illustration of Lagrange multipliers. For reminder, Lagrange multipliers are used to optimize thing like this: min_x f(x) such that g(x)=0 Basically, I ...
4
votes
3answers
104 views

How do I arrange 9 figures, evenly spaced out, on a page?

\begin{figure}[!ht] \centering \begin{tikzpicture} \begin{axis}[ width = 12cm, height = 12cm, axis y line = middle, axis x line = middle, grid style = {dashed, gray!50}, grid = both, % Switch on ...
4
votes
1answer
71 views

trend line in pgf plot

I have been trying to fit a trend line using pgf plot for my data and unfortunately can't seem to hit the right spot with the code. I have looked in the manual for examples of linear regression and ...
5
votes
1answer
63 views

pgfplots : Box Plots and two y axis

I'm trying to add some data points on another y axis along with box plots. My experience in TeX is quite limited and I'm not sure why my axis appears in the middle of my x axis instead of at the end ...
5
votes
1answer
89 views

A function is not being plotted on part of its domain [duplicate]

I have specified that the function x(1 - x)^{1/5} should be plotted on the domain [-1.5,2.5]. It is only plotted on the domain [1,2.5]. \documentclass[10pt]{amsart} \usepackage{tikz} ...
2
votes
1answer
48 views

PGFPLOTS: How To Put \addplot boxplot prepared Inside Macro Definition

I have a need to wrap the `\addplot [boxplot prepared]' inside a macro to greatly save typing. It seems simple enough, but the devil is in the details with macro expansion issues. Is this doable given ...
3
votes
1answer
79 views

How can I map a 3D plot into the planes using pgfplots?

After answering a question in pgfplots, asking to plot a function; I thought about how I can map the 3D function into the planes. Something like the plots in this page but I could not reach any ...
1
vote
1answer
66 views

pgfplots: Optional graph range arguments in a macro

I defined a macro that inserts a plot that I can re-use the same graph style in multiple places. Mine actually loads data from a file, but a similar MWE looks like: \newcommand{\drawGraph}[1]{ ...
1
vote
0answers
54 views

PGFPLOTS defintion inside macro inside table or insert boxplots inside table

I am trying to take a plot of a series of boxplots and include/insert these into a table. The code came from a posting of using a data table to define a series of boxplots. The code for the table ...
5
votes
1answer
97 views

How do I format labels for the tick marks in pgfplots

I'm finding it very difficult to find what I want in the pgfplots manual. In particular, I would like to personalize how the labels for the tick marks are typeset. Finding the correct keywords is ...
7
votes
1answer
138 views

Plotting a level curve

How do I get TikZ to plot the level curve x^{2}y + xy^{2} = 1? \documentclass[10pt]{amsart} \usepackage{tikz} \usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings} ...
6
votes
2answers
137 views

Reduce vertical size of tikz plot

The following code generates a color mapped plot. I would like to reduce the vertical size however, and cannot figure out how. Can anyone give me a hint? \documentclass[a4paper,twocolumn]{article} ...
6
votes
1answer
946 views

Multiple different meta for marker color and marker size

How do I set the color of a marker with one meta column in a table AND its size with another meta column? So in this minimal working example, how can I set the marker size with 'w1' and the color ...
20
votes
2answers
3k views

Fill between two curves in pgfplots.

How to accomplish fill between two curves in pgfplots? For example, I have ... \addplot coordinates {(0,1) (1,1)}; \addplot file {something.dat}; ... and I would like to have filling between those ...
3
votes
0answers
44 views

pgfplot error bar in foreground

I would like to get the error-bar of the lower y-bar ontop of the stacked bar. Which command can I use to get the error bar to the foreground? Thank you in advance. ...
1
vote
1answer
43 views

Specifying different scales for the axes

I am plotting sin(2x) from -pi/4 to pi/4. I have specified that the axes should have the same scale with axis equal image. It doesn't look like a sinusoidal function. How do I get the y-axis to be ...