{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

7
votes
1answer
257 views

How to scale a pgfplot in a tikzpicture correctly?

I created a figure in pgfplots and added some extra labels in a tikzfigure environment. Now it turns out I need to rescale the whole figure. Normally this can be done by adding scale=2 but here the ...
11
votes
1answer
523 views

Brownian motion with drift

I have a code for the Brownian motion and it indicates three paths which initially started at point 0. My goal is to increase the initial starting point from 0.0 to e.g. 0.6. This is achieved by ...
6
votes
1answer
90 views

Generating an xtick for maximum value

I want to find the maximum value of a plot given by a function like in How can I automatically mark local extrema with pgfplots and scatter?. Is there any way of writing the x-value on the x-acis ...
7
votes
1answer
332 views

Plotting Population Regression Function with pgfplot

I want the make the following population regression function with pgfplot. My attempted code is \documentclass[border=5mm]{standalone} \usepackage{pgfplots} \begin{document} ...
10
votes
1answer
297 views

Compiling a tikzpicture including \ref

I've been reading and gathering material from multiple sources online about what steps are required to externalize a document that contains TikZ pictures which store a reference to their legends using ...
3
votes
1answer
513 views

Modify the legend-style in pgfplots

I have a question concerning pgfplots. I made a minimal example which is related to the example in the pgfplots manual (page 182): \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} ...
8
votes
1answer
265 views

legend placement with bounding box restrictions and externalization in pgfplots

I find it useful to add \pgfplotsset{/tikz/every picture/.append style={trim axis left,trim axis right}} to my preamble for bounding box restrictions. But then when I use the legend to name feature ...
8
votes
1answer
198 views

pgfplots: problem in the legend using custom marks

With the help of \pgfdeclareplotmark I defined a custom mark for a plot and it worked as expected; however, in the legend, the mark appears with a vertical shift. What is causing this problem and how ...
6
votes
1answer
265 views

Draw reduced graph with pgfplot

I want to reduce the information contained in a graph to the minimum. I started with a spectrum that I drew from a data file ( http://www.sendspace.com/file/wwydju ). \documentclass{standalone} ...
5
votes
1answer
235 views

Draw ticks over external plot using pgfplots

I plotted a contour/surface plot with gnuplot using set pm3d map and want to include this picture via \addplot graphics {...};. When I match the plot area of the axis environment with the plot range ...
9
votes
1answer
1k views

How to remove ticks from the top and right axes of a plot generated with PGFPlots?

I want to remove ticks from the top and right axes of the bounding box of a plot generated with pgfplots. Any help appreciated. Here is sample code which generates unwanted ticks. ...
4
votes
0answers
638 views

Tikzscale, trim axis left/right, and externalizing

tikzscale and trim axis do not play well together, with the produced figure being larger than requested because it ignores the size of the labels. I was wondering whether it is possible to use both ...
11
votes
0answers
479 views

XeLaTeX and TikZ - how do I ensure my PDFs are using the CMYK color model?

The place I want to print my document at needs the PDF to be provided in CMYK. The document is mostly text, except for a few graphs and plots which are done in TikZ or pgfplots. As suggested in this ...
9
votes
1answer
342 views

pgfplots: Tilted and Rotated sphere

I can make sphere with pgfplots through the following code. \documentclass[tikz]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \begin{document} \begin{tikzpicture} \begin{axis}[% ...
7
votes
2answers
970 views

Draw sphere pgfplots with axis at center

I want to draw a plot that illustrates the ration pattern of an isotropic antenna. I thought about pgfplots to do the job. I grabbed the code from pgfplots manual and did some changes; but it doesn't ...
1
vote
0answers
142 views

pgfplot Boxplot How to change the thickness of median [closed]

Is there a way to change the thickness of median line in box plot. I am using the code given in Pgfplot : change the distance between 2 adjacent boxes in box plot
4
votes
1answer
834 views

Declare function for tikzpicture

I'd like to declare a function that will be part of the equation that I then want to plot. The equation that I want to plot is defined as \frac{e^{-rT}N'(d_{2})}{S\sigma\sqrt{T}} The function to ...
4
votes
1answer
392 views

pgfplotstable manage strings and values

I like the pgfplotstable package for reading and plotting tables but handling of strings and values (especially when strings contain spaces) drives me crazy... I often use a table as shown here: ...
4
votes
1answer
552 views

ylabel style when axis y line=right

When I'm using axis y line=right, it appears ylabel style is not applied, as illustrated by this MWE: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \begin{document} \Large ...
7
votes
1answer
289 views

Pgfplot : change the distance between 2 adjacent boxes in box plot

Hi I want to change the distance between 2 adjacent boxes in boxplot. I am using following code. What should I change in code to get it similar to as desirable diagram \begin{filecontents}{lmpqd.dat} ...
6
votes
1answer
418 views

Connecting subplots

Is there a way to draw a sort of connection between subplots in TiKz/pgfplot, like in this example? I'm looking to achieve something like this: But I would need to draw the "x 2000" line between ...
5
votes
1answer
197 views

Space node values evenly

I'd like to space out the node values on the bars so that they are clearly visible. What do you recommend for the ones that are partially hidden? Can I do this automagically? Also I'd like to use the ...
3
votes
1answer
184 views

Omit overlapping xtick labels

So right now I have something like this: As you can see, the xticks on the second (smaller) plot are a complete mess. Is it possible to just show 3 values (the first, midpoint and last ones)? ...
1
vote
1answer
124 views

Scale only dataset read from file without scaling whole graphics

I have datasets which vary strong in range. So i want to scale my dataset to adjust it to my template, so that the grids, axes and so on are identical with the neighbour-subfigures. What is the ...
5
votes
2answers
492 views

Tikz-pgfplots and matlab2tikz doesn't capture subplots well

I use matlab2tikz to convert this matrlab figure: % This file was created by matlab2tikz v0.3.3. % Copyright (c) 2008--2013, Nico Schlömer <nico.schloemer@gmail.com> % All rights reserved. % ...
5
votes
1answer
485 views

Shading a bell shaped curve in TikZ

I have the following code: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}[scale=1] \def\normalt{\x,{4*1/exp(((\x-3)^2)/2)}} \def\y{2} ...
2
votes
1answer
88 views

Vertical labeled markers

I have a plot with four curves, and I wish to add vertical marker to pinpint the exact moment the curve drops below a certain threshold, much like this: I'd like to be able to control the width of ...
2
votes
0answers
134 views

Magnified plot / Vertical Markers [duplicate]

I've been trying to use the spy library to magnify a part of my plot, but I don't really understand how it works, and I can't find a manual/tutorial anywhere. Right now I am doing something based on ...
5
votes
1answer
552 views

matlab2tikz imagesc TikZ/pgfplots equivalent

I'm using matlab2tikz to export imagesc figures into TikZ/pgfplots code. This process gives me a TikZ file and a rasterized png version of the image with colours matching the colourbar at the time of ...
3
votes
1answer
85 views

How to restore ticklabels

I'm trying to answer to this question. I almost got a solution but I missed one last thing. The code is the following: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} ...
2
votes
2answers
179 views

pgfplots: markers with text above the marked points

first an image of what I would like to have I want to have a free text of the nth marker of each plot. I am symply providing no example, because I am not really sure to solve it and I am maybe ...
2
votes
1answer
156 views

Legends for scaled pgfplots

I am using the pgfplots package to create some plots of data for my thesis. As an example, consider the following code: \documentclass[a4paper]{article} \usepackage{tikz} \usepackage{pgfplots} ...
4
votes
1answer
122 views

Strange behaviour of key /pgfplots/ymax

I have the following code: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepgflibrary{fixedpointarithmetic} \usepackage{fp} \begin{document} ...
3
votes
0answers
107 views

Highlight LaTeX code and presenting results as in a manual [duplicate]

I would like to write a short guidelines of LaTeX for my students. In the spirit of some LaTeX manuals, I'd like to present the code and the result as follows, This example illustrate more or less ...
6
votes
1answer
318 views

How can I access to min and max value of x and y axis in pfgplots?

