## [Matplotlib-users] hz to khz

 [Matplotlib-users] hz to khz From: Waléria Antunes David - 2010-07-28 19:25:34 Attachments: text/plain imagem.jpg

 Re: [Matplotlib-users] hz to khz From: Angus McMorland - 2010-07-28 19:39:56 ```On 28 July 2010 15:25, Waléria Antunes David 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 ```
 Re: [Matplotlib-users] hz to khz From: Benjamin Root - 2010-07-28 20:00:02 Attachments: Message as HTML ```On Wed, Jul 28, 2010 at 2:39 PM, Angus McMorland wrote: > On 28 July 2010 15:25, Waléria Antunes David > 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 ```
 Re: [Matplotlib-users] hz to khz From: Samuel Teixeira Santos - 2010-07-29 01:36:37 Attachments: Message as HTML ```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 > On Wed, Jul 28, 2010 at 2:39 PM, Angus McMorland wrote: > >> On 28 July 2010 15:25, Waléria Antunes David >> 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@... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > ```