2
\documentclass[border=10pt,pstricks,12pt]{standalone}
\usepackage{pst-plot}
\begin{document}
\begin{pspicture}[unit=2cm](-3,-3)(3,3)
\psline{->}(-1.5,0)(1.5,0)
\uput[-90](1.5,0){$x$}
\psline{->}(0,-1.5)(0,1.5)
\uput[0](0,1.5){$y$}
%%%%%
\uput[-135](-1,0){$-1$}
\uput[-45](1,0){$1$}
\uput[135](0,1){$1$}
\uput[-135](0,-1){$-1$}
\psplot[algebraic]{-1.1}{1.1}{x^3} % 1
%%%%
\psclip{\pscircle(0,0){1}}
\pscustom[fillstyle=hlines]{%
\psline(-1.5,0)(1.5,0)
\psplot[algebraic]{1.1}{-1.1}{x^3}}
\endpsclip
%%%%
%\psplot[algebraic]{-1.1}{1.1}{x^3} % 2
\end{pspicture}
\end{document}

With 1, it is no problem as the following

enter image description here

With 2, it has a bit of a problem

enter image description here

Can anyone explain about it?

  • Next time please always use the main tag pstricks followed by subtags, for example, pst-plot. Why do we need to do so? Because we usually register/subscribe to the main tag to get notified. :-) – Gold Digging Programmer May 11 at 12:16
2

Use

\pscustom[fillstyle=hlines]{%
    \psline(-1.5,0)(1.5,0)
    \psplot[algebraic]{1.1}{-1.1}{x^3}}%%%%%
\endpsclip

Looks like a bug in \pscustom in conjunction with \psclip

  • But, your code was used in my code! :-) – Trong Vuong May 11 at 9:49
  • no, the %%%% are missing! – Red-Cloud May 11 at 10:04
  • @TrongVuong: %%%%% will remove the unwanted trailing white spaces. – Gold Digging Programmer May 11 at 10:37
  • Unbelievable! Oh, I see. – Trong Vuong May 11 at 10:49

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.