我如何绘画这个图片在 PSricks 中:
我知道如何画轴,但不确定如何命名所有点。
答案1
以下是 psTricks 中的代码:
\documentclass[pdf, x11names, dvipsnames]{article}%
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc }
\usepackage{fourier}
\usepackage{nccmath}
\usepackage{pstricks-add}%
\newpsobject{bluedot}{psdot}{linecolor=RoyalBlue3, dotsize=4pt}
\begin{document}
\psset{llx=-5mm,lly=-5mm,urx=5mm,ury=5mm, arrowinset=0, %
psgrid, gridwidth=0.6pt, gridcolor=RoyalBlue3, griddots=10, subgriddiv=1}%
\begin{pspicture*}(-1.5,-1.5)(9.6,8.5)
\psaxes[labels=none, ticks=none](0,0)(-1.5,-1.5)(9.6,8.5)
\psgrid[gridlabels = 8pt](0,0)(-1.5,-1.5)(9.6,8.5)
\multido{\i=-1 + 1}{11}{\multido{\I=-1 + 1}{10}{\bluedot(\i, \I)}}
\psline[linestyle = dashed, linewidth=0.4pt]{*-*}(0,6.5)(8.5,6.5)(8.5,0)
\bluedot(0,6.5)\bluedot(8.5,0)\uput[l](0,6.5){$ \bigl (0,\mfrac q2\bigr) $}\uput{0.3}[d](8.5,0){$\bigl (\mfrac p2,0\bigr)$}
\dotnodes(0,0){O}(8.5,6.5){A}
\ncline{O}{A}\naput[npos=0.325, nrot=:U, labelsep=2pt]{$ y = \mfrac qp x$}
\uput[r](A){$\bigl (\mfrac p2,\mfrac q2\bigr)$}\uput{0.33}[-120](O){$ (0,0) $}
\psline{<->}(6.25,0.04)(6.25,3.96)
\bluedot(6.25,4)\bluedot(6.25,0)\rput[bl](6.25,4){$ \bigl(k, \mfrac qp k\bigr) $}\uput{0.4}[d](6.25,0){$ (k, 0) $}
\rput(2.5,4.5){\Large\bfseries\sffamily A}
\rput(4.5,1.5){\Large\bfseries\sffamily B}
\multido{\i = 1 + 1}{4}{\psdot(6,\i)}
\end{pspicture*}
\end{document}