[PYTHON] How to set the range for x-axis

Moses jamuah at gmail.com
Mon Nov 9 11:46:09 EST 2009


Hi Chris,

The code is

from scipy import *
from pylab import *

x = [0.5,0.6,0.7,0.8,0.9,1.0]
y = [2,6,8,10,10,10]

plot(x,y,linewidth=5.0)
show()

and not

from scipy import *
from pylab import *

x1 = [0.5,0.6,0.7,0.8,0.9,1.0]
x2 = [0,1,2,3,4,5,6,7,8,9,10]

plot(x1,y01,linewidth=5.0)
show()


Moses

On Mon, Nov 9, 2009 at 6:43 PM, Moses <jamuah at gmail.com> wrote:

>
> Hi Chris,
>
> I am using python 2.6 and am using scipy and pylab. See the code below.
> Cheers.
>
> from scipy import *
> from pylab import *
>
> x1 = [0.5,0.6,0.7,0.8,0.9,1.0]
> x2 = [0,1,2,3,4,5,6,7,8,9,10]
>
> plot(x1,y01,linewidth=5.0)
> show()
>
> Thanks.
> .
>
>
>
> On Mon, Nov 9, 2009 at 5:49 PM, Chris Rebert <clp2 at rebertia.com> wrote:
>
>> On Mon, Nov 9, 2009 at 7:45 AM, Moses <jamuah at gmail.com> wrote:
>> > I have written a script in python to plot a graph. However, the
>> > range for the x-axis starts from 0.5 to 1.0. However, I would like
>> > to start from 0 to 1. Any pointer to this shall be appreciated.
>>
>> Some /very/ basic information such as what plotting library you're
>> using would be necessary to answer your question. What version of
>> Python you're using would also be useful.
>>
>> Cheers,
>> Chris
>> --
>> http://blog.rebertia.com
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091109/ee501ea1/attachment-0001.html>


More information about the Python-list mailing list