You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature request: Adding XClass property to interactively created figures #6743
I need your help. I would like to have the window manager to, well, manage the plots, I am creating interactively during an ipython session. When I create a plot:
from numpy import arange
import matplotlib
matplotlib.use('Qt5Agg')
import matplotlib.pyplot as pt
pt.ion()
x = arange(-10,10,step=.1)
pt.plot(x, x**2)
And check for the window properties, I get nothing.
% xprop | grep CLASS
WM_CLASS(STRING) = " ", " "
Is it possible to configure matplotlib to add some X-window properties to its plots?
Well, that's because in your case IPython is setting up the QApplication, not matplotlib. Can you try without IPython?
matplotlib could use setApplicationName to update the QApp's WM_CLASS, but I think it should not (because in general, matplotlib could just be embedded in some other application that does not want WM_CLASS to be fiddled with).
So I'd say the issue (if any) should be reported to IPython.
@tacaswell The hope was to use Awesome both at xpd and on my local to place the various windows where they needed to go at instantiation time. What is the best way to access the QApplication and such for an individual plot?
We (IPython) create the QApplication at a point where we don't know that it's for matplotlib, so we can't set the application name to be matplotlib at that point. But if you can find the right place to put it in our code, a PR would be welcome.
@CJ-Wright The QApplication is a process singleton, QApplication.instance() will either return the singleton or None.
Please do not install Awesome on the beamline. If you are going to fill a screen with a fixed set of plots you are probably better off building a Qt Application with embeds all of your plots. That way you only have to maximize it reliably.
Activity
tacaswell commentedon Jul 15, 2016
I would also love to be able to do this. Any help sorting out how to do this through the GUI toolkits would be great!
CJ-Wright commentedon Jan 10, 2018
I'd very much like this as well!
anntzer commentedon Jan 10, 2018
Is this not closed by #8394 (i.e. mpl2.1)? (see also #4746 (comment))
Feel free to request a reopen if I missed something...
CJ-Wright commentedon Jan 10, 2018
I still get
when running
with matplotlib installed from conda-forge
anntzer commentedon Jan 10, 2018
Well, that's because in your case IPython is setting up the QApplication, not matplotlib. Can you try without IPython?
matplotlib could use setApplicationName to update the QApp's WM_CLASS, but I think it should not (because in general, matplotlib could just be embedded in some other application that does not want WM_CLASS to be fiddled with).
So I'd say the issue (if any) should be reported to IPython.
CJ-Wright commentedon Jan 10, 2018
Without IPython it does work. Would it be possible to have this be settable somewhere?
anntzer commentedon Jan 10, 2018
It's just a matter of calling QApplication.instance().setApplicationName(...). Again I think this should be IPython's job, because they own the QApp.
tacaswell commentedon Jan 11, 2018
@CJ-Wright you can also do that call and set it to what ever you want (such as xpdacq ;) )
attn @Carreau can we do this on the IPython side?
CJ-Wright commentedon Jan 11, 2018
@tacaswell The hope was to use Awesome both at xpd and on my local to place the various windows where they needed to go at instantiation time. What is the best way to access the
QApplicationand such for an individual plot?takluyver commentedon Jan 11, 2018
We (IPython) create the QApplication at a point where we don't know that it's for matplotlib, so we can't set the application name to be matplotlib at that point. But if you can find the right place to put it in our code, a PR would be welcome.
tacaswell commentedon Jan 11, 2018
@CJ-Wright The QApplication is a process singleton,
QApplication.instance()will either return the singleton orNone.Please do not install Awesome on the beamline. If you are going to fill a screen with a fixed set of plots you are probably better off building a Qt Application with embeds all of your plots. That way you only have to maximize it reliably.
anntzer commentedon May 9, 2018
Closing, as "not a matplotlib issue" (IMO) per the discussion above.