TeX - LaTeX Asked by Planer on March 21, 2021
I want to change the style (such as color, font, size and shape of tick mark) for each tick.
In this example I want to change the color of the numbers (2,3,4) to something different and define a specific tick mark for each of them.
documentclass[10pt]{article}
usepackage{pgf,tikz,pgfplots}
pgfplotsset{compat=1.5}
usepackage{mathrsfs}
usetikzlibrary{arrows}
pagestyle{empty}
begin{document}
end{tikzpicture}
begin{tikzpicture}
begin{axis}[
x=1.5cm,y=1cm,
axis lines=middle,
ymajorgrids=true,
xmajorgrids=true,
xmin=-4,
xmax=4,
ymin=-4,
ymax=4,
xtick={-9,-8,...,9},
ytick={-5,-4,...,6},]
clip(-5,-5) rectangle (5,5);
end{axis}
end{tikzpicture}
end{document}
documentclass[10pt]{article}
usepackage{pgf,tikz,pgfplots}
pgfplotsset{compat=1.5}
usepackage{mathrsfs}
usetikzlibrary{arrows}
pagestyle{empty}
begin{document}
begin{tikzpicture}
begin{axis}[
x=1.5cm,y=1cm,
axis lines=middle,
ymajorgrids=true,
xmajorgrids=true,
xmin=-4,
xmax=4,
ymin=-4,
ymax=4,
xtick={-9,-8,...,9},
ytick={-5,-4,...,6},
extra x ticks={4,3,2,1},
extra x tick labels={4,3,2,1},
extra x tick style={
xticklabel style={yshift=0.5ex, anchor=south, color=red, font=X}}]
clip(-5,-5) rectangle (5,5);
end{axis}
end{tikzpicture}
end{document}
a second example
documentclass[10pt]{article}
usepackage{pgf,tikz,pgfplots}
pgfplotsset{compat=1.5}
usepackage{mathrsfs}
usetikzlibrary{arrows}
pagestyle{empty}
begin{document}
begin{tikzpicture}
begin{axis}[
x=1.5cm,y=1cm,
axis lines=middle,
ymajorgrids=true,
xmajorgrids=true,
xmin=-4,
xmax=4,
ymin=-4,
ymax=4,
xtick={-9,-8,...,9},
ytick={-5,-4,...,6},
extra x ticks={4,2},
extra x tick labels={$2pi$, $4pi$},
extra x tick style={
xticklabel style={yshift=0.5ex, anchor=south}}]
clip(-5,-5) rectangle (5,5);
end{axis}
end{tikzpicture}
end{document}
Answered by js bibra on March 21, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP