TransWikia.com

Axis and Tikz Formatting

TeX - LaTeX Asked by Jaxx on April 22, 2021

documentclass[a4paper,12pt]{article}

usepackage[utf8]{inputenc}
usepackage[fleqn]{amsmath}
usepackage{tikz}


begin{document}


begin{tikzpicture}

draw[step = 0.4cm, gray, very thin] (-2,-2) grid (6,6);

draw[thick,->] (0,0) -- (4.5,0) node[anchor = north west]{x axis};
draw[thick,->] (0,0) -- (0,4.5) node[anchor = south east]{y axis};

foreach x in {0,1,2,3}
    draw (x cm, 1pt) -- (x cm, -1pt) node[anchor = north] {$x$)};
foreach y in {0,1,2,3,4}
    draw (1pt, y cm) -- (-1pt, y cm) node[anchor = east] {$y$)};

end{tikzpicture}

end{document}

How do you get rid of the parenthesis in this code?

Source: https://www.youtube.com/watch?v=pcIzeN46ETc [5:48 – 6:42]

enter image description here

One Answer

documentclass[a4paper,12pt]{article}

usepackage[utf8]{inputenc}
usepackage[fleqn]{amsmath}
usepackage{tikz}


begin{document}


begin{tikzpicture}

draw[step = 0.4cm, gray, very thin] (-2,-2) grid (6,6);

draw[thick,->] (0,0) -- (4.5,0) node[anchor = north west]{x axis};
draw[thick,->] (0,0) -- (0,4.5) node[anchor = south east]{y axis};

foreach x in {0,1,2,3}
    draw (x cm, 1pt) -- (x cm, -1pt) node[anchor = north] {$x$};
foreach y in {0,1,2,3,4}
    draw (1pt, y cm) -- (-1pt, y cm) node[anchor = east] {$y$};

end{tikzpicture}

end{document}

Correct answer by js bibra on April 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP