Re: Holes when plotting funtions
- To: mathgroup at smc.vnet.net
- Subject: [mg42195] Re: [mg42192] Holes when plotting funtions
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Sun, 22 Jun 2003 04:05:32 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
On Sunday, June 22, 2003, at 09:57 AM, Ashraf El Ansary wrote:
> Hi,
> Is there any way to mathematica to distinguish non-continous equations
> in
> the 'Plot' function. For example:
> f[x_]:=x(1-Cos[x])/(x-Sin[x])
> Plot[f[x],{x,-20,20},AxesLabel->{x,y},AxesOrigin->{0,0}]
>
> The above example is not defined around zero, but when plotted by
> Mathematica , it looks as if the function is continous. Is there any
> way to
> plug a whole in those intervals which are not continous (simillar to
> those
> depicted in textbooks for step /open/closed intervals]......
>
>
> Cheers.
>
>
> Ashraf
>
>
>
>
The function you wan to plot actually *is* continuous at 0, or, if you
prefer, it becomes continuous if you define it to have the value 3 at
0. Also, strictly speaking, it does not make sense to represent
graphically a piece of the continuum (an interval) with a single point
removed, since obviously a point will have no "size". However, if you
want you can always draw a white colored point (which is of course
"really" a disk) at the location where you want the hole to appear:
Plot[x(1 -
Cos[x])/(x - Sin[x]), {x, -20, 20}, AxesLabel -> {x, y}, AxesOrigin
-> {
0, 0}, Epilog -> {{PointSize[0.01], RGBColor[1, 1, 1], Point[{0,
3}]}}]
Of course by doing this we have just removed a piece of the y axis
also. You might prefer to use a frame instead of axes:
Plot[x(1 -
Cos[x])/(x - Sin[x]), {x, -20, 20}, AxesLabel -> {x, y}, Frame ->
True,
Axes -> False, Epilog -> {{RGBColor[1, 1, 1], Point[{0, 3}]}}]
Andrzej Kozlowski
Yokohama, Japan
http://www.mimuw.edu.pl/~akoz/
http://platon.c.u-tokyo.ac.jp/andrzej/