Changeset 3968 for trunk/Absorb.py


Ignore:
Timestamp:
May 11, 2019 1:05:52 PM (3 years ago)
Author:
vondreele
Message:

add grid control to absorb & fprime

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Absorb.py

    r3967 r3968  
    1010import numpy as np
    1111import sys
     12import matplotlib as mpl
    1213import GSASIIpath
    1314GSASIIpath.SetVersionNumber("$Revision: 3765 $")
     
    570571        self.UpDateAbsPlot(self.Wave,rePlot=False)
    571572       
     573    def OnKeyPress(self,event):
     574        if event.key == 'g':
     575            mpl.rcParams['axes.grid'] = not mpl.rcParams['axes.grid']
     576            self.UpDateAbsPlot(self.Wave,rePlot=False)
     577
    572578    def UpDateAbsPlot(self,Wave,rePlot=True):
    573579        """Plot mu vs wavelength 0.05-3.0A"""
     
    583589            self.Page.canvas.mpl_connect('button_release_event', self.OnRelease)
    584590            self.Page.canvas.mpl_connect('motion_notify_event', self.OnMotion)
     591            self.Page.canvas.mpl_connect('key_press_event', self.OnKeyPress)
    585592            newPlot = True
    586         ax = self.Page.figure.add_subplot(111)
     593            ax = self.Page.figure.add_subplot(111,label='absorb')
     594        self.Page.Choice = (' key press','g: toggle grid',)
     595        self.Page.keyPress = self.OnKeyPress   
    587596        ax.clear()
    588597        ax.set_title('X-Ray Absorption',x=0,ha='left')
Note: See TracChangeset for help on using the changeset viewer.