[pstricks] [Help]How to draw a piecewise function with pst-plot
Michael Sharpe
msharpe at ucsd.edu
Sun Jul 11 07:27:30 CEST 2010
On Jul 10, 2010, at 9:36 PM, jungleman wrote:
> Hi all,
>
> I'm trying to use pstricks to plot some functions with pstricks in LaTex. And now some problems have occurred to me.
>
> Here's a piecewise function or subfunction f(x):
> f(x) = 1 while x <= 0
> f(x) = 0 while x > 0
> and I tried to use pst-plot : \psline[linecolor=red](-3,1)(0,1)
> \psline[linecolor=red](0,0)(4,0)
> but I donnot know how to make the coordinate (0,0) to be a hollow dot, while (0,1) is a solid dot.
>
> And another problem is that I also tried the IfTE : \psplot{-3}{4}{ ifTE(x>0,0,1) }, but pstricks tried to connect the line y=0 and the line y=1 to be a continuous line.
>
> Can anyone tell me how to fix the problem, thanks very much.
>
Try instead
\psline[linecolor=red,arrows=-*](-3,1)(0,1)
\psline[linecolor=red,arrows=o-](0,0)(4,0)
Michael
More information about the PSTricks
mailing list