How do I draw this image in PStricks:

enter image description here

I know to draw the axis but not sure how to name the points and all.

  • Is TikZ, Metapost and Asymptote allowed for drawing? Have you tried to draw it by yourself? If you have, please post your code as a starting point for others. – Malipivo Apr 5 '15 at 13:26
  • @Malipivo I dont know tikz metapost and all. So its better that i get a pstricks command. – crskhr Apr 5 '15 at 15:24

Here is a code in psTricks:

 \documentclass[pdf, x11names, dvipsnames]{article}%

\usepackage[T1]{fontenc }
\newpsobject{bluedot}{psdot}{linecolor=RoyalBlue3, dotsize=4pt}


\psset{llx=-5mm,lly=-5mm,urx=5mm,ury=5mm, arrowinset=0, %
    psgrid, gridwidth=0.6pt, gridcolor=RoyalBlue3, griddots=10, subgriddiv=1}%

    \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)$}
    \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) $}
    \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)}


enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.