Hot answers tagged

18 votes
Accepted

pgfplots - How to rotate extra x tick labels

Add a tick label style within the extra x tick style. \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ width=16.5cm, height=7cm, xmin=-0....
Torbjørn T.'s user avatar
12 votes

Graph with cropped letters

I see that you set ticks=none, and then manually added something very much like axis ticks. If you use PGFPLOTS's own tick-placing system, the tick labels do not get clipped. In this example, there'...
Matthew Leingang's user avatar
11 votes
Accepted

pgfplots - Remove tickmarks on right and top of plot

You want xtick pos=bottom,ytick pos=left, or alternatively tick pos=left which does the same thing. The length of the ticks is defined by the tickwidth parameter. \documentclass[a4paper, 11 pt]{...
Torbjørn T.'s user avatar
11 votes

Graph with cropped letters

Let me convert my comment to an answer. In your case clip=false will work just fine: \documentclass[margin=3mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.16, axis lines=middle, % &...
Zarko's user avatar
  • 290k
10 votes
Accepted

Minor grid in pgfplot not showing when specifying ticks manualy

Setting all the ticks explicitly works: \documentclass[border=2mm]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[% grid=both, minor tick num=1, xtick={0,0.1,0....
Torbjørn T.'s user avatar
9 votes
Accepted

Get the auto generated tick distance of a pgfplot (DIN 461)

You can give the tick labels numbered names that can then be used to position a label halfway between the last two labels. \documentclass[border=5mm]{standalone} \usepackage{pgfplots} \usepackage{...
Jake's user avatar
  • 231k
8 votes
Accepted

pgfplots: how to move extra x tick label vertically down

If the extra ticks should be longer, its tick labels shift automatically: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest}% <- set a compat!! (current version is 1.14) \...
esdd's user avatar
  • 84.8k
8 votes
Accepted

add extra tick labels pgfplot

extra x ticks and extra x tick labels can take lists of positions and labels, not just single values. So you should use: extra x ticks={1000, 3000}, extra x tick style={% grid=major, }, extra x ...
Jake's user avatar
  • 231k
8 votes
Accepted

Change position of individual tick label

If its only one tick label, you could use x tick label style={yshift={(\ticknum==2)*2em}} or x tick label style={yshift={(\tick==-1)*2em}} And you can add the following to remove the nodes near ...
esdd's user avatar
  • 84.8k
8 votes
Accepted

Tikzpicture - how to make major ticks longer or thicker

On page 342 from the manual (version 1.16), it introduces every minor tick/.append style={...} and every major tick/.append style={...} options for customization. You need to use minor tick length = ...
M. Al Jumaily's user avatar
7 votes

Minor grid in pgfplot not showing when specifying ticks manualy

You could also try xtick distance=.1, ytick distance=.1, instead of xtick={0,0.1,...,1},ytick={0,0.1,...,1},. Code: \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{...
esdd's user avatar
  • 84.8k
6 votes
Accepted

Logarithmic kelvin colorbar

I admit that I have a couple of questions which may indicate that I did not understand/think through your question (for example, how to you want to display -1*10^9 on a log scale? Or do you mean 10^-9?...
Christian Feuersänger's user avatar
6 votes
Accepted

How can I remove all tics except extra tics?

The automatic x ticks are suppressed by the special value \empty: xtick=\empty \documentclass[paper=a4,12pt,version=last,landscape]{scrartcl} \usepackage{pgfplots} \begin{document} \begin{...
Heiko Oberdiek's user avatar
6 votes

How to color tick label background when curve overlaps it

Add xticklabel style = {fill=white}and set layers = axis on topto your axis : \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.13} \begin{document} \pgfplotsset{ standard/....
Christoph Frings's user avatar
6 votes
Accepted

How to remove mantissa on semilogarithmic pgfplots graph (while retaining modifications for sans serif tick font)

If I understand correctly, you care about \mathsf, but not about the fixed point numbers. In this case, you can modify the way pgfplots typesets the math labels. To this end, pgfplots offers the ...
Christian Feuersänger's user avatar
6 votes
Accepted

yticklabels and ytick wont work

TL;DR: You have to set the axis limits with ymin=0 to make the 0 appear because PGFPlots adjusts the limits automatically and it doesn't know that the 0 should appear. Slightly wordier version (with ...
Phelype Oleinik's user avatar
6 votes

Tikzpicture - how to make major ticks longer or thicker

With \pgfmathsetlengthmacro\MajorTickLength{...} you just created a length and stored some value to it, but you never applied that value somewhere. So by adding major tick length=\MajorTickLength to ...
Stefan Pinnow's user avatar
6 votes
Accepted

pgfplots: Missing one group of bars

As ferahfeza already mentioned in the comment below the question the reason, that the last block of bars isn't shown, is the ybar interval statement. And here is why it so: That is because of the ...
Stefan Pinnow's user avatar
5 votes
Accepted

How to color tick label background when curve overlaps it

To fill the background of the ticklabels you can use ticklabel style={fill=white}. But the are drawn before the plots ... To change this order you can define and use a new layer set. \pgfplotsset{ ...
esdd's user avatar
  • 84.8k
5 votes
Accepted

Specify ticks as micro seconds

If fixed it using the following options to the axis environment: scaled x ticks=base 10:6, /pgf/number format/sci subscript, Full working example below with output: \documentclass[tikz,border=10pt]{...
fluxmodel's user avatar
  • 697
5 votes
Accepted

Pgfplot with two y-axes not showing correct ytick values

Seems if you only specify the y-limits, and do not have any plots in the axis, pgfplots will fall back to default limits. It warns you about this in the log file: Package pgfplots Warning: You have ...
Torbjørn T.'s user avatar
4 votes
Accepted

ytick lists in loglogaxis and semilogyaxis

Using ytick and the exponential enotation you cannot use the ... shortcut. However, You can use ytickten, as in ytickten={-15,...,8}, which is equivalent to specify ytick as the list 1e-15,...
Gonzalo Medina's user avatar
4 votes
Accepted

Pgfplots: Labels from data table not working as expected

This should fix your problem: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \usepackage{pgfplotstable} \usepackage{filecontents} \begin{filecontents}{data.dat} fname foo ...
Pouya's user avatar
  • 7,209
4 votes

Engineering notation (scientific) as tick labels with pgfplots (maybe via siunitx)?

I was facing a similar problem, except that I wanted to have SI prefixes. I adapted your code to that. Might not be the cleanest solution, but works so far. I also added a rounding capability so that ...
cx05's user avatar
  • 181
4 votes
Accepted

Extra yticks interfering with label distances

This indeed a bug which is caused by the combination of tick align=outside with extra ticks. There the major tick length is taken into account "two times to much". First from the normal major tick ...
Stefan Pinnow's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible