How can I label the \psline entity with a label that is positioned/oriented (not placed horizontally taking too much space) on the line itself?
MWE:
\documentclass{standalone}
\usepackage{pstricks-add, pst-plot}
\usepackage{auto-pst-pdf}
\usepackage{xcolor}
\setlength\parindent{0pt}
\pagestyle{empty}
\begin{document}
\begin{pspicture}(0,0)(18,18)
\psset{linecolor=DodgerBlue4, tickcolor=white, subtickcolor=DodgerBlue4, gridcolor=DodgerBlue4, gridlabelcolor=white}%
\psset{linewidth=0.05pt, tickwidth=0.05pt, ticksize=-2pt 2pt, subticks=2, subtickwidth=0.025pt, labels=none}
\psframe[linewidth=0.05pt](0,0)(18,18)
\psset{gridwidth=0.05pt, subgriddiv=1}
\psgrid(0,0)(18,18)
% insert circles
\pscircle[fillstyle=solid,opacity=0.2, linewidth=0.1](9,9){8}
\pscircle[fillstyle=solid,fillcolor=white,opacity=0.2, linewidth=0.1](9,9){4}
\pscircle[fillstyle=solid,fillcolor=white,opacity=0.2, linewidth=0.1](12,8){4}
\pscircle[fillstyle=solid,fillcolor=lightgray,opacity=0.2, linewidth=0.1](9,6){4}
% insert arrows
\psline[arrows=->,linewidth=2.5pt,linestyle=solid, linecolor=red](9,9) (12,8)
\psline[arrows=->,linewidth=2.5pt,linestyle=solid, linecolor=magenta]{->}(9,9) (9,6)
\psline[arrows=->,linewidth=2.5pt,linestyle=solid, linecolor=blue]{->}(12,8) (9,6)
\psline[arrows=->,linewidth=2.5pt,linestyle=solid, linecolor=blue]{->}(9,9) (6.5,7)
\end{pspicture}
\end{document}
Best Answer
You can either add invisible
\pcline
s or work with\pcline
s instead of\psline
s. I illustrate a few possibilities below. (Now withDodgerBlue4
, big thanks to @Bernad!)