在 LaTeX 中创建方格纸

在 LaTeX 中创建方格纸

我不知道如何在 LaTeX 中创建这样的图表。如能得到任何帮助我将不胜感激!

在此处输入图片描述

答案1

\documentclass[tikz, border = 5pt]{standalone}

\begin{document}
\begin{tikzpicture}
  % axis
  \draw[thick, <->] (0, -4.1) -- (0, 4.1);
  \draw[thick, <->] (-4.1, 0) -- (4.1, 0);

  % grid
  \draw[help lines, step = 0.5cm] (-4, -4) grid (4, 4);
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案2

一个pstricks办法:

\documentclass[11pt, x11names, svgnames]{article}
\usepackage[margin =1.5cm]{geometry}
\usepackage{pstricks-add}
\usepackage{auto-pst-pdf}

\usepackage{sansmath}
\usepackage{etoolbox}
\pretocmd{\pshlabel}{\color{RoyalBlue4}\sansmath}{}{}
\pretocmd{\psvlabel}{\color{RoyalBlue4}\sansmath}{}{}{}%

\begin{document}%

\psset{unit=6mm, ticks=none, xlabelsep=1pt, ylabelsep=1pt, arrowinset=0.12}%, l
\psset{gridwidth=0.3pt, subgriddiv=1,gridlabels=0pt, gridcolor=LightSteelBlue}
\begin{pspicture*}(-10,-10.5)(10,10)
\psgrid(-10,-10)(10,10)
\psaxes[labelFontSize=\scriptstyle, linecolor=SteelBlue]{<->}(0,0)(-10,-10)(10,10)[\textsf{X}\rule{0pt}{2.25ex} ,-120][\textsf{Y} , -150]
\psset{linecolor=DodgerBlue4, tickcolor=white, subtickcolor=DodgerBlue4, gridlabelcolor=DodgerBlue4, ,linewidth = 1.2pt}%
\end{pspicture*}

\end{document}

在此处输入图片描述

相关内容