Changeset 7434020 in sasview for plottools/src/danse/common
- Timestamp:
- Jan 17, 2012 3:07:33 PM (13 years ago)
- 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:
- 4e65505
- Parents:
- f706e09c
- Location:
- plottools/src/danse/common/plottools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
plottools/src/danse/common/plottools/PlotPanel.py
rf80236f r7434020 21 21 from binder import BindArtist 22 22 from matplotlib.font_manager import FontProperties 23 24 from mpl_toolkits.mplot3d import Axes3D 25 #from matplotlib import cm 26 #from matplotlib.ticker import LinearLocator, FixedLocator, FormatStrFormatter 23 27 24 28 DEBUG = False … … 119 123 wx.Panel.__init__(self, parent, id=id, **kwargs) 120 124 self.parent = parent 125 self.dimension = 1 121 126 self.gotLegend = 0 #to begin, legend is not picked. 122 127 self.legend_pos_loc = None … … 1427 1432 1428 1433 """ 1429 #Re-adjust colorbar1430 self.figure.subplots_adjust(left=0.2, right=.8, bottom=.2)1431 1434 self.data = data 1432 1435 self.qx_data = qx_data … … 1470 1473 zmin_temp = self.zmin_2D 1471 1474 self.cmap = cmap 1472 im = self.subplot.imshow(output, interpolation='nearest', 1473 origin='lower', 1474 vmin=zmin_temp, vmax=self.zmax_2D, 1475 cmap=self.cmap, 1476 extent=(self.xmin_2D, self.xmax_2D, 1477 self.ymin_2D, self.ymax_2D)) 1478 1479 #Add color bar and its label 1480 #TODO: make the size and location interactive to the image plot. 1481 cbax = self.subplot.figure.add_axes([0.84,0.2,0.02,0.7]) 1482 cb = self.subplot.figure.colorbar(im, cax=cbax) 1475 if self.dimension != 3: 1476 #Re-adjust colorbar 1477 self.subplot.figure.subplots_adjust(left=0.2, right=.8, bottom=.2) 1478 1479 im = self.subplot.imshow(output, interpolation='nearest', 1480 origin='lower', 1481 vmin=zmin_temp, vmax=self.zmax_2D, 1482 cmap=self.cmap, 1483 extent=(self.xmin_2D, self.xmax_2D, 1484 self.ymin_2D, self.ymax_2D)) 1485 cbax = self.subplot.figure.add_axes([0.84,0.2,0.02,0.7]) 1486 else: 1487 # clear the previous 2D from memory 1488 self.subplot.figure.clf() 1489 self.subplot.figure.subplots_adjust(left=0.1, right=.8, bottom=.1) 1490 try: 1491 # mpl >= 1.0.0 1492 ax = self.subplot.figure.gca(projection='3d') 1493 #ax.disable_mouse_rotation() 1494 cbax = self.subplot.figure.add_axes([0.84,0.1,0.02,0.8]) 1495 except: 1496 # mpl < 1.0.0 1497 ax = Axes3D(self.subplot.figure) 1498 cbax = None 1499 1500 X = self.x_bins[0:-1] 1501 Y = self.y_bins[0:-1] 1502 X, Y = numpy.meshgrid(X, Y) 1503 1504 im = ax.plot_surface(X, Y, output, rstride=1, cstride=1, cmap=cmap, 1505 linewidth=0, antialiased=False) 1506 #ax.set_zlim3d(zmin_temp, self.zmax_2D) 1507 #ax.set_frame_on(False) 1508 self.subplot.set_axis_off() 1509 1510 if cbax == None: 1511 cb =self.subplot.figure.colorbar(im, shrink=0.6, aspect=20) 1512 else: 1513 cb =self.subplot.figure.colorbar(im, cax=cbax) 1483 1514 cb.update_bruteforce(im) 1484 1515 cb.set_label(self.scale) 1485 self.subplot.figure.canvas.draw_idle() 1516 1517 #if self.dimension != 3: 1518 self.figure.canvas.draw_idle() 1486 1519 1487 1520 def _build_matrix(self): -
plottools/src/danse/common/plottools/canvas.py
r0e553fd r7434020 250 250 251 251 """ 252 if sys.platform == 'linux2' :252 if sys.platform == 'linux2' or self.panel.dimension == 3: 253 253 evt.Skip() 254 254 else:
Note: See TracChangeset
for help on using the changeset viewer.