Hz to KHz

My code like this in django: http://pastebin.com/nzM5jvuc

i’m lost

···

On Mon, Jul 26, 2010 at 1:42 PM, <PHobson@…2850…> wrote:

Make sure that you’re dividing by 1000.0 (as opposed to
1000) to avoid any integer nonsense and make sure to reset your axis limits.

Posting a small code snippet would help us get you on the right
track.

-p

From: Waléria Antunes
David [mailto:waleriantunes@…287…]
Sent: Monday, July 26, 2010 9:32 AM
To: Matthieu Brucher
Cc: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] Hz to KHz

I know…I tried but I’m using
django and also when divided by 1000 the image does not appear…
I don’t know what to do…help me…

On Mon, Jul 26, 2010 at 1:27 PM, Matthieu Brucher <matthieu.brucher@…287…> > wrote:

Hi,

You may just divide them by 1000?

Matthieu

2010/7/26 Waléria Antunes David <waleriantunes@…287…>:

Hello all,

I need to format the values of graphic to KHz…my values are in Hz
see at idle python it displays the values as: 3000 3050 3100 … 3400 ,
but
I need to go where it will be displayed KHz: 3.0 3.1

can someone help me?


The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/


Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Information System Engineer, Ph.D.

Blog: http://matt.eifelle.com

LinkedIn: http://www.linkedin.com/in/matthieubrucher

My code like this in django: http://pastebin.com/nzM5jvuc

Are you perhaps suffering from integer division? How about dividing by
1000.0, instead of 1000?

Angus.

···

On 26 July 2010 12:47, Waléria Antunes David <waleriantunes@...287...> wrote:

i'm lost

On Mon, Jul 26, 2010 at 1:42 PM, <PHobson@...2850...> wrote:

Make sure that you’re dividing by 1000.0 (as opposed to 1000) to avoid any
integer nonsense and make sure to reset your axis limits.

Posting a small code snippet would help us get you on the right track.

-p

From: Waléria Antunes David [mailto:waleriantunes@…287…]
Sent: Monday, July 26, 2010 9:32 AM
To: Matthieu Brucher
Cc: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] Hz to KHz

I know...I tried but I'm using django and also when divided by 1000 the
image does not appear...
I don't know what to do.....help me....

On Mon, Jul 26, 2010 at 1:27 PM, Matthieu Brucher >> <matthieu.brucher@...287...> wrote:

Hi,

You may just divide them by 1000?

Matthieu

2010/7/26 Waléria Antunes David <waleriantunes@...287...>:

> Hello all,
>
> I need to format the values of graphic to KHz.....my values are in Hz
> see at idle python it displays the values as: 3000 3050 3100 .... 3400 ,
> but
> I need to go where it will be displayed KHz: 3.0 3.1
>
> can someone help me?

>
> ------------------------------------------------------------------------------
> The Palm PDK Hot Apps Program offers developers who use the
> Plug-In Development Kit to bring their C/C++ apps to Palm for a share
> of $1 Million in cash or HP Products. Visit us here for more details:
> http://ad.doubleclick.net/clk;226879339;13503038;l?
> http://clk.atdmt.com/CRS/go/247765532/direct/01/
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> matplotlib-users List Signup and Options
>
>

--
Information System Engineer, Ph.D.
Blog: http://matt.eifelle.com
LinkedIn: Matthieu Brucher - Quantitative Developer - Squarepoint Capital | LinkedIn

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

--
AJC McMorland
Post-doctoral research fellow
Neurobiology, University of Pittsburgh

i don’t understand…

···

On Mon, Jul 26, 2010 at 1:57 PM, Angus McMorland <amcmorl@…287…> wrote:

On 26 July 2010 12:47, Waléria Antunes David <waleriantunes@…287…> wrote:

My code like this in django: http://pastebin.com/nzM5jvuc

Are you perhaps suffering from integer division? How about dividing by

1000.0, instead of 1000?

Angus.

i’m lost

On Mon, Jul 26, 2010 at 1:42 PM, <PHobson@…2850…> wrote:

Make sure that you’re dividing by 1000.0 (as opposed to 1000) to avoid any

integer nonsense and make sure to reset your axis limits.

Posting a small code snippet would help us get you on the right track.

-p

From: Waléria Antunes David [mailto:waleriantunes@…287…]

Sent: Monday, July 26, 2010 9:32 AM

To: Matthieu Brucher

Cc: matplotlib-users@lists.sourceforge.net

Subject: Re: [Matplotlib-users] Hz to KHz

I know…I tried but I’m using django and also when divided by 1000 the

image does not appear…

I don’t know what to do…help me…

On Mon, Jul 26, 2010 at 1:27 PM, Matthieu Brucher > > >> <matthieu.brucher@…287…> wrote:

Hi,

You may just divide them by 1000?

Matthieu

2010/7/26 Waléria Antunes David <waleriantunes@…287…>:

Hello all,

I need to format the values of graphic to KHz…my values are in Hz

see at idle python it displays the values as: 3000 3050 3100 … 3400 ,

but

I need to go where it will be displayed KHz: 3.0 3.1

can someone help me?


