I have had this issue for long and no solution yet despite my numerous research. I wish to know if it is possible to specify the axis scale in Latex graph as we normally do in Maths.
For Example I wish to specify "2 cm for 1 unit on the x-axis and 4 cm for 1 unit on the y-axis". I have the current code as shown below
\begin{tikzpicture}[scale=2,dot/.style 2 args={circle,inner
sep=1pt,fill,label={#2:#1},name=#1}, extended line/.style={shorten >=-
#1,shorten <=-#1,draw=Cerulean}, extended line/.default=1cm]
\begin{axis}[
width=20cm,
height=20cm,
xmax=10,xmin=-10,
ymin=-10,ymax=10,
xlabel=$x$,ylabel=$y$,
xtick={-10,...,10},
ytick={-10,...,10},
%domain=-7.5:10.5,
axis lines=center, % default is to make a box around the axis
x label style={at={(axis description cs:1,0.15)},anchor=west},
y label style={at={(axis description cs:0.5,1.05)},anchor=north},
width=10cm,
height=11cm,
grid=both,
grid style={line width=.3pt, draw=gray!50},
major grid style={line width=.5pt,draw=gray!90},
minor tick num=4,
enlargelimits={abs=0.5}
]
\end{axis}
\end{tikzpicture}
As you can notice, when compiled the axis numbering are so close to each other. I want to skip some. Thank you
tikz-pgf
the answer is as simple as addingx=2cm,y=4cm
to the options of thetikzpicture
(oraxis
).xtick={-10,...,10},
If you want less, use e.g.xtick={-10,-8,...,10},
(and the same for y), or do not specify the ticks explicitly and usextick distance=2
or so.\documentclass{...}
, the required\usepackage
's,\begin{document}
, and\end{document}
. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem.