Re: [Matplotlib-users] applying colormap to a line
From: Nat Echols [mailto:nathaniel.ech...@gmail.com] Sent: Thursday, March 31, 2011 16:47 I'd like to divide the line segments up to get a smoother color gradient, but the values are dictated by the experiment, not a mathematical function. snip so I guess what I'm really asking for is a way to add intermediate X,Y values between every pair of values in 'points'. I can do this myself in Python, but I assume that's going to be pretty sluggish. Perhaps (for convenience if not speed) you could use a routine from scipy.interpolate [1,2], such as interp1d for piecewise linear interpolation. I imagine that, within each linear piece, you would want the density of x values to be roughly proportional to the slope. [1] http://docs.scipy.org/doc/scipy-0.8.x/reference/tutorial/interpolate.html [2] http://docs.scipy.org/doc/scipy-0.8.x/reference/interpolate.html -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] matplotlib_specgram actual power
Using some real world measurement data that has an underlying comb spectrum with specgram, I have noticed an issue with the amplitude of narrowband signals being affected by the number of FFT points used (NTTF). For areas where there is no signal (in this case near 0 Hz) I see the noise floor (level) drop by about 3 dB as I double the value of NTTF, which is expected. A narrower resolution bandwidth will provide lower broadband noise amplitude. However, the signal has a comb spectrum present, and as I increase the value of NTTF the amplitude values of each component of the comb spectrum increases by about 3 dB when I double NFFT. I would expect that the narrowband levels would remain the same and not increase. I expect that the underlying FFT function in specgram scales by 1/NFFT, or maybe it does not (the FFT function in MATLAB does not included the 1/NFFT scaling). To get a true amplitude for each frequency bin does the output of specgram need to be scaled by 1/NFFT (or 1/NFFT*1/NFFT since it's a power spectrum)? Lee -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Changing xlabel/ylabel position
Thanks so much JJ! It works great. carlo Jae-Joon Lee wrote: If you want full control of label coordinates, you need to use Axis.set_label_coords method. For example, ax = gca() ax.xaxis.set_label_coords(0.5, -0.1) And alternative way is to adjust the padding between the axis and the label. ax.xaxis.labelpad = 0 Regards, -JJ On Mon, Mar 21, 2011 at 3:27 AM, andes czuni...@yahoo.com wrote: x = linspace(0,1,10) y = x**2 plot(x, y) xlabel('xname', position=(0.5,0.1)) #-- ylabel('yname', position=(0.1,0.5)) #-- -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- View this message in context: http://old.nabble.com/Re%3A-Changing-xlabel-ylabel-position-tp31225992p31300118.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] pcolor
Dear list, I have a question concerning pcolor. I am trying to plot a huge 2d array 15000x1. And in top I see that the program already uses 31Gb of ram and it grows. Is this expected behaviour? Why it needs so much memory? the sctipt is simple: import matplotlib import numpy as np import matplotlib.pyplot as plt from numpy.random import rand import mpl_toolkits.basemap as bm if __name__ == __main__: print matplotlib.__version__ print matplotlib.__revision__ print matplotlib.__date__ print 'basemap' print bm.__version__ print 'numpy' print np.__version__ x = rand(15000,1) #print x plt.pcolor(x) plt.savefig('test_pcolor.png', bbox_inches = 'tight') print Hello World matplotlib version is: 1.0.0 $Revision: 8503 $ $Date: 2010-07-06 08:56:31 -0500 (Tue, 06 Jul 2010) $ should I update? thank you for any help -- Oleksandr Huziy -- View this message in context: http://old.nabble.com/pcolor-tp31300362p31300362.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] pcolor
Ok, it works ok with pcolormesh, sorry for bothering you. -- Oleeksandr 2011/4/1 sanGuziy guziy.sa...@gmail.com Dear list, I have a question concerning pcolor. I am trying to plot a huge 2d array 15000x1. And in top I see that the program already uses 31Gb of ram and it grows. Is this expected behaviour? Why it needs so much memory? the sctipt is simple: import matplotlib import numpy as np import matplotlib.pyplot as plt from numpy.random import rand import mpl_toolkits.basemap as bm if __name__ == __main__: print matplotlib.__version__ print matplotlib.__revision__ print matplotlib.__date__ print 'basemap' print bm.__version__ print 'numpy' print np.__version__ x = rand(15000,1) #print x plt.pcolor(x) plt.savefig('test_pcolor.png', bbox_inches = 'tight') print Hello World matplotlib version is: 1.0.0 $Revision: 8503 $ $Date: 2010-07-06 08:56:31 -0500 (Tue, 06 Jul 2010) $ should I update? thank you for any help -- Oleksandr Huziy -- View this message in context: http://old.nabble.com/pcolor-tp31300362p31300362.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users