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

Problematic rendering of mark=+ in pgfplots

Consider the following MWE: \documentclass{article} \usepackage{pgfplots} \usepackage{tikz} \pgfplotsset{compat=1.5.1} \xdef\doPlotCoords{} \foreach \r in {0,1,...,10}{% \xdef\tempCoords{} % ...
2
votes
1answer
41 views

aligning plots in pgf plots and a couple other associated questions

I am fumbling my way through pgfplots. I have 3 plots on a page. I have a few issues: The bars in the plots are floating above the axes to various degrees. How do I anchor the bars down to the axis? ...
6
votes
1answer
92 views

Enlarge distance between bars

I want to create a bar chart. The bins are extremely close to each other, how can I increase the distance between the bars to let the labels on top of it stand a bit free and don't overlap anymore. ...
5
votes
1answer
88 views

TikZ + PGF function Plotting: Is there a max(a,b) function?

I am trying to plot a function with TikZ and PGF. This function contains a max operator (returning the greater value of the given two parameters). I want to do the following: \documentclass[ ...
6
votes
1answer
84 views

Restrict x domain to several regions

I want to plot a graph and show only the low x-positions and the high x-positions. Right now I use two times \addplot with restrict x domain to achieve this: \documentclass{standalone} ...
4
votes
1answer
77 views

To fill legend mark in graph

How to fill mark, such as zebra: same in my uplod picture which draw. Thanks \documentclass[border=5mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepackage{etoolbox} ...
3
votes
1answer
82 views

Parallel correlation of two Y axis

Can you help to parallel correlation of two Y axis-that mean I want my third Y axis 0 number begin parallel to second axis number 3. Yes, I know may be I explan in bad english, because I draw picture ...
2
votes
0answers
61 views

Grouping bins in bar charts?

I have below bar-chart. I want to group the bars together by color. It makes no sense to compare the bins directly, but only the values with the same color directly. Is there a way to create two ...
6
votes
3answers
1k views

How to draw legend lines in caption/text without including original plot's TikZ picture?

I would like to reference some plot lines in text/captions. It is possible by defining a label for the plot in the corresponding axis environment. However, I'm using externalization and only want to ...
1
vote
0answers
87 views

standard deviation in latex graph

How can draw standard deviation in latex graph(excel command stdev) \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepackage{caption} % <---- \captionsetup{font ...
3
votes
2answers
149 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 ...
1
vote
1answer
71 views

Compile timeout [closed]

When I use my code, always say that-compile timeout-www.overleaf.com/ I am check two times my code and dont finde any mistake \documentclass{article} \usepackage{pgfplots} ...
0
votes
2answers
73 views

Y-tick labels on the right side, y-axis label on the left

Is there a way to only move the y-tick labels to the right? The option yticklabel pos=right automatically moves the axis-label, too. Here a MWE of how the axis-label is also moved: ...
11
votes
1answer
535 views

How to plot the first n rows of a table using pgfplots?

When using pgfplots, is there a way to plot only the first n rows of a given table ? Considering the following MWE file: \documentclass[tikz]{standalone} \usepackage{tikz} \usepackage{pgfplots} ...
1
vote
1answer
43 views

Putting space about labels for vertices and shifting these labels

A line is drawn through a side of two triangles. One of these lines are drawn on top of the labels B' and C' for vertices of one triangle. I used the option inner sep=2pt to put some space about ...
2
votes
1answer
89 views

pgfplots significant figures

I'm trying to work out how to change the number of sig figs in the axis labels. I.e., I want the graph to display 0.0, 1.0, etc. Any ideas? \documentclass{memoir} \usepackage{pgfplots} ...
0
votes
1answer
155 views

Group labels in pgfplots or finding cm fonts for windows

I'd like to put a second xlabel on a grouped bar graph using TiKz but can't seem to work it out. So I have found this cm superfonts package: http://ctan.org/pkg/cm-super. Or I can download cm fonts ...
3
votes
1answer
109 views

How to plot sinusoidal and absolute functions?

I have to draw this diagram with plots of these three functions: The code I already have is \begin{tikzpicture}[scale=0.75] \begin{axis}[xlabel=$t$,ylabel=$x(t)y(t)z(t)$,xmin=0, ...
0
votes
0answers
48 views

A line not plotted

Here, I am trying to get TikZ to plot the line y=x. I get an error. \documentclass[10pt]{amsart} \usepackage{tikz} \usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings} ...
3
votes
1answer
79 views

use absolute coordinate axis in pgfplot automatically

I want pgfplot add a grid with absolute coordinate automatically, for example, below image original pdf is 1.17x1.19in, so I want x is (0,1.17in) and y is (0,1.19in). Now I hardcode it to Nx/Ny, can ...
0
votes
1answer
48 views

A line is not plotted

I have a plot of a triangle and its reflection across the line y=x. The code is not compiled because there is an error in the command to plot the line y=x. Here is the command. ...
3
votes
1answer
90 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
86 views

Strange behaviour of arcs with pgfplots v1.11

This only happened after I updated to latest pgfplots version v 1.11 and used to be compiled with a fine looking result. \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} ...
4
votes
2answers
79 views

Problem with tikz : alignment of figure when using bracket in xlabel

When I put bracket in a xlabel, the alignement of my figure change. It's just a little move, but it's uggly because i put two sub figures side by side. Do you know how to solve this ? Thanks in ...
2
votes
1answer
44 views

Missing folder paths in tikz picture when loaded with tikzscale/standalone

I have a standalone mytikz.tikz picture which loads test.png. Both reside in the folder pics/. My main.tex, which uses tikzscale to load mytikz.tikz, is in the parent folder. Loading the test.png ...
6
votes
2answers
138 views

How to place y ticks' labels inside the bars?

I have been trying to find how to I place the y ticks Normal and Special inside the bars rather than to the left of the bars. Below is the code of the most recent attempt: \begin{tikzpicture} ...
1
vote
1answer
38 views

How to customize only one node near coord?

\documentclass[border=2pt]{standalone} \usepackage{pgfplots,tikz} \pgfplotsset{compat=1.11} \begin{document} \begin{tikzpicture} \begin{axis}[ symbolic x coords={Germany,Spain,UK}, ...
4
votes
1answer
32 views

How to customize only one coord?

\documentclass{standalone} \usepackage{pgfplots,tikz} \pgfplotsset{compat=1.11} \begin{document} \begin{tikzpicture} \begin{axis}[ symbolic x coords={Germany,Spain,UK}, ...
0
votes
0answers
58 views

TikZ Externalization Cannot Find Output File

I tried to use TikZ's externalization feature to speed up my compiling time, but for some reason it did not work as expected. This problem seems to be quite common and I've spent some time looking ...
3
votes
1answer
71 views

What's wrong with my plot?

I have this code: \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ symbolic x coords={Germany,Spain,UK}, xtick=data, axis x ...
0
votes
1answer
80 views

Caption of Figure and legend under the figure

I want to give under the graph legends and \caption{Growth of different types foodborne pathogens.}. Delete line papralel x axis \documentclass{article} \usepackage{pgfplots} ...
0
votes
0answers
50 views

Perpendicular line to a line on a 3D plane

\documentclass{standalone} \usepackage{pgfplots} \usetikzlibrary{calc} \pgfplotsset{compat=1.10} \begin{document} \begin{tikzpicture} \begin{axis}[ view={125}{35}, axis lines=center, ...
1
vote
1answer
56 views

Clearly edit name of legend and Y axis 2

I want my legend only show that, mark with filling black-BHI growth, mark with filling white-BHI ph change. Also, name of Y axis 2 must be right, but in concretely my graph name of Y axis 2 with Y ...
1
vote
1answer
64 views

undefined references using \usepgfplotslibrary{external}

I use MikTex 2.9 on a Windows 7 64-bit machine. I do not have and will not have Admin rights on this machine. I have a lot of tikzpictures and curves in my article so I use tikz with ...
2
votes
1answer
82 views

A triangle not being plotted

I have the code for a triangle on the Cartesian plane. There seems to be two commands that TikZ is not able to compile. The first line is \addplot[samples=501,dashed,domain=1:3] {3,x}; which should ...
0
votes
1answer
32 views

How to extract coordinate values from intersections in one \begin{axis} environment to use in a second \begin{axis}.. environment in pgfplots

I would like to plot two graphs, side by side, in two separate \begin{axis}...\end{axis} environments using pgfplots. In one graph I want to plot the n curves y1=x^2, y2=2x^2,..., yn=nx^2. I then want ...
5
votes
2answers
101 views

font size with tikzset and tikzscale not working

I want to set the font family and size for all pgf/tikz figures in my preamble. But when I use tikzscale, then this is ignored. Can anyone help? \documentclass[a4paper,12pt]{scrbook} ...
1
vote
1answer
175 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 ...
2
votes
1answer
51 views

“skip coords” and “xticklabels from file” cause wrong labels

When filtering data from a file (with skip coords between index for example) and loading the x tick labels from the same file, the x tick labels are not skipped, leading to wrong labels. As an ...
2
votes
1answer
63 views

Node below axis annotation in tikzpicture/pgfplots

I want below the axis annotation a node (with some text) and from this node a arrow should point to a specific point on the x-axis MWE \documentclass[paper=a4, fontsize=12pt]{scrreprt} ...
1
vote
0answers
36 views

How to pass a function defined in sagetex to pgfplots

Is there any way to pass a function defined in sagtex to pgfplots for plotting? See the following example. \documentclass{article} \usepackage{pgfplots} \usepackage{sagetex} \begin{document} ...
5
votes
1answer
135 views

Coordinates of intersection

The code generates a strain - stress curve. How can the code be simplified? How can the code be make smarter? Can I make the bezier curve with one draw command? \ShowintersectionB prints just the ...
2
votes
0answers
59 views

Obtaining a particular 3d view in pgfplots

I am trying to achieve the following plot, with the indicated perspective and the axis lines centered: I've played around with several view options and I'm just not able to reproduce the figure. Any ...
20
votes
1answer
2k views

Pre-defined color cycles à la RColorBrewer?

When I have multiple line plots in pgfplots, the colors of the lines cycle through a few colors (my guess is the colors are blue, red, black and dark khaki) before repeating with different marks. See ...
6
votes
2answers
170 views

How to make latex parse `x` as an argument of a macro definition instead of `#1`

When I define a mathematical function for plotting in pgfplots or pstricks I usually to it in the following way: \def\f(#1){(#1)^3 + 3*exp(#1)} just as suggested by Jake in his answer to a ...
8
votes
1answer
165 views

Describe intersections on X axis

I have two functions which intersect at three different points: \documentclass{article} \usepackage{tikz} \usepackage{tkz-euclide} \usetikzlibrary{intersections} \usepackage{pgfplots} ...
1
vote
1answer
97 views

Specify arc radius in coordinate systems units

This is a follow up on Specify radius of an arc with pgfplots and axis direction cs? If I'd like to change the MWE from there to the following: \pgfplotsset{compat=1.10} \begin{tikzpicture} ...
8
votes
3answers
259 views

pgf plot and foreach loop

I have this function y=a*x^2 where a changes (-2.4,-2.1,-1.8,....,2.1,2.4) and i want to draw it with pgf plots. Problem is i dont know how to implement this i think i'll need foreach loop or ...
2
votes
1answer
41 views

PGFPlot equally spaced coordinates

how can i make the plot that the provided x-coordinates are separated visually with the same distance. So instead of 0 500 1000 1500 2000 there should be 0 10 20 50 100 200 ... and the second thing ...
3
votes
0answers
107 views

TikZ binomial distribution plus Gaussian approximation

My intention is to draw the probability function of a binomial distribution with trials = 20 and probability = 0,4. Then i wanna add the curve of an approximate gaussian curve in the same plot. How ...