Skip to content

Commit 3665e51

Browse files
committed
change assignments of Legend & reset keys to L & o after discussion w/RBVD
1 parent 74f60e1 commit 3665e51

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

GSASII/GSASIIpwdplot.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,11 +315,11 @@ def OnPlotKeyPress(event):
315315
Page.plotStyle['Offset'][1] -= 1.
316316
elif event.key == 'r' and not G2frame.SinglePlot:
317317
Page.plotStyle['Offset'][1] += 1.
318-
elif event.key == 'o': # controls caption
318+
elif event.key in ['L','shift+l']: # controls legend
319319
if G2frame.Contour: return
320320
# include the observed, calc,... items in the plot caption (PlotPatterns)
321321
plotOpt['obsInCaption'] = not plotOpt['obsInCaption']
322-
elif event.key in ['O','shift+o']: # resets offsets
322+
elif event.key in ['o','O','shift+o']: # resets offsets
323323
if G2frame.Contour: return
324324
if not G2frame.SinglePlot: # waterfall: reset the offsets
325325
G2frame.Cmax = 1.0
@@ -1330,6 +1330,8 @@ def showChecked(i):
13301330
dbox[i].Enable(checked)
13311331
def applyLims(event):
13321332
Page.toolbar.push_current()
1333+
# Page.toolbar.set_history_buttons() # this may be needed to update the zoom buttons (needs test)
1334+
# Page.canvas.draw_idle() # schedule an MPL update (needs test)
13331335
CurLims = {}
13341336
CurLims['xlims'] = list(Plot.get_xlim())
13351337
if G2frame.Weight:
@@ -1359,6 +1361,8 @@ def applyLims(event):
13591361
else:
13601362
Plot.set_ylim(CurLims['ylims'])
13611363
Page.toolbar.push_current()
1364+
# Page.toolbar.set_history_buttons() # this may be needed to update the zoom buttons (needs test)
1365+
# Page.canvas.draw_idle() # schedule an MPL update (needs test)
13621366
Plot.figure.canvas.draw()
13631367

13641368
# onSetPlotLim starts here
@@ -1843,7 +1847,7 @@ def onPartialConfig(event):
18431847
what = "obs, calc,..."
18441848
else:
18451849
what = "histogram names"
1846-
Page.Choice += [f'o: legend: {addrem} {what} in legend',]
1850+
Page.Choice += [f'L: {addrem} {what} in legend',]
18471851
if ifLimits:
18481852
Page.Choice += ['e: create excluded region',
18491853
's: toggle sqrt plot','w: toggle (Io-Ic)/sig plot',
@@ -1865,7 +1869,7 @@ def onPartialConfig(event):
18651869
if not G2frame.SinglePlot:
18661870
Page.Choice = Page.Choice+ \
18671871
['u/U: offset up/10x','d/D: offset down/10x','l: offset left','r: offset right',
1868-
'O: reset offset','F: select data','/: normalize']
1872+
'o: reset offset','F: select data','/: normalize']
18691873
else:
18701874
Page.Choice = Page.Choice+ ['p: toggle partials (if available)',]
18711875
if G2frame.SinglePlot:
@@ -2829,19 +2833,27 @@ def onPartialConfig(event):
28292833
(xlim, ylim, styleDict, G2frame.SinglePlot, G2frame.Contour, G2frame.Weight,
28302834
G2frame.plusPlot, G2frame.SubBack) = data[0]['PlotDefaults']
28312835
Page.toolbar.push_current()
2836+
# Page.toolbar.set_history_buttons() # this may be needed to update the zoom buttons (needs test)
2837+
# Page.canvas.draw_idle() # schedule an MPL update (needs test)
28322838
Plot.set_xlim((xlim[0],xlim[1]))
28332839
Plot.set_ylim((ylim[0],ylim[1]))
2834-
Page.toolbar.push_current()
2840+
Page.toolbar.push_current() # why two?
2841+
# Page.toolbar.set_history_buttons() # this may be needed to update the zoom buttons (needs test)
2842+
# Page.canvas.draw_idle() # schedule an MPL update (needs test)
28352843
newPlot = True # prevent carrying limits over from other histograms
28362844
if not newPlot:
28372845
# this restores previous plot limits (but I'm not sure why there are two .push_current calls)
28382846
Page.toolbar.push_current()
2847+
# Page.toolbar.set_history_buttons() # this may be needed to update the zoom buttons (needs test)
2848+
# Page.canvas.draw_idle() # schedule an MPL update (needs test)
28392849
if G2frame.Contour: # for contour plots expand y-axis to include all histograms
28402850
G2frame.xylim = (G2frame.xylim[0], (0.,len(PlotList)))
28412851
if 'PWDR' in plottype:
28422852
Plot.set_xlim(G2frame.xylim[0])
28432853
Plot.set_ylim(G2frame.xylim[1])
28442854
Page.toolbar.push_current()
2855+
# Page.toolbar.set_history_buttons() # this may be needed to update the zoom buttons (needs test)
2856+
# Page.canvas.draw_idle() # schedule an MPL update (needs test)
28452857
Page.ToolBarDraw()
28462858
else:
28472859
G2frame.xylim = Plot.get_xlim(),Plot.get_ylim()

0 commit comments

Comments
 (0)