[pstricks] psplot and continuity

Herbert Voss Herbert.Voss at FU-Berlin.DE
Sat Jul 19 09:51:21 CEST 2008


Loïc schrieb:

> I would like to prevent discontinuity on the plotted functions.
> Remark:
> - Before discontinuity, the slope is around 20
> - After discontinuity, the slope is around -20
> 
> I think It would be wonderful if  the \psplot command implement an 
> argument specifying the maximum slope jump allowed between two points.
> 
> For example:
> 
> \psplot[plotpoints=200,max_slope=10]{-4.3}{8.38}{tan(x)}
> 
> won't connect any points with a slope difference greater than 10.

it is easier with an absolute max value and clipping

\documentclass[10pt]{article}
\usepackage{pstricks-add}
\makeatletter
\def\doqp at line{ dup abs \maxTan gt { moveto }{ L } ifelse }
\def\maxTan{10 \pst at number\psyunit mul }% 10 in screen coor
\makeatother

\begin{document}

\psset{algebraic,linewidth=0.8pt,arrowsize=3pt 2,arrowinset=0.25}
\begin{pspicture*}(-4.3,-3.88)(8.38,6.3)
\psaxes[ticksize=-2pt 0,subticks=2]{->}(0,0)(-4.3,-3.88)(8.38,6.3)
\psplot[plotpoints=200,plotstyle=line]{-4.3}{8.38}{tan(x)}
\rput[bl](-4.2,-2.58){$f$}
\end{pspicture*}

\end{document}


Herbert



More information about the PSTricks mailing list