|
83 | 83 | plotOpt['lineWid'] = '1' |
84 | 84 | plotOpt['saveCSV'] = False |
85 | 85 | plotOpt['CSVfile'] = None |
| 86 | +plotOpt['GroupedX'] = False |
86 | 87 | for xy in 'x','y': |
87 | 88 | for minmax in 'min','max': |
88 | 89 | key = f'{xy}{minmax}' |
@@ -224,6 +225,10 @@ def OnPlotKeyPress(event): |
224 | 225 | Page.plotStyle['title'] = not Page.plotStyle.get('title',True) |
225 | 226 | elif event.key == 'f' and 'PWDR' in plottype: # short or full length tick-marks |
226 | 227 | Page.plotStyle['flTicks'] = not Page.plotStyle.get('flTicks',False) |
| 228 | + elif event.key == 'x'and groupName is not None: |
| 229 | + plotOpt['GroupedX'] = not plotOpt['GroupedX'] |
| 230 | + if not plotOpt['GroupedX']: # reset scale |
| 231 | + newPlot = True |
227 | 232 | elif event.key == 'x'and 'PWDR' in plottype: |
228 | 233 | Page.plotStyle['exclude'] = not Page.plotStyle['exclude'] |
229 | 234 | elif event.key == '.': |
@@ -2014,7 +2019,8 @@ def onPartialConfig(event): |
2014 | 2019 | Page.Choice = [' key press', |
2015 | 2020 | 'f: toggle full-length ticks','g: toggle grid', |
2016 | 2021 | 's: toggle sqrt plot', |
2017 | | - 'q: toggle Q plot','t: toggle d-spacing plot'] |
| 2022 | + 'q: toggle Q plot','t: toggle d-spacing plot', |
| 2023 | + 'x: share x-axes'] |
2018 | 2024 | Plot.set_visible(False) # removes "big" plot |
2019 | 2025 | gXmin = {} |
2020 | 2026 | gXmax = {} |
@@ -2072,8 +2078,11 @@ def onPartialConfig(event): |
2072 | 2078 | # apportion axes lengths so that units are equal |
2073 | 2079 | xfrac = [(gXmax[i]-gXmin[i])/totalrange for i in range(nx)] |
2074 | 2080 | GS_kw = {'height_ratios':[4, 1], 'width_ratios':xfrac,} |
2075 | | - |
2076 | | - Plots = Page.figure.subplots(2,nx,sharey='row',sharex='col', |
| 2081 | + if plotOpt['GroupedX']: |
| 2082 | + Plots = Page.figure.subplots(2,nx,sharey='row',sharex=True, |
| 2083 | + gridspec_kw=GS_kw) |
| 2084 | + else: |
| 2085 | + Plots = Page.figure.subplots(2,nx,sharey='row',sharex='col', |
2077 | 2086 | gridspec_kw=GS_kw) |
2078 | 2087 | Page.figure.subplots_adjust(left=5/100.,bottom=16/150., |
2079 | 2088 | right=.99,top=1.-3/200.,hspace=0,wspace=0) |
|
0 commit comments