hz to khz

Hello all,

Well, my problem is … My current code is as follow bellow:
http://pastebin.com/7p2N5d64

and generates following image, the x-axis of the graph shows values em
Hz, values that range from 3000 to 3400, my image is attached.

But, i need the x-axis values is displayed in Khz, ranging from 3,0 to 3,4.

But, if i change my code as bellow (line 14 to 21) the image isn’t displayed in the template:
http://pastebin.com/LNgbejma

Thak You
Waléria

imagem.jpg

Hi Waléria,

We can't easily fix your problem without knowing what data f and
Sserie contain. It would help us to help you if you could post a
standalone example that shows your problem without relying on external
data.

Angus.

···

On 28 July 2010 15:25, Waléria Antunes David <waleriantunes@...287...> wrote:

Hello all,

Well, my problem is ... My current code is as follow bellow:
http://pastebin.com/7p2N5d64

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

Angus is correct that providing a stand-alone version of the script that replicates your problem would be most useful. I would like to mention a couple of possible improvements to your code. These improvements may or may not fix your issue, but they will improve your current code.

  1. Use list comprehensions

Change

y=[]
for n in f:
y.append(n/Decimal(1000))
y = numpy.array(y)

into:

y = numpy.array(f) / 1000.0

Also,

ax.grid(‘TRUE’)

should be:

ax.grid(True)

I hope this helps. If not, then please send a stand-alone example that duplicates the problem you are having.
Ben Root

···

On Wed, Jul 28, 2010 at 2:39 PM, Angus McMorland <amcmorl@…985…> wrote:

On 28 July 2010 15:25, Waléria Antunes David <waleriantunes@…287…> wrote:

Hello all,

Well, my problem is … My current code is as follow bellow:

http://pastebin.com/7p2N5d64

Hi Waléria,

We can’t easily fix your problem without knowing what data f and

Sserie contain. It would help us to help you if you could post a

standalone example that shows your problem without relying on external

data.

Angus.

AJC McMorland

Post-doctoral research fellow

Neurobiology, University of Pittsburgh

I think her problem is something like that

His values on X Axis is a range between 3000 to 3400

without this division by 1000.0 his graphic processing normally

but instead on X axis to show the range between 3000 to 3400
she needs to show this values transform in Hz (I think) that’s why the division by 1000.0

only problem when this division occur
the values o X axis became 3.0 to 3.4
and that’s what she’s send to plot

she should send the original values (3000 to 3400) and some how change the X values that appear on X axis by another way

because the way it’s goes, plot function receive a little range on X axis to plot a graphic
incompatible to Y axis values, that are passing on Sseries variable

that’s why she’s graphics not show after that division
and appear when the division is remove from the code.

so… she question should be something like

I send to plot on X axis values between 3000 to 3400
but on X axis they must appear as 3.0 to 3.4

how can I change the values on X axis
without change the real X axis values I send…

… did I help…? I hope so…

see ya all

2010/7/28 Benjamin Root <ben.root@…1304…>

···

On Wed, Jul 28, 2010 at 2:39 PM, Angus McMorland <amcmorl@…287…> wrote:

On 28 July 2010 15:25, Waléria Antunes David <waleriantunes@…287…> wrote:

Hello all,

Well, my problem is … My current code is as follow bellow:

http://pastebin.com/7p2N5d64

Hi Waléria,

We can’t easily fix your problem without knowing what data f and

Sserie contain. It would help us to help you if you could post a

standalone example that shows your problem without relying on external

data.

Angus.

AJC McMorland

Post-doctoral research fellow

Neurobiology, University of Pittsburgh

Angus is correct that providing a stand-alone version of the script that replicates your problem would be most useful. I would like to mention a couple of possible improvements to your code. These improvements may or may not fix your issue, but they will improve your current code.

  1. Use list comprehensions

Change

y=[]
for n in f:
y.append(n/Decimal(1000))
y = numpy.array(y)

into:

y = numpy.array(f) / 1000.0

Also,

ax.grid(‘TRUE’)

should be:

ax.grid(True)

I hope this helps. If not, then please send a stand-alone example that duplicates the problem you are having.
Ben Root


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://p.sf.net/sfu/dev2dev-palm


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

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