# Tag Info

### Plotting x^(x-1)

The problem is that the domain is too high at 0:15, 15^14 is too high for the graph to calculate. Try this code: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{pgfplots} \usepackage{...

### Plotting x^(x-1)

I use f(x)=x^{x-1}=\exp{(x-1)log(x)} for x>0. The global minimum point is (1,1). Here is an Asymptote code // http://asymptote.ualberta.ca/ unitsize(1.5cm,3.5mm); import graph; real f(real x){...
• 14.2k
1 vote

### Handling with customlegend style

In my opinion, creating custom legends, axis and tick labels should be a last resort when using a high level package such as pgfplots. There are several well documented features in the manual that ...
• 33

### Plotting x^(x-1)

\documentclass{standalone} \usepackage{pgfplots} \usepackage{tikz} \pgfplotsset{compat = newest} \begin{document} \begin{tikzpicture} \begin{axis}[% xmin = 0,% xmax = 15,% ymin = 0,% ...
• 1,659

### Handling with customlegend style

legend style={nodes={text depth=3mm}} does the trick for me: \documentclass[12pt]{article} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.16} \usepgfplotslibrary{fillbetween} \...
• 423
1 vote

### How to reveal stacked ybar one symbolic x coord at a time in beamer

You could cover up the bars on earlier overlays: \documentclass{beamer} \usepackage{pgfplots} \begin{document} \begin{frame} \begin{tikzpicture} \begin{axis}[ ybar ...

### Uncover points of scatterplot

A version not using any library, just adding \pause via scatter/@post marker code: \documentclass{beamer} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{frame} \begin{...
• 673k

### Uncover points of scatterplot

You can use the overlay-beamer-styles library: \documentclass{beamer} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usetikzlibrary{overlay-beamer-styles} \begin{document} \begin{frame} \begin{...
1 vote
Accepted

### How to extend logarithmic pgfplots to values below 1?

You need stack negative=on previous like this \documentclass[tikz, border=1cm]{standalone} \usepackage{pgfplotstable} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \pgfplotstableread{ ...
• 23.3k

### Plotting area under density curve with tikz

With Asymptote // http://asymptote.ualberta.ca/ unitsize(1.5cm,8cm); usepackage("amsmath"); import graph; real xmin=-3, xmax=.32; real mu=0; real sigma=1; real gauss(real x){ return 1/(...
• 14.2k
1 vote

### Replicate sidesubfloat with subcaption-package

I would probably rename the external .tikz files to sub1.tikz to sub6.tikz, since then you can easily loop over these files which would reduce you code. As for the caption inside the subplots, you ...
• 21.5k
1 vote
Accepted

### Arbitrarily change axis properties in pgfplots within a foreach loop

You can use \pgfplotsset inside the axis environment to add certain options to the already existing options. If you set the y ticks only to some plots, the scaling of the plots will be different. ...
• 21.5k
Accepted

### pgfplots legend marker scale

You should use the option mark size which scales only the marker rather than scale. This way, the markers will also scale in the legend. The option mark size takes a dimension that defaults to 2pt. So,...
• 21.5k
Accepted

### Setting pgfplots line opacity based on column name

I hope, I understood you correctly. You can make use of the macro \pgfplotstablegetcolumnnamebyindex. In order to use it, you first need to read the table data into a macro using \pgfplotstableread. ...
• 21.5k
Accepted

### Tikz Grid goes beyond graph

\documentclass[tikz, border=1cm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ xlabel=x, ylabel=y, legend pos=north west, ...
• 23.3k
1 vote
Accepted

### pgfplots with nodes near coords fails for some symbolic coords

If you want to style the tick labels, I would suggest using the option yticklabels to define the labels of the y axis. Also, I would probably just use numeric coordinates to position the data on the y ...
• 21.5k
Accepted

### Drawing Unconnected 3D Arc in PGFPlots

\documentclass[tikz, border=1cm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ axis lines=middle, ticks=none, view={135}{20}, xlabel=$x$...
• 23.3k

### Let a line make an angle with respect to coordinate system

You just need to select the correct starting point for your arc. (For an arc with a radius of 1cm, that's 1cm to the right of its center, i.e. the start of the orange line.) I also uncluttered your ...
• 12.9k
1 vote

1 vote

### 3d barplot with colormap / heatmap

In addition to hpekristiansen great answer, i tried some further steps with his example and i would like to share my solution for producing such a 3d bar plot with colormap from an external file: With ...
• 45
Accepted

### What is the addplot code to draw a simple vertical line of height 0.6 at x=1

pgfplots has a plot type specifically for drawing vertical lines extending out from the x-axis: ycomb. There is a corresponding xcomb for horizontal lines. \documentclass[border=10pt]{standalone} \...
• 199k

### pgfplots fails to graph the function [sin(x)]^100

Source of your problem is use smooth (spline function) on too small number of sampled. So, if you: increase number od samples, for example to 401, remove smooth instruction, \documentclass[margin=...
• 257k
1 vote

### pgfplots fails to graph the function [sin(x)]^100

Try adding samples=100 to your code for sin(x)^100, it should fix the problem. This is the new code: begin{tikzpicture} \begin{axis}[xscale=1.5,axis x line=bottom,axis y line=left, axis x ...

### What is the addplot code to draw a simple vertical line of height 0.6 at x=1

Thanks to the deletion of my previous answer along with your original question, I am now able to digest and rephrase what I originally wrote: Using domain=1 will lead to a syntax error. You need to ...
• 21.5k
1 vote

### pgfplots won't plot simple trig function

Resolved using the following code: \begin{tikzpicture} \begin{axis}[xmin=0, xmax=2, ymin=0, ymax=6000, xlabel=$h\ \mathrm{(m)}$, ylabel=$d\ \mathrm{(m)}$,] \addplot[domain=0:2, smooth] gnuplot[samples=...
Accepted

### Is it a limited numerical precision of Tikz or I don't understand the transformation?

Let's break it down: PGFmath assumee the parameters to sin, cos, etc. to be in degrees, not radians, so we need to convert those either with the deg function or the r postfix operator: sin(deg(x) or ...
• 87.3k
Accepted

### Place arrow in pgfplots

You can just use the axis coordinate system to draw inside the plot. Inside the axis environment, the units for coordinates are different, so that (1,1) is bound to the units of the axes and does not ...
• 21.5k
Accepted

### 3d barplot with colormap / heatmap

• 23.3k
1 vote
Accepted

### Undesired line between "fill between" regions

Welcome to TeX.SX! This is probably just a rendering error. You can try to use the fadings library and use fill=red!20, path fading=east and fill=green!20, path fading=east for the fadings: \...
• 21.5k
1 vote
Accepted

### Can I customize the legend of my plot?

Can you add options to the \addplot macros? If yes, you can add area legend: \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ legend entries={...
• 21.5k
1 vote

### Rounded corners do not transform well in Tikz under a nonlinear transformation

The option rounded corners is quite stubborn sometimes: it has several pitfalls. For instance it does not work well with scale, see pgfmanual.pdf, Section 14.5 Rounding Corners. To avoid using this ...
• 14.2k
Accepted

### Rounded corners do not transform well in Tikz under a nonlinear transformation

The rounded cornerscommand does not seem to work in this case (see here about it Nonlinear transformation applied on decorations along path with a custom pic). I propose this way to solve this ...
• 500
1 vote
Accepted

### PGF boxplot prepared including outliers from file

You cannot simply read a table from a macro due to expansion issues. Instead, I would recommend that you have a look at the macro \pgfplotstabletranspose which may come quite handy here. You can ...
• 21.5k

### Z-Order of plots pgfplots

For it worked using \begin{axis}[clip mode=individual,]
• 3,249
1 vote
Accepted

### Selectively disabling axis labels in tikz-figures without modifying original file

Using \pgfplotsset{/pgfplots/ylabel=\empty} at this place won't have any effect because it will be overridden by the option ylabel={$y$-entry, typically long} that is added to the axis macro in your ....
• 21.5k
Accepted

### pgfplots multiple addplots misalignment of symbolic x axis labels

The misalignment is due to the fact that PGF shifts the bars right and left according to their grouping. You have three groups, so the first group is shifted to the left and the third to the right. ...
• 21.5k
1 vote
Accepted

### Pgfplots ignores my last datapoint

You should not use ybar interval but ybar (see this answer): \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ ...
• 21.5k
Accepted

### tikzscale package not working with group plots

I'm not entirely sure if this is the solution you are aiming. But I compile and got the same message with -6.1997pt etc. As I did just small changes following the linked answer cited in comments, I ...
• 3,372
Accepted

### y minor grid is not showing. why?

You should remove the zero from the ytick list, since your plot starts from y = 60 anyways. In this case you can even omit the ytick option alltogether. I am not fully sure that it is really like this,...
• 21.5k

### Save function inside macro for the function’s derivative

First, a note on this: \pgfmathsetmacro{\b}{0.7}; \pgfmathsetmacro{\p}{0.4}; \pgfmathsetmacro{\A}{1}; There should be no ; here because these are not TikZ nor pgfplots statements like \path, \draw, \...
• 23.5k

### A big value on y coordinates make the other small values almost not able to shown

In my opinion, axis break (this question) is a better solution. However, it is not supported in pgfplots and must be created manually.
Accepted

### PGF axis label background is covering axis ticks

An alternative is to extend the axes outside the grid and move their labels. \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \pgfplotsset{every x tick label/.append style={...
• 28k
1 vote
Accepted

### Combination of pgfplot crossreferences and invoke before with externalize produces error

After some trial and error, I have found a solution to both my problems. It seems that it is necessary to have a matching invoke after crossref tikzpicture to the invoke before crossref tikzpicture ...
1 vote
Accepted

### Adjusting the overlapping percentage numbers in a bar chart

This solution shifts up or down selected nodes near coords \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \pgfplotsset{, xmin=0, /tikz/font=\footnotesize, } \begin{...
• 28k
1 vote

### How to move percentage numbers in bar chart horizontally?

I would rotate picture and write labels on bars sides: %\documentclass{article} \documentclass[margin=3mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{...
• 257k
Accepted

### How to move percentage numbers in bar chart horizontally?

This can be an alternative. \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \pgfplotsset{, xmin=0, /tikz/font=\footnotesize, } \begin{document} \begin{figure} ...
• 28k
1 vote
Accepted

### Error bars in pgfplots symlog bar chart not working

Not sure exactly what's going on, but I think perhaps you can simplify things quite a bit. Instead of separate plots for the error bars, do everything with one \addplot per dataset. You can specify y ...
• 199k
1 vote
Accepted

### Alignment of pgfplot inline legend in body text and caption

I found that you can name the legend with legend style={name=leg} (or whatever name you like), which allows you to align its inline representation to its own base using every legend to name picture/....
• 21.5k
Accepted

### How can I remove one of the '0' (origin label) for the given graph?

Add the following to the options list of the axis: xtick={1,...,8}, % explicitly sets ticks 1 to 8 for x-axis ytick={50,100,...,300}, % ...
• 21.5k