{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
44 views

Ticks stop early in PGFPlot

So I was trying to produce this with PGFPlot and got pretty close with the code below but (apart from the major/minor ticks not being as different in their lengths as in the example) I have one ...
1
vote
0answers
16 views

how to control the marks in \addplot

I want to draw some functions and I want to mark the points that I want, example every 1 or every 0.1 and the horizontal axes. \documentclass[a4paper]{article} \usepackage{tikz,tkz-base, pgf, ...
1
vote
0answers
21 views

How to change the font family for tick labels in pgfplots + beamer + professionalfonts?

I am making a beamer presentation with some pgfplots figures and I want to change the font family to sans serif for all tick labels. The problem is that it doesn't work for the y-axis as you can see ...
6
votes
1answer
44 views

Custom area legend image not working

I'm trying to use the result from a fill between as a legend entry, but I can't get it to work: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} ...
3
votes
2answers
120 views

How to create this coordinate system?

I'm currently working on a term paper / lecture notes for my electrical engineering professor and wanted to include the following coordinate system / graph / figure in my paper. (The image should be ...
3
votes
1answer
31 views

How to show the mean or average value on a box plot with pgfplots

I have made the following graph: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \usepgfplotslibrary{statistics} \begin{document} \begin{tikzpicture} \begin{axis} ...
5
votes
2answers
70 views

Rectangular graphs in pgfplots

Whenever I draw a plot using pgfplots, the result is always a square grid. That's generally fine, but in the interest of saving space, something I'd like to be able to make a rectangular plot. ...
6
votes
1answer
1k views

Filling the bars in stacked bar plots with hash or dot points

I was looking for a way to fill the bars in bar plots or stacked bar plots with hashes or dots (something like the following figure). Since it took me a long time to figure it out how to do it, I ...
1
vote
0answers
28 views

example: pgfplots groupplot with two x-axes

I want to share my result, having two different x axes in groupplot. One axis is the energy, the other is the corresponding wavelength. Up to now, this is my working solution, but maybe someone can ...
1
vote
1answer
41 views

Pgfplots: set plot margins

Is there a possibility in pgfplots to set the margins reserved for the x- and y-label, similarly to gnuplots tmargin, bmargin, lmargin, rmargin. I would like to have following values for the ...
2
votes
0answers
40 views

Help with Help Lines

I am plotting lattice paths to two points. I would like to have help lines drawn on top of the Cartesian plane so that any line that is an integral distance from an axis is a solid line and any line ...
2
votes
1answer
29 views

Pgfplots: Add curly rotated braces to a graph

I created a simple graph of a demand function so far. Is there an easy way of addition curly rotated braces and labels to the graph (like in my sketch). Those should mark the intervals for a value ...
1
vote
1answer
138 views

Pgfplot display only x axis, one value point with label and text

I want to plot a chart with one axis and draw a point at a specific value and show it with a label. In addition I'd like to place two label on the min and max tick of x axis. For q better ...
0
votes
1answer
33 views

Align axes across subfigures

How can I align the y axes of subsequent subfigures horizontally? Like in this test case: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \usepackage{subcaption} \begin{document} ...
2
votes
1answer
38 views

Change arrow type in custom style in pgfplots

I tried to define a custom style for my plots in pgfplots \documentclass[a4paper,12pt]{article} \usepackage{fontspec} \usepackage{tikz} ...
11
votes
1answer
1k views

How do I zoom a rectangle area in pgfplots adding a gray background even for the axis labels?

The background to this question is: I want to "zoom" into a certain area of a function and show it a little bigger. Furthermore, I want to put a gray rectangle as a background of the zoomed area, ...
2
votes
1answer
56 views

Forcing a common z-scale in a surface groupplot

I've come across some similar questions, but not this exact one. And nothing I've tried has been able to achieve precisely what I'm looking for. I have a groupplot that contains two overhead views ...
1
vote
1answer
29 views

`every loglogaxis/.append style` not working in PGFplots

I'm trying to apply to scientific notation as constructed in Number format of ticks in log log axis won't change to scientific notation `a x 10^b`, 'a' real, 'b' integer to all ...
1
vote
2answers
52 views

Number format of ticks in log log axis won't change to scientific notation `a x 10^b`, 'a' real, 'b' integer

I'm trying to set the number format of the ticks in a loglogaxis to the scientific notation a x 10^b ($a \cdot 10^{b}$ in LaTeX, a a real number and b an integer), but it's not working. I use the ...
6
votes
1answer
80 views

PGFplots axis label style not working when `axis lines=center` in axis environment options

When compiling the code \documentclass{standalone} \usepackage{pgfplots}\pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{axis} [ x label ...
1
vote
1answer
17 views

Inline calculation gives `Could not parse input` error in PGFplots

The inline calculation exp(\tick) in PGFplots gives me a Could not parse input error when compiling the code \documentclass[margin=1cm]{standalone} \usepackage{pgfplots} \begin{document} ...
1
vote
0answers
18 views

How to label areas in pgfplots fillbetween library

Is there any simple way put a label say $A$ roughly at the "center" of an area created by the pgfplots fillbetween library?
2
votes
0answers
31 views

Weird plot from discontinuous data

Tex gurus; I'm trying to plot some data against time, for which I have some missing values. Most of the time, this works well, but for one plot in particular I am getting some very strange results. ...
0
votes
0answers
21 views

Number format as optional key value argument for LaTeX function

I followed the answer as given in http://tex.stackexchange.com/a/34318/28093 in constructing a function which uses key values. It works fine, but I also want to be able to give the number format as ...
1
vote
1answer
29 views

pgfplots with list and make fails on windows (mingw)

System specs: MiKTeX 2.9, Windows 8.1, -shell-escape added, MinGW installed. MWE: \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{lmodern} ...
6
votes
3answers
927 views

How can I draw pulse-like decorations?

I have an old image with ppt style and I would like to customise it a bit. Main problem is I'm a beginner in Tikz/PGF and i really don't know where to start and which environments I should use. If ...
1
vote
1answer
42 views

“fill between” from pgfplots is placed behind other objects

The following is a (more or less) minimal example illustrating my problem: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} ...
1
vote
1answer
33 views

put a plot inside a table

i want to :) well as you can see \documentclass[french,12pt,oneside,openright]{memoir} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[a4paper]{geometry} ...
2
votes
1answer
47 views

