MathGroup Archive 1999

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

Search the Archive

Plotting a step function with the origin indicated

  • To: mathgroup at smc.vnet.net
  • Subject: [mg21248] Plotting a step function with the origin indicated
  • From: "aey" <york at orca.akctr.noaa.gov>
  • Date: Mon, 20 Dec 1999 02:28:08 -0500 (EST)
  • Organization: University of Washington
  • Sender: owner-wri-mathgroup at wolfram.com

Here are two step functions:

p[x_] := If[.3 < x < 2, -3, .2]
q[y_] := If[0 < y < 1, 1, .2]

If I try to plot these function with a {0,0} origin specified, I get (what
seem to me) inconsistent results:

Plot[p[x], {x, -1, 1}, PlotStyle -> RGBColor[1, 0, 0],
AxesOrigin -> {0, 0}]

Plot[q[y], {y, -1, 1}, PlotStyle -> RGBColor[1, 0, 0],
AxesOrigin -> {0, 0}]

The first behaves as I thought it should. The axes cross at {0,0}. The
second does not-- the y-axis is not completed.  This also occurs if the
PlotStyle->RGBColor is not included in the Plot call. Is there a way to get
the axes to cross in the second case?





  • Prev by Date: Re: double labelled y axis in graphs
  • Next by Date: Re: serie of random number
  • Previous by thread: I can't draw any graphics in Mathematica 4.0
  • Next by thread: Re: Plotting a step function with the origin indicated