xraylarch
xraylarch copied to clipboard
error in plot_chifit: PyNoAppError: The wx.App object must be created first!
Dear @newville
I have been trying to use python (in Spyder) for path fitting. I just encountered a new (it worked yesterday) error that I could not see the plots of fitting results, but the fitting itself worked out with a ".out" file:
"
File "C:\ProgramData\xrayLarch\lib\site-packages\larch\wxlib\xafsplots.py", line 683, in plot_chifit _plot(dataset.data.k, data_chik+offset, xmin=kmin, xmax=kmax,
File "C:\ProgramData\xrayLarch\lib\site-packages\larch\wxlib\plotter.py", line 486, in _plot plotter = _getDisplay(wxparent=wxparent, win=win, size=size,
File "C:\ProgramData\xrayLarch\lib\site-packages\larch\wxlib\plotter.py", line 339, in _getDisplay display, isnew = _get_disp(symname, creator, win, display_dict, wxparent,
File "C:\ProgramData\xrayLarch\lib\site-packages\larch\wxlib\plotter.py", line 327, in _get_disp display = creator(window=win, wxparent=wxparent,
File "C:\ProgramData\xrayLarch\lib\site-packages\larch\wxlib\plotter.py", line 114, in init PlotFrame.init(self, parent=None, size=size,
File "C:\ProgramData\xrayLarch\lib\site-packages\wxmplot\plotframe.py", line 18, in init BaseFrame.init(self, parent=parent, title=title,
File "C:\ProgramData\xrayLarch\lib\site-packages\wxmplot\baseframe.py", line 58, in init wx.Frame.init(self, parent, -1, title, **kws)
PyNoAppError: The wx.App object must be created first!"
Could you please help me with this?
Thank you in advance,
Best regards
@duoduoss Yes, the current plotting requires wxPython to be installed. I have not tried using that from within Spyder, but I'm not too surprised that it doesn't work very well from within a Qt environment.
@duoduoss I am closing this issue because it was already replied by @newville. You cannot use the standard plotting of Larch inside a Qt environment. Please, use larch.plot.plotly_xafsplots
module instead.