Ignore:
Timestamp:
Feb 8, 2012 4:35:53 PM (12 years ago)
Author:
Jae Cho <jhjcho@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
9fafa39
Parents:
08648c0
Message:

trying to fix a 3d plot problem with mac

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plottools/src/danse/common/plottools/PlotPanel.py

    r89441d1 r1b023334  
    2121from binder import BindArtist 
    2222from matplotlib.font_manager import FontProperties 
    23  
     23try: 
     24    from mpl_toolkits.mplot3d import Axes3D 
     25    PLOT_3D_ON = True 
     26except: 
     27    PLOT_3D_ON = False 
    2428#from matplotlib import cm 
    2529#from matplotlib.ticker import LinearLocator, FixedLocator, FormatStrFormatter 
     
    15021506            try: 
    15031507                # mpl >= 1.0.0 
    1504                 ax = self.subplot.figure.gca(projection='3d') 
     1508                fig = self.subplot.figure 
     1509                cbax = fig.add_axes([0.84,0.1,0.02,0.8]) 
     1510                ax = fig.gca(projection='3d') 
    15051511                #ax.disable_mouse_rotation() 
    1506                 cbax = self.subplot.figure.add_axes([0.84,0.1,0.02,0.8]) 
    15071512                if len(X) > 60: 
    15081513                    ax.disable_mouse_rotation() 
    15091514            except: 
    15101515                # mpl < 1.0.0 
    1511                 try: 
    1512                     from mpl_toolkits.mplot3d import Axes3D 
    1513                 except: 
    1514                     logging.error("PlotPanel could not import Axes3D") 
    1515                 ax =  Axes3D(self.subplot.figure) 
    1516                 if len(X) > 60: 
    1517                     ax.cla() 
    1518                 cbax = None 
     1516                if PLOT_3D_ON: 
     1517                    ax =  Axes3D(self.subplot.figure) 
     1518                    if len(X) > 60: 
     1519                        ax.cla() 
     1520                    cbax = None 
     1521                else: 
     1522                    raise 
    15191523             
    15201524            im = ax.plot_surface(X, Y, output, rstride=1, cstride=1, cmap=cmap, 
Note: See TracChangeset for help on using the changeset viewer.