- Timestamp:
- Oct 16, 2008 5:15:01 PM (16 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:
- caa1226
- Parents:
- 4ddf1067
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/local_perspectives/plotting/plotting.py
r7764b41 rfdb0f8b 361 361 """ 362 362 #TODO: Check for existence of plot attribute 363 364 363 # Check whether this is a replot. If we ask for a replot 365 364 # and the plottable no longer exists, ignore the event. … … 367 366 and event.plot.name not in self.plots.keys(): 368 367 return 369 370 368 if hasattr(event, "reset"): 371 369 self._reset() 372 373 370 is_new = True 374 371 if event.plot.name in self.plots.keys(): … … 378 375 else: 379 376 is_new = False 380 381 if is_new: 382 self.plots[event.plot.name] = event.plot 383 self.graph.add(self.plots[event.plot.name]) 384 else: 385 self.plots[event.plot.name].x = event.plot.x 386 self.plots[event.plot.name].y = event.plot.y 387 self.plots[event.plot.name].dy = event.plot.dy 388 if hasattr(event.plot, 'dx') and hasattr(self.plots[event.plot.name], 'dx'): 389 self.plots[event.plot.name].dx = event.plot.dx 390 391 377 self.plots[event.plot.name] = event.plot 378 #if is_new: 379 self.graph.add(self.plots[event.plot.name]) 380 381 392 382 # Check axis labels 393 383 #TODO: Should re-factor this 394 384 #if event.plot._xunit != self.graph.prop["xunit"]: 385 395 386 self.graph.xaxis(event.plot._xaxis, event.plot._xunit) 396 397 387 #if event.plot._yunit != self.graph.prop["yunit"]: 398 388 self.graph.yaxis(event.plot._yaxis, event.plot._yunit) 399 400 401 389 self.graph.render(self) 402 390 self.subplot.figure.canvas.draw_idle() … … 414 402 415 403 # Option to save the data displayed 416 417 404 418 405 # Various plot options 419 406 id = wx.NewId() … … 435 422 436 423 slicerpop.AppendSeparator() 437 438 424 439 425 id = wx.NewId() 440 426 slicerpop.Append(id, '&Toggle Linear/Log scale') 441 wx.EVT_MENU(self, id, self._onToggleScale)427 wx.EVT_MENU(self, id, self._onToggleScale) 442 428 443 429 pos = event.GetPosition() … … 445 431 self.PopupMenu(slicerpop, pos) 446 432 447 448 433 def _onToggleScale(self, event): 434 """ 435 toggle axis and replot image 436 """ 437 if self.scale == 'log': 438 self.scale = 'linear' 439 else: 440 self.scale = 'log' 441 self.image(self.data,self.xmin_2D,self.xmax_2D,self.ymin_2D, 442 self.ymax_2D,self.zmin_2D ,self.zmax_2D ) 443 449 444 450 445 class Plugin:
Note: See TracChangeset
for help on using the changeset viewer.