The Palm PDK Hot Apps Program offers developers who use the

Plug-In Development Kit to bring their C/C++ apps to Palm for a share

of $1 Million in cash or HP Products. Visit us here for more details:

http://ad.doubleclick.net/clk;226879339;13503038;l?

http://clk.atdmt.com/CRS/go/247765532/direct/01/


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Information System Engineer, Ph.D.

Blog: http://matt.eifelle.com

LinkedIn: http://www.linkedin.com/in/matthieubrucher


The Palm PDK Hot Apps Program offers developers who use the

Plug-In Development Kit to bring their C/C++ apps to Palm for a share

of $1 Million in cash or HP Products. Visit us here for more details:

http://ad.doubleclick.net/clk;226879339;13503038;l?

http://clk.atdmt.com/CRS/go/247765532/direct/01/


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

AJC McMorland

Post-doctoral research fellow

Neurobiology, University of Pittsburgh

Replace this line:

ax.plot(f/1000, Sserie)

With this line:

ax.plot(f/1000.0, Sserie)

And tell us how things go. Python 2.6 distinguishes between
integers and floats very strictly. Hence:

In [1]: 20/1000

Out[1]: 0

In [2]: 20.0/1000.0

Out[2]: 0.02

See the difference?

-paul

···

From: Waléria Antunes
David [mailto:waleriantunes@…287…]
Sent: Monday, July 26, 2010 10:01 AM
To: Angus McMorland
Cc: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] Hz to KHz

i don’t understand…

On Mon, Jul 26, 2010 at 1:57 PM, Angus McMorland <amcmorl@…287…> wrote:

On 26 July 2010 12:47, Waléria Antunes David <waleriantunes@…287…> wrote:

My code like this in django: http://pastebin.com/nzM5jvuc

Are you perhaps suffering from integer division? How about
dividing by
1000.0, instead of 1000?

Angus.

i’m lost

On Mon, Jul 26, 2010 at 1:42 PM, <PHobson@…2850…> wrote:

Make sure that you’re dividing by 1000.0 (as opposed to 1000) to avoid
any
integer nonsense and make sure to reset your axis limits.

Posting a small code snippet would help us get you on the right track.

-p

From: Waléria Antunes David [mailto:waleriantunes@…287…]
Sent: Monday, July 26, 2010 9:32 AM
To: Matthieu Brucher
Cc: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] Hz to KHz

I know…I tried but I’m using django and also when divided by 1000
the
image does not appear…
I don’t know what to do…help me…

On Mon, Jul 26, 2010 at 1:27 PM, Matthieu Brucher >> <matthieu.brucher@…287…> wrote:

Hi,

You may just divide them by 1000?

Matthieu

2010/7/26 Waléria Antunes David <waleriantunes@…287…>:

Hello all,

I need to format the values of graphic to KHz…my values are
in Hz
see at idle python it displays the values as: 3000 3050 3100 …
3400 ,
but
I need to go where it will be displayed KHz: 3.0 3.1

can someone help me?


The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a
share
of $1 Million in cash or HP Products. Visit us here for more
details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/


Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Information System Engineer, Ph.D.
Blog: http://matt.eifelle.com
LinkedIn: http://www.linkedin.com/in/matthieubrucher


The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/


Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

AJC McMorland
Post-doctoral research fellow
Neurobiology, University of Pittsburgh

i don't understand..

python (version < 3, I think) uses integer division when given integer
values, i.e. 1/1000 = 0, at the expense of giving a less accurate
answer than we might expect. If you tried to plot a bunch of values
divided by 1000, they may well all be integer 0, and so you wouldn't
see any line (it would be at the x-axis). You would need to force
python to do floating point division: 1/1000.0 = 0.001; to do this you
need to make sure one of the numbers in the division is floating
point: the simplest way to do this is 1/1000.0 (or 1/1000. for short).

I hope that helps,

Angus.

···

On 26 July 2010 13:01, Waléria Antunes David <waleriantunes@...287...> wrote:

On Mon, Jul 26, 2010 at 1:57 PM, Angus McMorland <amcmorl@...287...> wrote:

On 26 July 2010 12:47, Waléria Antunes David <waleriantunes@...287...> >> wrote:
> My code like this in django: http://pastebin.com/nzM5jvuc

Are you perhaps suffering from integer division? How about dividing by
1000.0, instead of 1000?

Angus.

