2
\documentclass[border=15pt,pstricks]{standalone}
\usepackage{pst-plot}
\begin{document}
\begin{pspicture}[showgrid,algebraic](-7,-1)(7,7)
% \uput[90](1,3){ $\sqrt{40-x^2}$} % Line 1
% $\sqrt{40-x^2}$ % Line 2
\psplot[plotpoints=500]{ 40 sqrt neg}{40 sqrt}{sqrt(40-x^2)}
\end{pspicture}
\end{document}

With Line 1, I get:

enter image description here

With Line 2, I get:

I think the semicircle in the second case should be placed at the same coordinate as the first case.

Display Name
  • 46,933
  • I think that in the second case, $\sqrt{40-x^2}$ is not a pstricks command, whichdoes not know what to do with this stuff, so it \rputs it at the origin. This being said, do you really need \psplot to draw a half-circle? – Bernard May 29 '19 at 12:31
  • @Bernard Yes, it is not a pstricks command, but it belong to pstricks environment, I think so! –  May 29 '19 at 13:13
  • Gangsters and wild animals are not your family members, they come into your house and you want everything just fine as usual. I think so! – Display Name May 30 '19 at 07:23

2 Answers2

3

The presence of illegal objects in pspicture will make legal objects that follow get distorted.

The left picture demonstrates a case when there is no illegal object. The legal object (a dot) that follows is placed exactly at (2,2) as expected. But the right picture shows the opposite, the dot gets displaced to the right because of the presence of illegal object.

enter image description here

\documentclass[border=15pt]{standalone}
\usepackage{pstricks}
\begin{document}
\begin{pspicture}[showgrid](-1,-1)(3,3)
    %illegal-objects
    \pscircle*(2,2){2pt}
\end{pspicture}
\quad
\begin{pspicture}[showgrid](-1,-1)(3,3)
    illegal-objects
    \pscircle*(2,2){2pt}
\end{pspicture}
\end{document}

Edit

Or you can use % to disable the illegal-objects, duplicate the illegal-objects, and wrap it with \rlap as follows.

\documentclass[border=15pt]{standalone}
\usepackage{pstricks}
\begin{document}
\begin{pspicture}[showgrid](-1,-1)(3,3)
    % illegal-objects
    \rlap{illegal-objects}
    \pscircle*(2,2){2pt}
\end{pspicture}
\end{document}
Display Name
  • 46,933
2

Use a box of zero width: \makebox[0pt]{$\sqrt{40-x^2}$}% Line 2

user187802
  • 16,850