我怎样才能删除轴上的数字并定义要绘制的域和范围?(因为我的乳胶文件中已经有方格背景。)
\begin{figure}[H]
\begin{tikzpicture}
%\tkzInit[xmax=6,ymax=6,xmin=-6,ymin=-6]
%\tkzGrid
\tkzAxeXY
%\draw[ thick,latex-latex] (-1,4) -- (4,-6) node[anchor=south west] {$a$}; % two points for drawing 2x+y=2
%\tkzText[above](0,6.75){Desired Output}
\end{tikzpicture}
\end{figure}
答案1
Japser 代码对我来说不起作用。相反,代码有效:
\documentclass[border=5mm]{standalone}
\usepackage{tkz-euclide}
\begin{document}
\begin{tikzpicture}
\tkzInit[xmax=6,ymax=6,xmin=-6,ymin=-6]
%\tkzGrid
%\tkzAxeXY
\tkzSetUpAxis[line width=1pt,tickwd=0pt,ticka=0pt,tickb=0pt]
\tkzDrawX
\tkzDrawY
%\draw[ thick,latex-latex] (-1,4) -- (4,-6) node[anchor=south west] {$a$}; % two points for drawing 2x+y=2
%\tkzText[above](0,6.75){Desired Output}
\end{tikzpicture}
\end{document}
输出为:
答案2
那么,您想要没有刻度和标签吗?那么您应该使用\tkzDrawXY
而不是\tkzAxeXY
,这样就不会显示标签。要删除刻度,您需要使用 将其宽度设置为零\tkzSetUpAxis
(请参阅tkz-base
手动的了解更多信息):
\documentclass[border=1mm]{standalone}
\usepackage{tkz-euclide}
\begin{document}
\begin{tikzpicture}
%\tkzInit[xmax=6,ymax=6,xmin=-6,ymin=-6]
%\tkzGrid
%\tkzAxeXY
\tkzSetUpAxis[line width=1pt,tickwd=0pt,ticka=0pt,tickb=0pt]
\tkzDrawXY
%\draw[ thick,latex-latex] (-1,4) -- (4,-6) node[anchor=south west] {$a$}; % two points for drawing 2x+y=2
%\tkzText[above](0,6.75){Desired Output}
\end{tikzpicture}
\end{document}