MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Problem plotting a piecewise function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg14502] Problem plotting a piecewise function
  • From: sergio at scisun.sci.ccny.cuny.edu
  • Date: Fri, 23 Oct 1998 20:59:20 -0400
  • Organization: Deja News - The Leader in Internet Discussion
  • Sender: owner-wri-mathgroup at wolfram.com

(*--
   	Hello guys,

   	Could somebody explain why in the following plot nothing is
        drawn between x =(0,0.5)?
   	How can I have the complete plot of this function?
        Notice that f[0] = 1.0 and the y-axis tick mark gets up to
        about 0.15
---*)
Clear[f,Xa,Xb];
f[x_] := Which[x >= 0. && x <= 1.5, 0.888889 (-1.5 + x) (-0.75 + x),
True, 0]; Xa=0.0; Xb=3.0;
 Plot[Evaluate[f[x]], {x,Xa,Xb}]

(*------
	I am using:
In[39]:= $Version
Out[39]= Solaris 3.0 (November 22, 1996)

In[2]:= $Version
Out[2]= SPARC 2.2 (February 5, 1994)

	Using the option PlotPoints does not improve too much the plot. Try
        for instance:
 			Plot[Evaluate[f[x]], {x,Xa,Xb}, PlotPoints -> 100]

	Regards,
	Sergio
	E-mail: sergio at scisun.sci.ccny.cuny.edu ------*)

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own



  • Prev by Date: Re: fractals
  • Next by Date: ParametricPlot
  • Previous by thread: variation of constant (in ODE)
  • Next by thread: Re: Problem plotting a piecewise function