[pstricks] psplot boundaries in algebraic notation

Martin Chicoine martin.chicoine at umontreal.ca
Fri Mar 28 18:36:38 CET 2008


> This is a feature request. The following example works:
>
> \documentclass{article}
> \usepackage{pstricks-add}
> \begin{document}
> \psset{algebraic}
> \begin{psgraph}(0,0)(-6,-2)(6,2){.5\textwidth}{6cm}
>   \psplot{16 sqrt neg}{16 sqrt}{sin(x)}
> \end{psgraph}
> \end{document}
>
> Would it be possible to write the boundaries in algebraic notation?
>
> Thanks,
>
> Martin.

Ok, I found how to do it. I just modified the "x" and "x1" definitions of
psplot in pstricks-add (lines 2358-2359, version 7, 2007-12-29):

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      /x \ifPst at algebraic (#1)
                    tx at AlgToPs begin AlgToPs end cvx
                 \else { #1 } \fi  def
      /x1 \ifPst at algebraic (#2)
                    tx at AlgToPs begin AlgToPs end cvx
                 \else { #2 } \fi  def
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

So now one can use (am I missing something?):

\documentclass{article}
\usepackage{pstricks-add}
\begin{document}
\psset{algebraic}
\begin{psgraph}(0,0)(-6,-2)(6,2){.5\textwidth}{6cm}
  \psplot{-sqrt(16)}{sqrt(16)}{sin(x)}
\end{psgraph}
\end{document}

Martin.




More information about the PSTricks mailing list