Re: How to plot y=f(x) or given y interval?
- To: mathgroup at smc.vnet.net
- Subject: [mg119205] Re: How to plot y=f(x) or given y interval?
- From: Barrie Stokes <Barrie.Stokes at newcastle.edu.au>
- Date: Wed, 25 May 2011 05:55:07 -0400 (EDT)
Hi Alexandre Here are some ideas: Plot[ Sin[x], {x, 0, 6 \[Pi]} ] Plot[ Sin[x], {x, 0, 6 \[Pi]}, PlotRange -> {-0.5, +0.5} ] sinTruncated1[ x_ ] := If[ -0.5 <= Sin[x] <= +0.5, Sin[x]] Plot[ sinTruncated1[x], {x, 0, 6 \[Pi]}, PlotRange -> {-1, 1} ] sinTruncated2[ x_ ] := Which[ -0.5 <= Sin[x] <= +0.5, Sin[x], Sin[x] < -0.5, -0.5, Sin[x] > +0.5, +0.5] Plot[ sinTruncated2[x], {x, 0, 6 \[Pi]}, PlotRange -> {-1, 1} ] You will get many more from other Group members. Cheers Barrie >>> On 24/05/2011 at 7:59 pm, in message <201105240959.FAA12225 at smc.vnet.net>, Alexandre Araripe <araripe at ufba.br> wrote: > HI, > > How can I plot a function y=f(x) for a given y interval? > Thank in advance > Araripe