Different anchors for tick marks

To avoid interfering with the graph, I would like to position -2 with xticklabel style={anchor=north east}, and 2 with xticklabel style={anchor=north west}, within the axis environment. With this ...
0
votes
0answers
26 views

Normalize Y-axis by y=(y-min(Y))/(max(Y)-min(Y))

I am new to pgfplots and would like to get your help on my question. Basically I need to read y value from a file that only contains a list of data (in one column), normalize each value by ...
0
votes
1answer
18 views

Annotate / plot triangle with slope in PGFplots log log axis environment

As a follow up question on the question posted at Annotate / plot triangle with slope in PGFplots axis environment, how do I do this in a loglogaxis? So, given a relative position in the loglogaxis ...
0
votes
2answers
66 views

Annotate / plot triangle with slope in PGFplots axis environment

In journal papers, I often see annotations in figures depicting triangles with certain slopes to emphasize which slopes the different graphs in the figure (approximately) have. For example Is ...
2
votes
1answer
35 views

'Dimension too large' in `loglogaxis` plot

I constructed a macro to annotate slopes of graphs by means of triangles in a loglogaxis. It works fine for small slopes, but for large slopes I get a Dimension too large error. Minimum working ...
2
votes
1answer
69 views

Am I properly inserting legends in groupplots? Labels “multiply defined”

I have a few places in my document where I use groupplot to insert several figures, but I only want one legend as it's common to them all. I've done this using legend to name=foo and then, after the ...
2
votes
2answers
54 views

Compilation problem with pgfplots

The following code does not produce the figure expected. \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \usepackage{amssymb,amsmath} ...
1
vote
0answers
21 views

Plot data points with 'linespoints' but lines should have gaps [duplicate]

I have asked following question on stackexchange regarding a gnuplot solution: Plot data points with connecting lines but which leave gaps. The question is about using following linestyle for data ...
3
votes
3answers
53 views

Wrong axis limits when using `\pgfplotsextra` in `loglog` axis environment?

This is a follow up question on Key names of the axis limits when not set explicitly. The solution as given there works great for regular PGFplots axis environment, but not for a loglog axis ...
1
vote
0answers
20 views

Interplay of description placement and units

The following minimal example of a group plot with units shows a problem (note the spurious [m] and [s] towards the center of the figure): It seems to me that descriptions at moves the regular text of ...
2
votes
1answer
27 views

arcsin x function in pgfplots with normal axis

This is my code for asin x (picture on the left): \begin{tikzpicture} \begin{axis}[domain = -1:1, samples = 500] \addplot[color = red] {asin(x)/180*pi}; \end{axis} \end{tikzpicture} ...
3
votes
1answer
35 views

PGFplot multiple histograms using CSV file

I have tried to draw a comparative graph using histogram and taking data from different CSV source files. I can draw the two histograms but the resulting graph is not what I want: I don't want the two ...
3
votes
1answer
40 views

Interaction between “scope + shift” and “fill between” from pgfplots

I am trying to draw a picture using tikZ and pgfplots. The following is a minimized example of what I am doing. \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} ...
2
votes
0answers
29 views

Why does pgfplots scale dimensions differently in a polar plot

I am using pgfplots to draw two images with polar coordinates. Even though I specify the same value that represents the 100% value (radius of a 100 for both red circles, they are the last plots in ...
2
votes
1answer
71 views

How to draw a graph from CSV with TeX?

I am a complete beginner with TeX, I would like to draw JMH benchmark graph using TeX. Since I have output results in CSV format. This is my actual code: \documentclass{article} \usepackage{pgfplots} ...
2
votes
1answer
82 views

Pgfplots: Placing legends individually to the end of lines

I have a few days of experience with LaTeX. It seems almost everything is possible if you just find out how. So, here is a challenge... If a plot has many lines it is much more readable to have ...
2
votes
1answer
157 views

I am trying to draw a clustering Euclidean diagram

I am a biochemistry graduate student, and I have classified breast tumours using a Euclidean centroid-based approach with 437 up-regulated and 370 down-regulated genes (dimension = 807). I would like ...
2
votes
1answer
50 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 ...
1
vote
1answer
22 views

Fail to produce valid PDF from pgfplots sample code

I use the following the pgfplots sample code: \documentclass[varwidth=true, border=2pt]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ ...
2
votes
2answers
37 views

PGF-Plot not at centre

I would like to plot some circles with pgfplots inside a diagram, however, they are always off-centered. \pgfplotsset{width=7cm, compat=1.12} \pgfplotsset{compat=1.5.1} \begin{tikzpicture} ...
5
votes
1answer
53 views

Key names of the axis limits when not set explicitly

In the minimum working example below I use the keys xmin, xmax, ymin and ymax for calculations of coordinates for annotations. However, this only works when the axis limits are set explicitly in the ...
2
votes
1answer
39 views

Why am I getting those pgfkeys errors?

Suddenly, most of the figures don't appear in the document and the first error is ! package pgfkeys error: choice '1.8' unknown in key '/pgfplots/compat/anchors' Another error: ! package pgfkeys ...