[pstricks] New switch

Vince McGarry vmcgarry at austin.rr.com
Sun Feb 13 18:25:35 CET 2005


I want to add an option I can set for when I want to replace the x-axis
labels with radian labels. My lookup table works well, but I want to set it
as an option with psset. I thought it might be wise to place it in my own
family. The following has some obvious error in it that I'm too naïve to
fathom. Any help?

% pst-addmore.sty

\csname PSTAddMoreLoaded\endcsname
\let\PSTAddMoreLoaded\endinput


\ifx\PSTricksLoaded\endinput\else\input pstricks \fi
\ifx\PSTplotLoaded\endinput\else\input pst-plot \fi
\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey \fi


\edef\PstAtCode{\the\catcode`\@}
\catcode`\@=11\relax

\pst at addfams{pst-addmore}

\def\XLABEL#1{%
% This is a simple switch that replaces degree labels from -720 to 720 with
pi/8 increments in radians from -4pi to 4pi on the x-axis.
}

\newif\ifpsTrigLabels
\define at key[psset]{pst-addmore}{TrigLabels}{\@nameuse{psTrigLabels{#1}}
\psset[pst-addmore]{TrigLabels=false}

\ifpsTrigLabels %
     \renewcommand{\pshlabel}[1]{\footnotesize{\XLABEL{#1}}}
\else
\fi

\catcode`\@=\PstAtCode\relax
%
\endinput




More information about the PSTricks mailing list