Changeset 3968 for trunk/fprime.py


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

add grid control to absorb & fprime

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/fprime.py

    r3967 r3968  
    1010import numpy as np
    1111import sys
     12import matplotlib as mpl
    1213import GSASIIpath
    1314GSASIIpath.SetVersionNumber("$Revision: 3765 $")
     
    325326        self.SetWaveEnergy(Wave)
    326327       
     328    def OnKeyPress(self,event):
     329        if event.key == 'g':
     330            mpl.rcParams['axes.grid'] = not mpl.rcParams['axes.grid']
     331            self.SetWaveEnergy(self.Wave)           
     332
    327333    def UpDateFPlot(self,Wave,rePlot=True):
    328334        """Plot f' & f" vs wavelength 0.05-3.0A"""
     
    341347            self.Page.canvas.mpl_connect('button_release_event', self.OnRelease)
    342348            self.Page.canvas.mpl_connect('motion_notify_event', self.OnMotion)
     349            self.Page.canvas.mpl_connect('key_press_event', self.OnKeyPress)
    343350            newPlot = True
     351        self.Page.Choice = (' key press','g: toggle grid',)
     352        self.Page.keyPress = self.OnKeyPress   
    344353        self.fplot.set_visible(False)
    345354        ax = self.Page.figure.add_subplot(211)
Note: See TracChangeset for help on using the changeset viewer.