Changeset 4543


Ignore:
Timestamp:
Aug 17, 2020 9:13:26 AM (3 years ago)
Author:
vondreele
Message:

test change G2plot for mpl 3.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r4541 r4543  
    331331            return self.canvas.SetToolTipString(text)
    332332       
     333    def ToolBarDraw(self):
     334        try:
     335            self.toolbar.draw()
     336        except:
     337            self.toolbar.draw_idle()
     338       
    333339class G2PlotOgl(_tabPlotWin):
    334340    'Creates an OpenGL plot in the GSAS-II graphics window'
     
    375381        else:
    376382            self.canvas.SetToolTipString(text)
     383           
     384    def ToolBarDraw(self):
     385        mplv = eval(mpl.__version__.replace('.',','))
     386        if mplv[0] >= 3 and mplv[1] >= 3:
     387            self.toolbar.draw_idle()
     388        else:
     389            self.toolbar.draw()
    377390       
    378391class G2PlotNoteBook(wx.Panel):
     
    546559        page = G2Plot3D(self.nb)
    547560        self._addPage(name,page)
    548         mplv = mpl.__version__.split('.')
    549         if mplv[0] == '3' and (mplv[1] == '1' or mplv[1] == '2') and not self.MPLwarn: # patch for bad MPL 3D
    550             self.MPLwarn = True
    551             G2G.G2MessageBox(self,'3D plots with Matplotlib 3.1.x and 3.2.x are distorted, we suggest regressing to MPL 3.0.3 until 3.3.x or later is available.. You have '+mpl.__version__,
    552                                  'Avoid Matplotlib 3.1 & 3.2')
     561        mplv = eval(mpl.__version__.replace('.',','))
     562        if mplv[0] == 3:
     563            if mplv[1] >= 3:
     564                page.set_box_aspect((1,1,1))
     565            elif not self.MPLwarn: # patch for bad MPL 3D
     566                self.MPLwarn = True
     567                G2G.G2MessageBox(self,'3D plots with Matplotlib 3.1.x and 3.2.x are distorted, use MPL 3.0.3 or 3.3. You have '+mpl.__version__,
     568                                     'Avoid Matplotlib 3.1 & 3.2')       
    553569        return page.figure
    554570       
     
    733749        #print xmin,xmax,ymin,ymax
    734750        self.plotCanvas.figure.canvas.draw()
    735         self.parent.toolbar.draw()
     751        self.parent.ToolBarDraw()
    736752#        self.parent.toolbar.push_current()
    737753        if self.updateActions:
     
    10621078#        xylim = []
    10631079        Page.toolbar.push_current()
    1064         Page.toolbar.draw()
     1080        Page.ToolBarDraw()
    10651081    else:
    10661082        Plot.set_xlim((HKLmin[pzone[izone][0]],HKLmax[pzone[izone][0]]))
     
    11661182            xylim = []
    11671183            Page.toolbar.push_current()
    1168             Page.toolbar.draw()
     1184            Page.ToolBarDraw()
    11691185            Page.canvas.draw()
    11701186        else:
     
    33493365        Plot.set_ylim(G2frame.xylim[1])
    33503366        Page.toolbar.push_current()
    3351         Page.toolbar.draw()
     3367        Page.ToolBarDraw()
    33523368    else:
    33533369        G2frame.xylim = Plot.get_xlim(),Plot.get_ylim()
     
    47404756        xylim = []
    47414757        Page.toolbar.push_current()
    4742         Page.toolbar.draw()
     4758        Page.ToolBarDraw()
    47434759    else:
    47444760        Page.canvas.draw()
     
    48284844#        xylim = []
    48294845        Page.toolbar.push_current()
    4830         Page.toolbar.draw()
     4846        Page.ToolBarDraw()
    48314847    else:
    48324848        Page.canvas.draw()
     
    49344950            xylim = []
    49354951            Page.toolbar.push_current()
    4936             Page.toolbar.draw()
     4952            Page.ToolBarDraw()
    49374953            Page.canvas.draw()
    49384954        else:
     
    50825098        xylim = []
    50835099        Page.toolbar.push_current()
    5084         Page.toolbar.draw()
     5100        Page.ToolBarDraw()
    50855101    else:
    50865102        Page.canvas.draw()
     
    52945310        xylim = []
    52955311        Page.toolbar.push_current()
    5296         Page.toolbar.draw()
     5312        Page.ToolBarDraw()
    52975313    else:
    52985314        Page.canvas.draw()
     
    57015717        Plot.set_ylim(xylim[1])
    57025718        Page.toolbar.push_current()
    5703         Page.toolbar.draw()
     5719        Page.ToolBarDraw()
    57045720    else:
    57055721        Page.canvas.draw()
     
    59755991        try:
    59765992            CS = Plot.contour(Y,X,Z)
    5977 #            CS = Plot.contour(Y,X,Z,aspect='equal')
    59785993            Plot.clabel(CS,fontsize=9,inline=1)
    59795994        except ValueError:
     
    78267841            xylim = []
    78277842            Page.toolbar.push_current()
    7828             Page.toolbar.draw()
     7843            Page.ToolBarDraw()
    78297844            # patch for wx 2.9 on Mac, to force a redraw
    78307845            i,j= wx.__version__.split('.')[0:2]
     
    78877902        xylim = []
    78887903        Page.toolbar.push_current()
    7889         Page.toolbar.draw()
     7904        Page.ToolBarDraw()
    78907905    else:
    78917906        Page.canvas.draw()
     
    79547969        xylim = []
    79557970        Page.toolbar.push_current()
    7956         Page.toolbar.draw()
     7971        Page.ToolBarDraw()
    79577972    else:
    79587973        Page.canvas.draw()
     
    1054110556    Plot.set_xlim((ttmin,ttmax))
    1054210557    Page.toolbar.push_current()
    10543     Page.toolbar.draw()
     10558    Page.ToolBarDraw()
    1054410559    Page.canvas.draw()
    1054510560
Note: See TracChangeset for help on using the changeset viewer.