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?