Re: [Matplotlib-users] Fitting a curve
Hoi, There is still MPL's polyfit function and I have to admit that Steve Schmerler's solution looks better that mine, but I've pasted a quick & dirty solution here: http://www.python-forum.de/topic-8363.html It shows the use of polyfit as well as (almost) Steve's approach. Further examples on linear regression and polynomal regression can be found in http://matplotlib.sourceforge.net/users_guide_0.90.0.pdf Also, you might want to have a closer look on the scipy web page: http://www.scipy.org/ . Cheers Christian - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Get pixels position of a Text object
Hello, I want to get pixels position of a Text object on my imagine, but there isn't any methods of this class to get them. How can I do ? Regards, -- Romain Bignon - http://progs.coderz.info http://www.inl.fr - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] PS and imshow
OK, I've got it. Previously, I checked the quality of the output image by two means: by visual inspection in gv and by checking the size of the output eps images. I was puzzled by the different sizes of the images at magnification 1. Also, convert produces much larger eps files. When the size of the output image is set to 6.3246cm (1494px at 600dpi) and the axes are turned off, both versions appear identical when printed. Thanks for your help, petr On Thu, 2007-08-30 at 20:35, Jouni K. Seppänen wrote: > I don't see a big difference between test-600.eps and test-convert.eps > when viewed in gv with magnification 10 and 0.1, respectively. Obviously > there is some resampling in test-600.eps: your source image is 1494 by > 1494 pixels large, which at 600 dpi is larger than the 5 by 5 cm figure > created by the script (and the axes are even smaller). test-convert.eps > has a bounding box of 0 0 1494 1494, so obviously it is a non-resampled > image at 72 dpi. > > If the problem you are alluding to is in the resampling, perhaps > varying the interpolation algorithm will produce a better result? > See the docstring of imshow. > > To get a non-resampled image, figimage should work, but it doesn't seem > to understand PIL images yet... - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] hatching background
Hi, is it somehow possible to have a hatch in parts of the background, which would achieve something like this pseudo-parameter to axvspan pylab.axvspan(2, 10, hatch='//')? TIA Christian - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Get pixels position of a Text object
On 8/31/07, Romain Bignon <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I want to get pixels position of a Text object on my imagine, but there isn't
> any methods of this class to get them.
>
> How can I do ?
You can use the t.get_window_extent() method of the text object, with
the caveat that this
only works *after* the canvas has been drawn, so you need to force a
draw first. Makre sure you use the same DPI in the figure and savefig
commands if you need these coords for working with hardcopy
from pylab import figure, show
fig = figure(figsize=(6,6), dpi=72)
ax = fig.add_subplot(111)
ax.plot([1,2,3])
t = ax.text(1,2,'hi')
fig.canvas.draw()
left, bottom, width, height = t.get_window_extent().get_bounds()
print left, bottom, width, height
fig.savefig('test', dpi=72) # make sure you use the same DPI if you save
show()
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] plotting a pcolor over a contourf
I've been trying to plot a pcolor over a contourf with a masked array in the pcolor so that parts of the contour will show through underneath, but whenever I try to do this the pcolor wipes out the contourf. I can do this fine with a contourf over another contourf, but I'm plotting model topography, and I would really prefer to leave the discretization visible instead of showing contourf's interpolation. Any way to get a pcolor to plot over a contourf without wiping out the contourf beneath it? Jordan - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] plotting a pcolor over a contourf
Jordan Dawe wrote: > I've been trying to plot a pcolor over a contourf with a masked array in > the pcolor so that parts of the contour will show through underneath, > but whenever I try to do this the pcolor wipes out the contourf. I can > do this fine with a contourf over another contourf, but I'm plotting > model topography, and I would really prefer to leave the discretization > visible instead of showing contourf's interpolation. Any way to get a > pcolor to plot over a contourf without wiping out the contourf beneath it? > > Jordan Jordan, I'm not sure I understand what you are trying to do; please provide a simple, self-contained script that illustrates the problem. (Is the contour supposed to be seen through holes in the pcolor where it is masked? Or are you talking about using transparency?) Eric - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] marker=None not allowed?
Line2D documentation reads: marker: [ '+' | ',' | '.' | '1' | '2' | '3' | '4' 1. Minor documentation bug: missing end bracket 2. Why is marker=None no longer allowed? Cheers, Alan Isaac - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] annotation problem
I meant to be copying an annotation example from http://matplotlib.sourceforge.net/examples/annotation_demo.bak.py but it is not working. Am I just too bleary eyed because it is later here, or is there a problem with the example? Thank you, Alan Isaac Illustrate Annotation Problem % import pylab import matplotlib as mpl test = pylab.figure() test_ax = test.gca() test_ax.plot([1,2,3]) #the following line fails with "ValueError: too many values to unpack" a = mpl.text.Annotation( test, 'F: a figure title (points)', loc=(-10, -10), coords='figure points', horizontalalignment='right', verticalalignment='top', fontsize=20) test_ax.add_artist(f) test.savefig(r'c:\temp\temp.eps') - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] marker=None not allowed?
Alan G Isaac wrote: > Line2D documentation reads: > > marker: [ '+' | ',' | '.' | '1' | '2' | '3' | '4' > > 1. Minor documentation bug: missing end bracket Sort of. Actually, what is also missing is a very long list of possible markers, as given in the docstring for the set_marker method. Some docstring modifications and consolidations are needed. > 2. Why is marker=None no longer allowed? marker='None' is allowed, as is ' ' and ''. Do you need None? The idea is to distinguish between 'None' as in 'no marker--don't draw anything', and None as the default for a kwarg, meaning use the rcParams value. In plot, if you trace through the chain of half a dozen or so functions, you find that the kwargs are handled using setters, not at the stage of initialization of the Line2D instance, and setters generally don't accept None. Eric > > Cheers, > Alan Isaac > > > > > - > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > ___ > Matplotlib-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/matplotlib-users - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