I want to access to xmin, xmax, ymin and ymax values of an axis in pgfplots. If these values are explicitly defined by user I know that I can use the \pgfkeysvalueof{/pgfplots/xmin} command. But what ...
9
votes
2answers
686 views

How to control pgfplots axis scaling for engineering notation (multiple of 3 exponent)?

The automatic power-of-ten scaling of pgfplots is a great feature that unclutters the numeric ticks in the axis (see image). However since the exponent value (e.g. 10^3, 10^4) is difficult to keep ...
3
votes
1answer
500 views

Importing .mat file to pgfplots

I am using pgfplots to create figures, and I have a (large) set of simulation data generated from Matlab. It is in the .mat format. The data are of the form (two column) (1,0.2) (1,0.3) ... ...
5
votes
1answer
186 views

Style of combs in pgfplots

I am using pgfplots to create comb figures such as the following. \documentclass{article} \usepackage{pgfplots} \usepackage{xcolor} \begin{document} \begin{figure} \centering \begin{tikzpicture} ...
4
votes
0answers
96 views

Axis labels according to DIN461 [closed]

DIN461 requires to put the unit of the axis between the last two ticks of an axis, see http://de.wikipedia.org/wiki/DIN_461 (sorry only in german, but the lower two images make it clear, I think) Is ...
4
votes
0answers
337 views

Creating plots in Latex - easy to learn? [closed]

I am currently working on my summer project for which I created the following plot with Mathematica: Now I am not 100% satisfied with the results and one of my professors recommended PGF and TikZ. ...
9
votes
2answers
3k views

Histogram with Tikz

I am a newbie in TeX. And I need to use Tikz to make a copy of this histogram Of course, I am able to make something similar. Unfortunately, I need a replica (90%) of it. Can anybody help me? ...
3
votes
1answer
138 views

Nested loops and conditionals in pgfplots

I have trouble in using nested loops and conditionals in pgfplots. I'm familiar with the \foreach and \ifthenelse commands, but do not work well with pgfplots. For example, in the following I want to ...
2
votes
1answer
439 views

Plot alignment using groupplot in pgfplots

I am using the groupplots library in pgfplots to create plot groupings. I am using the 2x2 sizing but only have 3 plots. How can I center the furthest right plot vertically, to make a triangle rather ...
1
vote
1answer
166 views

How to use specific x-values of a CSV-file for drawing a x-y-plot? [closed]

I have a question concerning pgfplots. I have a CSV-file with x-y pairs. The CSV-file is very large (>10k entries). I want to plot now x vs y, but only at some specified x-coordinates. In other ...
2
votes
1answer
127 views

Why doesn't standalone accept my build={} package option?

I frequently use standalone to incorporate tikz images in my documents. I have some really large tikz plots which I would like to include in my beamer presentation, but I am getting "Tex capacity ...
3
votes
1answer
114 views

pgfplots memory overload

I want to plot 5x9000+ data points. I am already using: \usepgfplotslibrary{external} \tikzexternalize and -shell-escape -enable-write18 in PDFLatex. However, I still get the memory error. I ...
7
votes
1answer
2k views

individual tick label style with pgfplots

given the following code, I want to modify the tick labels in such a way, that for negative values of x, the labels are located above the x-axis. How can I realize this? \documentclass{report} ...
5
votes
1answer
149 views

Legend position in standalone pgfplot moves when plot is used in document

The following mwe shows that the legend position in a pgfplot changes when the standalone version is scaled in a document that includes it. Standalone: From driver: (I changed the sizes to ...
4
votes
1answer
208 views

Latex Block diagramm / draw Range

I want to use a Block diagram like in this document on page 9: http://texdoc.net/texmf-dist/doc/generic/pst-bar/pst-bar-docDE.pdf But I fail at doing this. At the moment I am using this: Grouped bar ...
11
votes
1answer
202 views

pgfplots: two axis for one dataset e.g. °C and °F

I want to plot ONE dataset in a pgfplots and use TWO axis with different units on each axis. For example I have one dataset with temperature and want to print a °C scale on the left and a °F on the ...