2
\documentclass[border=15pt,pstricks]{standalone}
\usepackage{pst-plot,pst-calculate}
\begin{document}
\begin{pspicture}[showgrid,algebraic](-5,-1)(5,5)
\def\hamso{-1*x^2+4}
\def\hs{sqrt(-1*x^2+4)}
\def\k{\pscalculate{sqrt(3)}}
\psplot{-2}{2}{\hamso}
\pscustom[fillstyle=hlines]{%
\psplot{-\k}{\k}{\hs}
\psplot{\k}{-\k}{\hamso}}%
\pscustom[fillstyle=solid,fillcolor=red!50]{%
\psline(0,0)(+\k,\hs)
\psplot{\k}{-\k}{\hs}
\psline(+-\k,\hs)(0,0)
 }
%%%\psaxes{->}(0,0)(-3,-1)(3,5)[$x$,-90][$y$,0]
\end{pspicture}
\end{document}

Without \psaxes...

enter image description here

With \psaxes...

enter image description here

Can anyone explain for me about this?

Another question: How to plot of function without "\pscalculate"?

Done!

\documentclass[border=15pt,pstricks]{standalone}
\usepackage{pst-plot}
\begin{document}
\begin{pspicture}[showgrid,algebraic](-5,-1)(5,5)
\def\hamso{-1*x^2+4}
\def\hs{sqrt(-1*x^2+4)}
\psplot{-2}{2}{\hamso}
\pscustom[fillstyle=hlines]{%
\psplot{3 sqrt}{3 sqrt neg}{\hs}
\psplot{3 sqrt neg}{3 sqrt}{\hamso}}%
\pscustom[fillstyle=solid,fillcolor=red!50]{%
\psline(0,0)(*{3 sqrt} \hs)
\psplot{3 sqrt}{3 sqrt neg}{\hs}
\psline(*{3 sqrt neg} \hs)(0,0)}
\psaxes[showgrid=false,showorigin=false]{->}(0,0)(-3,-1)(3,5)[$x$,-90][$y$,0]
\end{pspicture}
\end{document}
2

If showgrid is true, \psaxes uses style=gridstyleA

\documentclass[border=15pt,pstricks]{standalone}
\usepackage{pst-plot}
\begin{document}
\begin{pspicture}[showgrid,algebraic](-5,-1)(5,5)
    \def\hamso{-1*x^2+4}
    \def\hs{sqrt(-1*x^2+4)}
    \def\k{1.732}
    \psplot{-2}{2}{\hamso}
    \pscustom[fillstyle=hlines]{%
        \psplot{-\k}{\k}{\hs}
        \psplot{\k}{-\k}{\hamso}}%
    \pscustom[fillstyle=solid,fillcolor=red!50]{%
        \psline(0,0)(+\k,\hs)
        \psplot{\k}{-\k}{\hs}
        \psline(+-\k,\hs)(0,0)
    }
\psaxes[labels=none,showgrid=false]{->}(0,0)(-3,-1)(3,5)[$x$,-90][$y$,0]
\end{pspicture}
\end{document}

enter image description here

  • \psplot{\k}{-\k}{\hs}. Why can't we use \psplot{sqrt(3)}{-sqrt(3}{\hs} or \psplot{! 3 sqrt}{! 0 3 sqrt sub}{\hs} or \pstVerb{/ds 3 sqrt def} ... \psplot{! -ds}{! ds}{\hs} or etc...? – user173875 May 10 at 10:37
  • 1
    \psplot{3 sqrt}{3 sqrt neg}{\hs} – user187802 May 10 at 11:18

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.