[Matplotlib-users] TkAfgg window handling bug on MaxOSX

2015-11-18 Thread Daniele Nicolodi
Hello,

I use matplotlib 1.5.0 via macports on MacOSX 10.10.5 and I'm testing
the TkAgg backend (the MacOSX backend has some annoying bugs).

I notice the following strange behavior in a IPython 4.0.0 console:

1. run the following lines:

In [1]: %matplotlib tk

In [2]: import matplotlib.pyplot as plt

In [3]: plt.figure()

2. focus the figure window (with command-tab, for example)

3. press command-w to close the window, the window closes

4. focus the terminal window (with command-tab, for example)

5. focus the Python app which still exist (with command-tab, for
example), the figure window re-appears (!!) but it is not functional

6. cycle the focus between the windows of the Python app (with
command-`), the figure window will be interactive again

7. try again to close the window (clicking the 'x' or again with
command-w), the window disappears

8. back to 4

I haven't found a way to get rid of the window. The MacOSX backe works
correctly in this respect.

Can someone else on MacOSX confirm the bug?

Where should I start debugging?

Thanks. Best,
Daniele

--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Legend frame edgecolor and linewidth

2015-11-18 Thread Daniele Nicolodi
Hello,

after looking at the code I found that there are two settings that are
not documented (they are not in the template matplotlibrc) that control
the legend frame: "legend.edgecolor" and "legend.facecolor".

The first is enough for my needs, however I think it would be nice to
add the possibility to control the frame linewidth. I have a small patch
that add a "legend.linewidth" setting that defaults to "inherit",
meaning that the legend frame has the same width of the axes. The
setting name is not the most intuitive, but it is coherent with the
existing "legend.edgecolor" and "legend.facecolor".

It would be better to replace "legend.frmaeon" with a boolean setting
"legend.frame and control the frame with "legend.frame.edgecolor",
"legend.frame.facecolor" and "legend.frame.linewidth". But this would
require deprecating the old settings. I can prepare a patch if this is
desired.

Cheers,
Daniele


On 13/11/15 17:08, Benjamin Root wrote:
> Indeed, it looks like there isn't a very good way to control all of the
> properties of the frame portion of a legend. This could certainly use
> some improvements, partly in allowing a dictionary of property values to
> be passed in `plt.legend()` (there is already a dictionary of font
> properties), but also to have some rcParams that could be made
> available, too. Such improvements are always welcome!
> 
> Cheers!
> Ben Root
> 
> On Fri, Nov 13, 2015 at 7:57 AM, Daniele Nicolodi  > wrote:
> 
> Hello,
> 
> there is a way to control the edgecolor and the linewidth of the frame
> drawn around the legend?  I set the axes linewidth to 0.5 but the legend
> frame linewidth is set to 1.0 and it does not look nice. Also, most of
> the time I don't want the frame edge to be drawn at all.
> 
> Always doing:
> 
>   l = plt.legend()
>   l.get_frame().set_edgecolor('none')
> 
> is boring.
> 
> If the setting are not there, would a patch adding a setting to style
> the legend frame be considered? Additionally, would it make sense to
> default the legend frame linewidth to the axes linewidth?
> 
> Cheers,
> Daniele
> 
> 
> --
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> 
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 


--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users