> i'm lost
>
> On Mon, Jul 26, 2010 at 1:42 PM, <PHobson@...2850...> wrote:
>>
>> Make sure that you’re dividing by 1000.0 (as opposed to 1000) to avoid
>> any
>> integer nonsense and make sure to reset your axis limits.
>>
>>
>>
>> Posting a small code snippet would help us get you on the right track.
>>
>> -p
>>
>>
>>
>> From: Waléria Antunes David [mailto:waleriantunes@…287…]
>> Sent: Monday, July 26, 2010 9:32 AM
>> To: Matthieu Brucher
>> Cc: matplotlib-users@lists.sourceforge.net
>> Subject: Re: [Matplotlib-users] Hz to KHz
>>
>>
>>
>> I know...I tried but I'm using django and also when divided by 1000 the
>> image does not appear...
>> I don't know what to do.....help me....
>>
>> On Mon, Jul 26, 2010 at 1:27 PM, Matthieu Brucher >> >> <matthieu.brucher@...287...> wrote:
>>
>> Hi,
>>
>> You may just divide them by 1000?
>>
>> Matthieu
>>
>> 2010/7/26 Waléria Antunes David <waleriantunes@...287...>:
>>
>> > Hello all,
>> >
>> > I need to format the values of graphic to KHz.....my values are in Hz
>> > see at idle python it displays the values as: 3000 3050 3100 ....
>> > 3400 ,
>> > but
>> > I need to go where it will be displayed KHz: 3.0 3.1
>> >
>> > can someone help me?
>>
>> >
>> >
>> > ------------------------------------------------------------------------------
>> > The Palm PDK Hot Apps Program offers developers who use the
>> > Plug-In Development Kit to bring their C/C++ apps to Palm for a share
>> > of $1 Million in cash or HP Products. Visit us here for more details:
>> > http://ad.doubleclick.net/clk;226879339;13503038;l?
>> > http://clk.atdmt.com/CRS/go/247765532/direct/01/
>> > _______________________________________________
>> > Matplotlib-users mailing list
>> > Matplotlib-users@lists.sourceforge.net
>> > matplotlib-users List Signup and Options
>> >
>> >
>>
>>
>>
>> --
>> Information System Engineer, Ph.D.
>> Blog: http://matt.eifelle.com
>> LinkedIn: Matthieu Brucher - Quantitative Developer - Squarepoint Capital | LinkedIn
>>
>>
>
>
> ------------------------------------------------------------------------------
> The Palm PDK Hot Apps Program offers developers who use the
> Plug-In Development Kit to bring their C/C++ apps to Palm for a share
> of $1 Million in cash or HP Products. Visit us here for more details:
> http://ad.doubleclick.net/clk;226879339;13503038;l?
> http://clk.atdmt.com/CRS/go/247765532/direct/01/
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> matplotlib-users List Signup and Options
>
>

--
AJC McMorland
Post-doctoral research fellow
Neurobiology, University of Pittsburgh

--
AJC McMorland
Post-doctoral research fellow
Neurobiology, University of Pittsburgh

Just divide through by '1000.' or '1000.0' (same thing).

If you write 3100/1000, you'll get '3' because you are doing integer math. If you write 3100/1000.0, you'll get '3.1' because you are doing float math.

···

On Jul 26, 2010 at 02:01 PM -0300, Waléria Antunes David wrote:

i don't understand..

I did what you showed me but the image disappears

···

On Mon, Jul 26, 2010 at 2:06 PM, <PHobson@…2850…> wrote:

Replace this line:

ax.plot(f/1000, Sserie)

With this line:

ax.plot(f/1000.0, Sserie)

And tell us how things go. Python 2.6 distinguishes between
integers and floats very strictly. Hence:

In [1]: 20/1000

Out[1]: 0

In [2]: 20.0/1000.0

Out[2]: 0.02

See the difference?

-paul

From: Waléria Antunes
David [mailto:waleriantunes@…287…]
Sent: Monday, July 26, 2010 10:01 AM
To: Angus McMorland

Cc: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] Hz to KHz

i don’t understand…

On Mon, Jul 26, 2010 at 1:57 PM, Angus McMorland <amcmorl@…287…> wrote:

On 26 July 2010 12:47, Waléria > Antunes David <waleriantunes@…287…> > wrote:

My code like this in django: http://pastebin.com/nzM5jvuc

Are you perhaps suffering from integer division? How about
dividing by
1000.0, instead of 1000?

Angus.

i’m lost

On Mon, Jul 26, 2010 at 1:42 PM, <PHobson@…2850…> > wrote:

Make sure that you’re dividing by 1000.0 (as opposed to 1000) to avoid
any
integer nonsense and make sure to reset your axis limits.

Posting a small code snippet would help us get you on the right track.

-p

From: Waléria Antunes David [mailto:waleriantunes@…287…]
Sent: Monday, July 26, 2010 9:32 AM
To: Matthieu Brucher
Cc: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] Hz to KHz

I know…I tried but I’m using django and also when divided by 1000
the
image does not appear…
I don’t know what to do…help me…

On Mon, Jul 26, 2010 at 1:27 PM, Matthieu Brucher > >> <matthieu.brucher@…287…> > wrote:

Hi,

You may just divide them by 1000?

Matthieu

2010/7/26 Waléria Antunes David <waleriantunes@…287…>:

Hello all,

I need to format the values of graphic to KHz…my values are
in Hz
see at idle python it displays the values as: 3000 3050 3100 …
3400 ,
but
I need to go where it will be displayed KHz: 3.0 3.1

can someone help me?


The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a
share
of $1 Million in cash or HP Products. Visit us here for more
details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/


Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Information System Engineer, Ph.D.
Blog: http://matt.eifelle.com
LinkedIn: http://www.linkedin.com/in/matthieubrucher


The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/


Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

AJC McMorland
Post-doctoral research fellow
Neurobiology, University of Pittsburgh