{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

0
votes
1answer
40 views

General understanding \addplot3 pgfplots

If I type into wolframalpha.com "3dplot (x+sin(x))^2" I get . When I use pgfplots and do this: \addplot3[ surf, opacity=0.8, samples=50, samples y=30, colormap/whitered, domain=-1:1,y domain=-1:1, z ...
2
votes
2answers
51 views

Change legend color in multiple y-axis plot in pgfplots

I have a plot in pgfplots with two y axis, and two curves for each axis. For each y-axis, the first curve correspond to a given method, and the second one to another method. Hence, the two curves ...
9
votes
2answers
934 views

Pgfplots - ugly marks when using dotted or dashed line [duplicate]

Recently I spotted that applying the option dashed or dotted to a plot results in having ugly / distorted marks or marks with dots (when applying dotted) around them. Here is a MWE: ...
9
votes
1answer
8k views

Different marker shape for pgf/TikZ

I have a figure in my paper which compared 6 different cases. The figure needs to be in black and white. In below is the code I used to create the figure. \documentclass{standalone} ...
2
votes
1answer
171 views

Tikz for generating pdfs and using in latex, compiling problems

I tried using the advices online for implementing tikz into the texmaker and Miktex combiantion. The Miktex is updated and the texmaker runs normally. The tikz version from a flow example runs ...
0
votes
1answer
31 views

legend over the plots

I don't want to have the legend over the plot as shown in Figure. I want it inside the figure box but not over the plot. Also, the number format of y-axis, i want to have it 0.001, 0.002, etc. The ...
1
vote
2answers
49 views

Applying log on a column read from file

I'm trying to plot some data from a file and I want to apply the natural log on the values from one column. MWE: \documentclass[a4paper,12pt]{standalone} \usepackage{pgfplots} ...
3
votes
0answers
51 views

Uniformly spaced line markers

I'm reading line data from file and plotting it. By default, the curve has markers, where are the original data points. The data points are very uneven, but I would like to have evenly distributed ...
3
votes
2answers
79 views

Changing the arrow heads in pgfplots axis lines

Consider the following: \documentclass{article} \usepackage{tikz,pgfplots} \usetikzlibrary{arrows.meta} \tikzset{>={Latex[round]}} \begin{document} \begin{tikzpicture} \begin{axis}[inner ...
0
votes
0answers
48 views

Resize tikzpicture without change \node position

I'm using tikzpicture to create some graphs. But I have a problem, when I change graph size for better position on text, all \node goes to wrong position. Here is my code. This are my .dat. ...
0
votes
1answer
38 views

Caption/Space problem in tikz/pgf/subcaptionbox

I plot 4 Graphs with Tikz and use subcaptionbox. Following badnesses occur: (1) There is no space between the caption of the upper figure to the figure below. (2) The second figures (b) caption ...
0
votes
1answer
100 views

Varying Error Bar Length In Timeplot Graph

I have a quick question about the Error Bars functionality in LaTeX, specifically - I am using pgfplots and tikzpicture packages. I was wondering if it is possible to vary the length of the Error bar ...
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
37 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
79 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
67 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
62 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
66 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
66 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
58 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
1answer
74 views

How to change x-axis label position only horizontally keeping the default vertical value using pgfplots

I have two plots of different width next to each other. I want them to share one x-axis label. For this I take the x-axis label of the left plot and shift it to the right so that it is perfectly ...
1
vote
0answers
71 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
119 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
68 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
49 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
415 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
40 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
75 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
151 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 ...
2
votes
1answer
73 views

Drawing lines half the thickness of the default thickness

In the following code, two triangles are drawn - one is the reflection of the other across the line y=x. I would like to have a line, with the command \draw[loosely dash dot], drawn either half or a ...
3
votes
1answer
97 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
42 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
67 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
42 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
75 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
80 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
66 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
38 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
119 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
27 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
31 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
40 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
68 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
67 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
44 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
47 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
48 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
71 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
29 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 ...