[pstricks] rput: differing results with latex and xelatex
Herbert Voss
Herbert.Voss at FU-Berlin.DE
Wed Mar 18 20:42:33 CET 2015
Am 18.03.2015 um 19:50 schrieb Juergen Rose:
> still one comment. Your trick works perfectly with with my example
> lecture_article_1.tex, but at least it does not work so simple with the
> example lecture_article.tex. If I add the line
>
> \psset{xunit=0.9963,yunit=0.9963}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> before of the first \Cnode line, all Cnodes are shifted into the left
> lower direction while the labels, written with \rput, are at correct
> position. Probably I have to set \psset{xunit=1.0,yunit=1.0} before any
> \Cnode command and \psset{xunit=0.9963,yunit=0.9963} before any \rput
> command. Is this correct?
define your own \CNode:
\documentclass{article}
\usepackage{pstricks-add}
\def\CNode[#1](#2)#3{{\psset{xunit=1.0038,yunit=1.0038}\Cnode[#1](#2){#3}}}
\begin{document}
\psscalebox{0.55}{%
\psframebox{%
\psset{algebraic,xunit=130.0,yunit=90.0}
\begin{pspicture*}(0.84,0.65)(1.01,1.01)
\psaxes[Ox=1.00,Oy=0.75,Dx=0.05,Dy=0.05]
{->}(1.0,0.75)(0.84,0.65)(1.01,1.01)
\psplot[plotpoints=100,linecolor=red,algebraic=true]
{0.84}{1.01}{cos(x)/sin(x)}
\psplot[plotpoints=100,linecolor=blue,algebraic=true]
{0.84}{1.01}{ x*x }
\psplot[plotpoints=100,linecolor=brown,algebraic=true]
{0.84}{1.01}{ -(x-3.14159265/2) }
\psplot[plotpoints=100,linecolor=green,algebraic=true]
{0.84}{1.01}{ -(x-3.14159265/2)-(x-3.14159265/2)^3/3}
\uput[-45](4.1,-0.2){$\bf x$} \uput[180](-0.2,4.4){$\bf y$}
\psline[linecolor=blue](0.925,0.85)(0.94,0.85)
\rput[l](0.945,0.85){\small\sffamily $y=x^2$}
\psline[linecolor=red](0.925,0.84)(0.94,0.84)
\rput[l](0.945,0.84){\small\sffamily $y=\cot(x)$}
\psline[linecolor=brown](0.925,0.83)(0.94,0.83)
\rput[l](0.945,0.83){\small\sffamily $y=-\left(x-\frac{\pi}{2}\right)$}
\psline[linecolor=green](0.925,0.82)(0.94,0.82)%
\rput[l](0.945,0.82){\small\sffamily
$y=-\left(x-\frac{\pi}{2}\right)-\frac{1}{3}\left(x-\frac{\pi}{2}\right)^3$}
\psset{xunit=0.9963,yunit=0.9963}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\CNode[radius=1mm](1.0,1.0){A}\rput(1.0,1.0){x}
\CNode[radius=5mm](0.98,0.985){B}\rput(0.98,0.985){\Large
$x_0$} \ncline{A}{B}
\CNode[radius=1mm](0.8897,0.7915){C}\rput(0.8897,0.7915){x}
\CNode[radius=5mm](0.890,0.77){D}\rput(0.8897,0.77){\Large
$x_2$} \ncline{C}{D}
\CNode[radius=1mm](0.8961,0.8031){E}\rput(0.8961,0.8031){x}
\CNode[radius=5mm](0.8961,0.82){F}\rput(0.8961,0.82){\Large
$x_7$} \ncline{E}{F}
\CNode[radius=1mm](0.89508,0.80117){G}\rput(0.89508,0.80117){x}
\CNode[radius=5mm](0.915,0.801){H}\rput(0.915,0.801){\Large
$x_8$} \ncline{G}{H}
\CNode[radius=1mm](0.8493,0.7213){I}\rput(0.8493,0.7213){x}
\CNode[radius=5mm](0.8493,0.68){J}\rput(0.8493,0.68){\Large
$x_4$} \ncline{I}{J}
\CNode[radius=1mm](0.88811,0.788739){I}\rput(0.88811,0.788739){x}
\CNode[radius=5mm](0.87,0.788739){J}\rput(0.87,0.788739){\Large
$x_9$} \ncline{I}{J}
\end{pspicture*}%
}%
}
\end{document}
More information about the PSTricks
mailing list