[Matplotlib-users] Changing alpha channel of image in pylab

2011-03-10 Thread Jochen Deibele
Hi!

Changing the alpha-channel of a plotted image doesn't work for me in an 
ipython (pylab) shell.

The example below illustrates the problem (i hope so at least ...)
Running it with %run - everything is fine and the two images look the same.

Runing it line by line without the show, the figure shows up, the images 
are plotted, but the alpha-value of im1 is not set correctly so it's 
fully opaque in the left plot.

Is it just me or is it a bug, and if it's a bug is it a bug in pylab or 
in matplotlib?

Thanks in advance!
Jochen

Code:

import numpy as np
from matplotlib.pyplot import *

aimg = np.array([[0, 1, 1, 0],
  [0, 1, 2, 0],
  [0, 1, 3, 0],
  [0, 1, 4, 0]])

figure()
ax = subplot(121)
im1 = imshow(aimg, alpha = 1, interpolation='nearest')
im1.set_alpha(0.5)

ax = subplot(122)
im2 = imshow(aimg, alpha = 0.5, interpolation='nearest')

show()



--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] X11 Window information for plots

2011-01-19 Thread Jochen Deibele
Ryan May wrote on 19.01.2011 16:00:

 On Wed, Jan 19, 2011 at 4:48 AM, Jochen Deibelejochen.deib...@ntnu.no  
 wrote:
 todd rme wrote on 19.01.2011 04:40:
 The class, on the other hand, seems to be an application-specific
 description of what the role is within the application.  I think this
 should probably be figure.

 Just an idea: What about exposing this (or maybe all) of the values in
 the api to be set dynamically by the user? Of course providing a useful
 default value as well.

 The thought behind is that it's hard to guess in what context the user
 wants to use the figure. And perhaps the user has 21 plots of some type
 and one which is different and he wants to treat differently.
 But at the same time - you also could do this if you adjust the window
 title.

 I'm not sure what the complete motivation behind all of this is, but
 if you just want to set the window title, that's already available:

 fig = plt.figure()
 fig.canvas.set_window_title(Look at me!)


Thanks, but that's not the intention.

Some windowmanager on X11 systems provide the possibility to manage 
windows due to some criteria. You can f.ex. force all windows of your 
browser to open minimized or always on top  etc. As far as I understood 
the discussion it is about what information should be provided to make 
this kind of window-handling possible.

Jochen

--
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Bug in boxplot/mlab.prctile

2011-01-13 Thread Jochen Deibele
Hi!

  I noticed that the boxplot function incorrectly calculates the
  location of the median line in each box.  As a simple example,
  plotting
  the dataset [1, 2, 3, 4] incorrectly plots the median line at 3.
I can confirm this.

  [..]
  I would suggest that mlab.prctile be fixed to conform to some one
  or other of these methods, rather than adding to the proliferation of
  approaches to quantile-calculation.  Is there any motivation for
  always truncating to integer (other that it's quicker to type :-)?
And I agree here. I also recently (before I noticed this thread) posted 
a bug report #3151034 [1]

There is also documented, that the mlab.prctle function does not yield 
the same results as scipy.stats.scoreatpercentile. In addition to make 
the confusion complete matlab reports yet another result ... But I think 
at least matplotlib and the scipy-stats-package should agree.

Jochen


[1] 
http://sourceforge.net/tracker/?func=detailaid=3151034group_id=80706atid=560720



-- 
Jochen Deibele, PhD candidate, Dipl.-Ing.
Department of Circulation and Medical Imaging
Norwegian University of Science and Technology (NTNU)
Phone: +47 728 28028   E-Mail: jochen.deib...@ntnu.no

--
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users