{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
2k views

Bell curve with multiple x-axes and annotations

I've just started working with pgfplots and I'm getting good results, but I'm having difficulties getting this one done in LaTeX: The curve itself is not a problem, but the multiple x-axes (I don't ...
3
votes
2answers
1k views

How to ensure equal font sizes in all included TikZ/pgfplots figures?

I would like to have many tikzpictures in my document. Since each tikzpicture has its own size, I don't know how to manage the font size among all the pictures. Some of tikzpictures are of size \...
3
votes
1answer
1k views

pgfplots - how to specify ticks?

I know how to specify ticks manually. But this is too much work if you have multiple plots. I am searching a way to do that automatically. What I want to specify is the number of ticks for an axis. Is ...
3
votes
1answer
364 views

setting z-limit on surfplot in PGFplots

I am making a 3D surfplot in pgfplots, and my situation is described by the following MWE: \documentclass{article} \usepackage[ansinew]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath, amsthm, ...
3
votes
2answers
240 views

Adding a x tick but not the corresponding y tick

I'm generating pgf plots on the fly and I would like to avoid adding non integer y ticks on my plots, while keeping all the x ticks. Here is a MWE: \documentclass[10pt]{article} \usepackage{tikz} \...
3
votes
1answer
308 views

Why aren't the titles ordered in the same way data is in groupplots?

I'm trying to display a few plots using pgfplots and groupplots using the following example. I take the titles of each plot from a different data file than the data itself. The data appear to be ...
3
votes
1answer
795 views

coloured fitting pgfplots

I want to fit this data with a straight line and both the straight line that the points have to follow the color of the colorbar horizontal. Another problem is that I can not adapt the grid scale.. ...
3
votes
1answer
6k views

Formatting a pgfplot graph. Thicker bars and total width

I am creating a stacked barchart with the following code. However, I have some problems. How do I set the width, of the whole thing? width= does not do it ... How can I get thicker bars? How can I ...
3
votes
1answer
72 views

How to remove the axis lines

How to remove the axis but the label should be there Eg:current output Expected output I am using the following code \documentclass{standalone} \usepackage{mathtools} \usepackage{pgfplots} \...
3
votes
2answers
67 views

PGFPlots graph is truncated, top is cut off

I'm trying to use pgfplots to plot a Maxwell-Boltzmann curve. After scouring around the internet for the density function, I've come up with this: \begin{tikzpicture} \def\kB{1.3806488e-23}% ...
3
votes
2answers
174 views

matlab2tikz spectrogram is too big

I have produced the following spectrogram in MATLAB and I am trying to import it into a LaTeX document after using matlab2tikz. I am fully aware of the issues with maximum memory etc for typesetting, ...
3
votes
1answer
263 views

How to draw this graph

It is first time for me using latex. I am trying to draw this figure . This is my code \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ ...
3
votes
1answer
147 views

Contour plot error with pgfplot and tikz

I'm trying to plot contour lines of a two variable function. I found this example here: \begin{tikzpicture} \begin{axis}[view={0}{90}] \addplot3[contour gnuplot={ labels over line,number=9}] {...
3
votes
1answer
157 views

Colormap with Tikz

What I have tried so far \documentclass[a4paper]{article} \usepackage{pgfplots} \begin{document} \pagestyle{empty} \begin{tikzpicture} \begin{axis}[view={0}{90}, colormap={custom}{...
3
votes
2answers
220 views

pgfplots log axis with only minor ticks/labels

I'd like generate sheet of blank semilog paper. Every decade shoud have labels from 1 to 9. I only managed to have an unlabelled axis, but had no success to set the x axis labelling according to my ...
3
votes
1answer
133 views

Graphing an arcsin function using pgfplots

I am trying to graph this function using pgfplots: D(x)=180+2x-4(arcsin(sin(x)/1.33)) What is the how to I represent this in the the addplot function in pgfplots? I am also confused as to what to ...
3
votes
2answers
233 views

PGFPlots: point meta colormap index as fill value

I have the following simple PGFPlots sample \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{axis}[ xmin=0, xmax=1, ymin=0, ...
3
votes
1answer
232 views

Why doesn't this example from the pgfplots manual compile?

I copied this example from page 134 of the pgfplots manual (version 1.12.1): \documentclass{article} \usepackage{pgfplots} \pgfplotsset{width=7cm,compat=1.12} \usepgfplotslibrary{patchplots} \begin{...
3
votes
2answers
80 views

Plot “timeout” with pgfplots

I'm plotting some timing results using pgfplots. The times are shown on a log scale. Each of the three techniques eventually ends in a timeout, and I'd like to show that somehow in the graph. I ...
3
votes
1answer
2k views

pgfplot | tikzpicture | changing length + width of ticks

While there are any number of posts on how to fiddle (from the Latin) with tick labels, or tick placements, or tick color, I haven't been able to find anything (in terms of worked examples, or in the ...
3
votes
2answers
255 views

Monte Carlo Method Drawing

I would like to produce a Monte-Carlo-Plot with tikz and pgfplots, similar to this: I've already tried to adapt from this thread: Filling specified area by random dots in TikZ I've tried defining ...
3
votes
1answer
570 views

get caption/subcaption every plot using groupplot pgf tikz

Hello I want to have Under each plot (subgroup plot) its caption or label, so I can also reference it in my document. Here in my example I used (a), (b), (c) I can keep them but they are not well ...
3
votes
2answers
344 views

Vertically stacked group plot with different horizontal scaling

I've 4 data sets that I'd like to present as a stack using pgfplots' groupplot library. What I'm struggling with is that the first data set has a larger horizontal range to the remaining three. I'd ...
3
votes
1answer
302 views

Is it possible to choose the base line of the ycomb?

Is it possible to choose the base line of the ycomb (vertical lines)? For example, in log scale, the default base line is at y=1 (or y=10^0). But I would like to make it at y=0 (i.e. minus infinity). ...
3
votes
1answer
197 views

Nodes Near coords hide when 0

Is it possible to hide nodes near coords in pgfplots when value = 0 ? I have something like this. And axis setting \begin{axis}[ ybar, bar width=3pt, nodes near coords ]
3
votes
1answer
319 views

PGFplots z buffer does not sort the plotted objects properly

I have a PGFplots axis environment in which I attempt to plot several line objects and a surface object. The objects have to be 'sorted' in the sense of which object is drawn before or behind the ...
3
votes
1answer
338 views

use axis of original plot in \spy plot

I use \spy in an plot. This works generally, but I want the axis in my magnification too. I attach a picture to clarify. I do not want to do this with a \node and manually calculate and add the axis ...
3
votes
2answers
324 views

Point Cloud Symbol in a PGFplot legend

I have a point cloud of data in a plot, and a reviewer commented on changing the legend entry for the point cloud from a single dot to a point cloud like or at least a few dots in the legend. However ...
3
votes
2answers
219 views

Adding label to a pgfplot

How can one include a label on the x-axis of a pgfplot. Below is a MWE. What I desire is simply to have the label -0.7 indicated on the x axis. \documentclass{article} \usepackage{tikz} \usepackage{...
3
votes
1answer
307 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 ...
3
votes
2answers
331 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: \begin{...
3
votes
1answer
184 views

How to stop pgfplots scatter to sort the data table?

I want to draw a scatter plot, using pgfplots and I want the data to appear in the plot area the same as it is listed in the table. I don't want the data to be sorted and then be plotted. As it is ...
3
votes
1answer
299 views

How to draw some lines between figures in LaTex

I want to draw the following figure. How do I do this? Some lines between figures, and Can you give me this lines some color? Some color lines in figure, as following:
3
votes
2answers
202 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
1k 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 ...
3
votes
2answers
3k views

TikZ inside pgfplot axis environment

I am trying to use the TkZ command MarkRightAngle in an axis environment, however I cannot get it to work. I get a "Missing character: There is no ; in font nullfont!" error and "Line 21: Package pgf ...
3
votes
1answer
233 views

Padding in cell in Latex Heatmap using pgfplots

I have made a heatmap using pgfplots. But the numbers in the cell are not aligned vertically centered. How can i align them at center or how can i add padding at the bottom for making them appear at ...
3
votes
1answer
293 views

pgfplots: read data, calculate diagram

I'm trying to create a diagram with pgfplots. I have some data, which I'd like to have stored in the diagram code, alternatively (preferably not) in a separate file. What I need to do is to calculate ...
3
votes
3answers
380 views

Wrong placement (and/or size) of picture / plot with groupplot of table (… and discontinuity)?

Consider this MWE: \documentclass{article} % \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.5.1} \usetikzlibrary{pgfplots.groupplots} \usepackage{pgfplotstable} \pagecolor{...
3
votes
3answers
503 views

Highlight a coordinate in a tikz / gnuplot graph

I want to place a coordinate on my tikz/gnuplot graph. How to do this? Preferrably I want the graph to overlap the little red dot, and I'd like the dot slightly larger. \documentclass{article} \...
3
votes
1answer
912 views

font size scaling and node placement issues using pgfplots and tikzscale

From the tikzscale documentation I understand, that it is supposed to keep font sizes constant. However, this does not seem to apply to axis ticks or axis labels from pgfplots' axis environment. Also, ...
3
votes
3answers
122 views

Different xlabels for same x values on different plots

I have two tables that hold different values for the same x values. To compare them, I want to plot both of them in the same plot but with different xlabels. The tables should remain the same, i.e. I ...
3
votes
2answers
786 views

Log scale with integer numbers on y-axes

I'm writing a report and one of the requirement of my Bode-plots is that they are logarithmic, but I need integer numbers (i.e. 10, 20 and 30) on the y-axes. I tried using ytick={} but these numbers ...
3
votes
2answers
269 views

y label is stuck on the right side of the graph

I try to get y label on the right side of the figure, but the label is still stuck on the left side. Below is an example borrowed from another user here. It must be something very simple, but just I ...
3
votes
1answer
2k views

Latex fonts causing “Undefined control sequence” error in pgfplot

I am trying to modify the font size of some text labels in a pgfplot graph I'm playing around with, but it seems pgfplot doesn't understand certain font sizes such as \normal etc. Yet the pgfplot ...
3
votes
1answer
97 views

Label placement in pgfplots

I want to have the label arrows look that I get when using axis lines=center but I also want my x and y label to be on the outside of the plot and not inside the actual plot area. I have been looking ...
3
votes
2answers
340 views

How to expand a plot in a matrix over 2 or more matrix elements?

I use a matrix to arrange and align plots in a groupplot (as discussed here) and I want to create a groupplot with one subplot which have the size of for example two subplots as shown below. I ...
3
votes
2answers
235 views

Error when using surf in pgfplots

I try to make a contour plot with pgfplots similar to the pyplot.contourf but I'm getting errors: \documentclass[tikz]{standalone} \usepackage{pgfplots} \usepackage{pgfplotstable} \usepackage{...
3
votes
1answer
249 views

Pgfplots - Labeling Regions

I'm trying to draw chart which indicates different regions of stability/instability in all the areas demarcated by the different curves. How can I manually put in Roman numerals or letters on ...
3
votes
1answer
173 views

How to use the same linestyle for different isolines in pgfplots

I need assistance on how I can use the same linestyle in ternary diagrams where there is no need for using different colors, linestyles and legends.An example is given in the following programme which ...