mwxlib 1.3.0__py3-none-any.whl → 1.3.11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mwxlib might be problematic. Click here for more details.
- mwx/bookshelf.py +27 -14
- mwx/controls.py +91 -80
- mwx/framework.py +108 -118
- mwx/graphman.py +17 -16
- mwx/matplot2.py +9 -9
- mwx/matplot2g.py +74 -59
- mwx/matplot2lg.py +6 -6
- mwx/nutshell.py +50 -39
- mwx/plugins/ffmpeg_view.py +1 -1
- mwx/wxpdb.py +7 -7
- {mwxlib-1.3.0.dist-info → mwxlib-1.3.11.dist-info}/METADATA +1 -2
- mwxlib-1.3.11.dist-info/RECORD +28 -0
- {mwxlib-1.3.0.dist-info → mwxlib-1.3.11.dist-info}/WHEEL +1 -1
- mwxlib-1.3.0.dist-info/LICENSE +0 -21
- mwxlib-1.3.0.dist-info/RECORD +0 -29
- {mwxlib-1.3.0.dist-info → mwxlib-1.3.11.dist-info}/top_level.txt +0 -0
mwx/matplot2g.py
CHANGED
|
@@ -206,9 +206,9 @@ class AxesImagePhantom:
|
|
|
206
206
|
cx, cy = self.center
|
|
207
207
|
self.__art.set_extent((cx-w, cx+w, cy-h, cy+h))
|
|
208
208
|
|
|
209
|
-
selector = _Property('
|
|
210
|
-
markers = _Property('
|
|
211
|
-
region = _Property('
|
|
209
|
+
selector = _Property('selector')
|
|
210
|
+
markers = _Property('markers')
|
|
211
|
+
region = _Property('region')
|
|
212
212
|
|
|
213
213
|
artist = property(
|
|
214
214
|
lambda self: self.__art)
|
|
@@ -319,8 +319,8 @@ class AxesImagePhantom:
|
|
|
319
319
|
@property
|
|
320
320
|
def roi(self):
|
|
321
321
|
"""Current buffer ROI (region of interest)."""
|
|
322
|
-
if self.parent.
|
|
323
|
-
nx, ny = self.xytopixel(*self.parent.
|
|
322
|
+
if self.parent.region.size:
|
|
323
|
+
nx, ny = self.xytopixel(*self.parent.region)
|
|
324
324
|
sx = slice(max(0,nx[0]), nx[1]) # nx slice
|
|
325
325
|
sy = slice(max(0,ny[1]), ny[0]) # ny slice 反転 (降順)
|
|
326
326
|
return self.__buf[sy,sx]
|
|
@@ -691,10 +691,14 @@ class GraphPlot(MatplotPanel):
|
|
|
691
691
|
|
|
692
692
|
self.draw()
|
|
693
693
|
self.writeln()
|
|
694
|
-
self.trace_point(*self.
|
|
694
|
+
self.trace_point(*self.selector)
|
|
695
695
|
|
|
696
696
|
return self.frame
|
|
697
697
|
|
|
698
|
+
def __iter__(self):
|
|
699
|
+
for art in self.__Arts:
|
|
700
|
+
yield art.buffer
|
|
701
|
+
|
|
698
702
|
def __getitem__(self, j):
|
|
699
703
|
if isinstance(j, str):
|
|
700
704
|
j = self.index(j)
|
|
@@ -758,19 +762,30 @@ class GraphPlot(MatplotPanel):
|
|
|
758
762
|
def __contains__(self, j):
|
|
759
763
|
if isinstance(j, str):
|
|
760
764
|
return j in (art.name for art in self.__Arts)
|
|
765
|
+
elif isinstance(j, np.ndarray):
|
|
766
|
+
return any(j is art.buffer for art in self.__Arts)
|
|
761
767
|
else:
|
|
762
768
|
return j in self.__Arts
|
|
763
769
|
|
|
764
770
|
def index(self, j):
|
|
765
771
|
if isinstance(j, str):
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
772
|
+
return next(i for i, art in enumerate(self.__Arts) if j == art.name)
|
|
773
|
+
elif isinstance(j, np.ndarray):
|
|
774
|
+
return next(i for i, art in enumerate(self.__Arts) if j is art.buffer)
|
|
775
|
+
else:
|
|
776
|
+
return self.__Arts.index(j) # j:frame -> int
|
|
769
777
|
|
|
770
778
|
def find_frame(self, j):
|
|
771
779
|
if isinstance(j, str):
|
|
772
|
-
return next((art for art in self.__Arts if art.name
|
|
773
|
-
|
|
780
|
+
return next((art for art in self.__Arts if j == art.name), None)
|
|
781
|
+
elif isinstance(j, np.ndarray):
|
|
782
|
+
return next((art for art in self.__Arts if j is art.buffer), None)
|
|
783
|
+
else:
|
|
784
|
+
return self.__Arts[j] # j:int -> frame
|
|
785
|
+
|
|
786
|
+
def get_all_frames(self):
|
|
787
|
+
"""List of arts <matplotlib.image.AxesImage>."""
|
|
788
|
+
return self.__Arts
|
|
774
789
|
|
|
775
790
|
## --------------------------------
|
|
776
791
|
## Property of frame / drawer
|
|
@@ -780,10 +795,10 @@ class GraphPlot(MatplotPanel):
|
|
|
780
795
|
nbytes_threshold = 24e6
|
|
781
796
|
|
|
782
797
|
#: image cutoff score percentiles
|
|
783
|
-
score_percentile = 0.
|
|
798
|
+
score_percentile = 0.005
|
|
784
799
|
|
|
785
800
|
@property
|
|
786
|
-
def all_frames(self):
|
|
801
|
+
def all_frames(self): # (deprecated) for backward compatibility
|
|
787
802
|
"""List of arts <matplotlib.image.AxesImage>."""
|
|
788
803
|
return self.__Arts
|
|
789
804
|
|
|
@@ -872,7 +887,7 @@ class GraphPlot(MatplotPanel):
|
|
|
872
887
|
if self.frame:
|
|
873
888
|
self.handler('frame_selected', self.frame)
|
|
874
889
|
self.on_picker_unlock(evt)
|
|
875
|
-
self.trace_point(*self.
|
|
890
|
+
self.trace_point(*self.selector)
|
|
876
891
|
|
|
877
892
|
def on_focus_kill(self, evt):
|
|
878
893
|
"""Called when focus is killed (override)."""
|
|
@@ -910,10 +925,10 @@ class GraphPlot(MatplotPanel):
|
|
|
910
925
|
if len(x) == 0: # no selection
|
|
911
926
|
return
|
|
912
927
|
|
|
913
|
-
if len(x) == 1: # 1-
|
|
928
|
+
if len(x) == 1: # 1-selector trace point (called from Marker:setter)
|
|
914
929
|
return self.trace_point(x[0], y[0], type)
|
|
915
930
|
|
|
916
|
-
if len(x) == 2: # 2-
|
|
931
|
+
if len(x) == 2: # 2-selector trace line (called from selector:setter)
|
|
917
932
|
nx, ny = frame.xytopixel(x, y)
|
|
918
933
|
dx = x[1] - x[0]
|
|
919
934
|
dy = y[1] - y[0]
|
|
@@ -922,7 +937,7 @@ class GraphPlot(MatplotPanel):
|
|
|
922
937
|
li = np.hypot(nx[1]-nx[0], ny[1]-ny[0])
|
|
923
938
|
self.message(f"[Line] Length: {li:.1f} pixel ({lu:g}u) Angle: {a:.1f} deg")
|
|
924
939
|
|
|
925
|
-
elif type == REGION: # N-
|
|
940
|
+
elif type == REGION: # N-selector trace polygon (called from region:setter)
|
|
926
941
|
nx, ny = frame.xytopixel(x, y)
|
|
927
942
|
xo, yo = min(nx), min(ny) # top-left
|
|
928
943
|
xr, yr = max(nx), max(ny) # bottom-right
|
|
@@ -1055,7 +1070,7 @@ class GraphPlot(MatplotPanel):
|
|
|
1055
1070
|
self.handler('region_picked', evt)
|
|
1056
1071
|
|
|
1057
1072
|
elif evt.artist is self.selected:
|
|
1058
|
-
if (self.
|
|
1073
|
+
if (self.selector.shape[1] < 2 # single selector
|
|
1059
1074
|
or wx.GetKeyState(wx.WXK_SHIFT)): # or polygon mode
|
|
1060
1075
|
return
|
|
1061
1076
|
self.__isPicked = 'line' # image pick gurad
|
|
@@ -1078,7 +1093,7 @@ class GraphPlot(MatplotPanel):
|
|
|
1078
1093
|
nx, ny = self.frame.xytopixel(x, y)
|
|
1079
1094
|
x, y = self.frame.xyfrompixel(nx, ny)
|
|
1080
1095
|
evt.ind = (ny, nx)
|
|
1081
|
-
self.
|
|
1096
|
+
self.selector = (x, y)
|
|
1082
1097
|
|
|
1083
1098
|
def _inaxes(self, evt):
|
|
1084
1099
|
try:
|
|
@@ -1111,7 +1126,7 @@ class GraphPlot(MatplotPanel):
|
|
|
1111
1126
|
|
|
1112
1127
|
def OnMotion(self, evt):
|
|
1113
1128
|
"""Called when mouse moves in axes (overridden)."""
|
|
1114
|
-
if self.
|
|
1129
|
+
if self.selector.shape[1] < 2:
|
|
1115
1130
|
self.trace_point(evt.xdata, evt.ydata)
|
|
1116
1131
|
|
|
1117
1132
|
def OnPageDown(self, evt):
|
|
@@ -1130,8 +1145,8 @@ class GraphPlot(MatplotPanel):
|
|
|
1130
1145
|
self.fit_to_axes()
|
|
1131
1146
|
|
|
1132
1147
|
def OnEscapeSelection(self, evt):
|
|
1133
|
-
xs, ys = self.
|
|
1134
|
-
del self.
|
|
1148
|
+
xs, ys = self.selector
|
|
1149
|
+
del self.selector
|
|
1135
1150
|
if len(xs) > 1:
|
|
1136
1151
|
self.handler('line_removed', self.frame)
|
|
1137
1152
|
|
|
@@ -1201,9 +1216,9 @@ class GraphPlot(MatplotPanel):
|
|
|
1201
1216
|
return self.calc_point(x, y, centred)
|
|
1202
1217
|
|
|
1203
1218
|
def OnSelectorAppend(self, evt):
|
|
1204
|
-
xs, ys = self.
|
|
1219
|
+
xs, ys = self.selector
|
|
1205
1220
|
x, y = self.calc_point(evt.xdata, evt.ydata)
|
|
1206
|
-
self.
|
|
1221
|
+
self.selector = np.append(xs, x), np.append(ys, y)
|
|
1207
1222
|
self.handler('line_drawn', self.frame)
|
|
1208
1223
|
|
|
1209
1224
|
def OnDragLock(self, evt):
|
|
@@ -1215,28 +1230,28 @@ class GraphPlot(MatplotPanel):
|
|
|
1215
1230
|
return
|
|
1216
1231
|
org = self.p_event # the last pressed
|
|
1217
1232
|
self.__lastpoint = self.calc_point(org.xdata, org.ydata)
|
|
1218
|
-
self.__orgpoints = self.
|
|
1233
|
+
self.__orgpoints = self.selector
|
|
1219
1234
|
|
|
1220
1235
|
def OnDragMove(self, evt, shift=False):
|
|
1221
1236
|
x, y = self.calc_point(evt.xdata, evt.ydata)
|
|
1222
1237
|
xo, yo = self.__lastpoint
|
|
1223
1238
|
if shift:
|
|
1224
1239
|
x, y = self.calc_shiftpoint(xo, yo, x, y)
|
|
1225
|
-
self.
|
|
1240
|
+
self.selector = np.append(xo, x), np.append(yo, y)
|
|
1226
1241
|
self.handler('line_draw', self.frame)
|
|
1227
1242
|
|
|
1228
1243
|
def OnDragShiftMove(self, evt):
|
|
1229
1244
|
self.OnDragMove(evt, shift=True)
|
|
1230
1245
|
|
|
1231
1246
|
def OnDragEscape(self, evt):
|
|
1232
|
-
self.
|
|
1247
|
+
self.selector = self.__orgpoints
|
|
1233
1248
|
self.handler('line_draw', self.frame)
|
|
1234
1249
|
|
|
1235
1250
|
def OnDragEnd(self, evt):
|
|
1236
1251
|
x, y = self.calc_point(evt.xdata, evt.ydata)
|
|
1237
1252
|
xo, yo = self.__lastpoint
|
|
1238
1253
|
if x == xo and y == yo:
|
|
1239
|
-
self.
|
|
1254
|
+
self.selector = ([x], [y])
|
|
1240
1255
|
self.handler('line_drawn', self.frame)
|
|
1241
1256
|
|
|
1242
1257
|
## --------------------------------
|
|
@@ -1260,7 +1275,7 @@ class GraphPlot(MatplotPanel):
|
|
|
1260
1275
|
return
|
|
1261
1276
|
org = self.p_event # the last pressed
|
|
1262
1277
|
self.__lastpoint = self.calc_point(org.xdata, org.ydata)
|
|
1263
|
-
self.__orgpoints = self.
|
|
1278
|
+
self.__orgpoints = self.selector
|
|
1264
1279
|
|
|
1265
1280
|
def OnLineDragMove(self, evt, shift=False):
|
|
1266
1281
|
x, y = self.calc_point(evt.xdata, evt.ydata)
|
|
@@ -1272,21 +1287,21 @@ class GraphPlot(MatplotPanel):
|
|
|
1272
1287
|
i = j-1 if j else 1
|
|
1273
1288
|
xo, yo = xo[i], yo[i] # となりの点を基準とする
|
|
1274
1289
|
x, y = self.calc_shiftpoint(xo, yo, x, y)
|
|
1275
|
-
xs, ys = self.
|
|
1290
|
+
xs, ys = self.selector
|
|
1276
1291
|
xs[j], ys[j] = x, y
|
|
1277
|
-
self.
|
|
1292
|
+
self.selector = (xs, ys)
|
|
1278
1293
|
self.handler('line_draw', self.frame)
|
|
1279
1294
|
else:
|
|
1280
1295
|
xs = xo + (x - xc)
|
|
1281
1296
|
ys = yo + (y - yc)
|
|
1282
|
-
self.
|
|
1297
|
+
self.selector = (xs, ys)
|
|
1283
1298
|
self.handler('line_move', self.frame)
|
|
1284
1299
|
|
|
1285
1300
|
def OnLineDragShiftMove(self, evt):
|
|
1286
1301
|
self.OnLineDragMove(evt, shift=True)
|
|
1287
1302
|
|
|
1288
1303
|
def OnLineDragEscape(self, evt):
|
|
1289
|
-
self.
|
|
1304
|
+
self.selector = self.__orgpoints
|
|
1290
1305
|
if self.__linesel:
|
|
1291
1306
|
self.handler('line_drawn', self.frame)
|
|
1292
1307
|
else:
|
|
@@ -1299,7 +1314,7 @@ class GraphPlot(MatplotPanel):
|
|
|
1299
1314
|
self.handler('line_moved', self.frame)
|
|
1300
1315
|
|
|
1301
1316
|
def OnLineShift(self, evt):
|
|
1302
|
-
if self.
|
|
1317
|
+
if self.selector.size and self.frame:
|
|
1303
1318
|
ux, uy = self.frame.xy_unit
|
|
1304
1319
|
du = {
|
|
1305
1320
|
'up' : ( 0., uy),
|
|
@@ -1307,7 +1322,7 @@ class GraphPlot(MatplotPanel):
|
|
|
1307
1322
|
'left' : (-ux, 0.),
|
|
1308
1323
|
'right' : ( ux, 0.),
|
|
1309
1324
|
}
|
|
1310
|
-
self.
|
|
1325
|
+
self.selector += np.resize(du[evt.key], (2,1))
|
|
1311
1326
|
self.handler('line_move', self.frame)
|
|
1312
1327
|
|
|
1313
1328
|
def OnLineShiftEnd(self, evt):
|
|
@@ -1318,7 +1333,7 @@ class GraphPlot(MatplotPanel):
|
|
|
1318
1333
|
## --------------------------------
|
|
1319
1334
|
|
|
1320
1335
|
@property
|
|
1321
|
-
def
|
|
1336
|
+
def region(self):
|
|
1322
1337
|
"""Rectangle points data array [l,r],[b,t]."""
|
|
1323
1338
|
x, y = self.rected.get_data(orig=0)
|
|
1324
1339
|
if len(x) and len(y):
|
|
@@ -1327,16 +1342,16 @@ class GraphPlot(MatplotPanel):
|
|
|
1327
1342
|
return np.array(((xo, x), (yo, y)))
|
|
1328
1343
|
return np.resize(0., (2,0))
|
|
1329
1344
|
|
|
1330
|
-
@
|
|
1331
|
-
def
|
|
1345
|
+
@region.setter
|
|
1346
|
+
def region(self, v):
|
|
1332
1347
|
x, y = v
|
|
1333
1348
|
if len(x) > 1:
|
|
1334
1349
|
self.set_current_rect(x, y)
|
|
1335
1350
|
self.handler('region_drawn', self.frame)
|
|
1336
1351
|
|
|
1337
|
-
@
|
|
1338
|
-
def
|
|
1339
|
-
if self.
|
|
1352
|
+
@region.deleter
|
|
1353
|
+
def region(self):
|
|
1354
|
+
if self.region.size:
|
|
1340
1355
|
self.del_current_rect()
|
|
1341
1356
|
self.handler('region_removed', self.frame)
|
|
1342
1357
|
|
|
@@ -1396,7 +1411,7 @@ class GraphPlot(MatplotPanel):
|
|
|
1396
1411
|
self.draw(self.rected)
|
|
1397
1412
|
|
|
1398
1413
|
def OnRegionAppend(self, evt):
|
|
1399
|
-
xs, ys = self.
|
|
1414
|
+
xs, ys = self.selector
|
|
1400
1415
|
if len(xs) > 0 and self.frame:
|
|
1401
1416
|
ux, uy = self.frame.xy_unit
|
|
1402
1417
|
xs = (xs.min()-ux/2, xs.max()+ux/2)
|
|
@@ -1502,8 +1517,8 @@ class GraphPlot(MatplotPanel):
|
|
|
1502
1517
|
|
|
1503
1518
|
def OnRegionMotion(self, evt):
|
|
1504
1519
|
x, y = evt.xdata, evt.ydata
|
|
1505
|
-
if self.
|
|
1506
|
-
(l,r), (b,t) = self.
|
|
1520
|
+
if self.region.size:
|
|
1521
|
+
(l,r), (b,t) = self.region
|
|
1507
1522
|
d = self.rected.pickradius / self.ddpu[0]
|
|
1508
1523
|
x0 = l+d < x < r-d
|
|
1509
1524
|
y0 = b+d < y < t-d
|
|
@@ -1528,20 +1543,20 @@ class GraphPlot(MatplotPanel):
|
|
|
1528
1543
|
self.set_wxcursor(wx.CURSOR_ARROW) # outside
|
|
1529
1544
|
|
|
1530
1545
|
## --------------------------------
|
|
1531
|
-
##
|
|
1546
|
+
## Marker interface
|
|
1532
1547
|
## --------------------------------
|
|
1533
1548
|
|
|
1534
1549
|
#: Limit number of markers to display 最大(表示)数を制限する
|
|
1535
1550
|
maxnum_markers = 1000
|
|
1536
1551
|
|
|
1537
1552
|
@property
|
|
1538
|
-
def
|
|
1553
|
+
def markers(self):
|
|
1539
1554
|
"""Marked points data array [[x],[y]]."""
|
|
1540
1555
|
xm, ym = self.marked.get_data(orig=0)
|
|
1541
1556
|
return np.array((xm, ym))
|
|
1542
1557
|
|
|
1543
|
-
@
|
|
1544
|
-
def
|
|
1558
|
+
@markers.setter
|
|
1559
|
+
def markers(self, v):
|
|
1545
1560
|
x, y = v
|
|
1546
1561
|
if not hasattr(x, '__iter__'):
|
|
1547
1562
|
x, y = [x], [y]
|
|
@@ -1553,9 +1568,9 @@ class GraphPlot(MatplotPanel):
|
|
|
1553
1568
|
self.update_art_of_mark()
|
|
1554
1569
|
self.handler('mark_drawn', self.frame)
|
|
1555
1570
|
|
|
1556
|
-
@
|
|
1557
|
-
def
|
|
1558
|
-
if self.
|
|
1571
|
+
@markers.deleter
|
|
1572
|
+
def markers(self):
|
|
1573
|
+
if self.markers.size:
|
|
1559
1574
|
self.marked.set_data([], [])
|
|
1560
1575
|
self.__marksel = []
|
|
1561
1576
|
self.update_art_of_mark()
|
|
@@ -1581,7 +1596,7 @@ class GraphPlot(MatplotPanel):
|
|
|
1581
1596
|
self.marked.set_data(xm, ym)
|
|
1582
1597
|
self.marked.set_visible(1)
|
|
1583
1598
|
self.update_art_of_mark()
|
|
1584
|
-
self.
|
|
1599
|
+
self.selector = (x, y)
|
|
1585
1600
|
|
|
1586
1601
|
def del_current_mark(self):
|
|
1587
1602
|
j = self.__marksel
|
|
@@ -1616,12 +1631,12 @@ class GraphPlot(MatplotPanel):
|
|
|
1616
1631
|
color='red', size=7, #fontsize=8,
|
|
1617
1632
|
)
|
|
1618
1633
|
)
|
|
1619
|
-
self.
|
|
1620
|
-
self.trace_point(*self.
|
|
1634
|
+
self.selector = self.get_current_mark()
|
|
1635
|
+
self.trace_point(*self.selector, type=MARK)
|
|
1621
1636
|
self.draw(self.marked)
|
|
1622
1637
|
|
|
1623
1638
|
def OnMarkAppend(self, evt):
|
|
1624
|
-
xs, ys = self.
|
|
1639
|
+
xs, ys = self.selector
|
|
1625
1640
|
if not self.__marksel and len(xs) > 0:
|
|
1626
1641
|
self.set_current_mark(xs, ys)
|
|
1627
1642
|
self.handler('mark_drawn', self.frame)
|
|
@@ -1641,7 +1656,7 @@ class GraphPlot(MatplotPanel):
|
|
|
1641
1656
|
self.__marksel = [k]
|
|
1642
1657
|
self.update_art_of_mark()
|
|
1643
1658
|
|
|
1644
|
-
if self.
|
|
1659
|
+
if self.selector.shape[1] > 1:
|
|
1645
1660
|
self.handler('line_drawn', self.frame) # 多重マーカー選択時
|
|
1646
1661
|
|
|
1647
1662
|
def OnMarkDeselected(self, evt): #<matplotlib.backend_bases.PickEvent>
|
|
@@ -1688,12 +1703,12 @@ class GraphPlot(MatplotPanel):
|
|
|
1688
1703
|
xs, ys = self.get_current_mark()
|
|
1689
1704
|
self.xlim += xs[-1] - (self.xlim[1] + self.xlim[0]) / 2
|
|
1690
1705
|
self.ylim += ys[-1] - (self.ylim[1] + self.ylim[0]) / 2
|
|
1691
|
-
self.
|
|
1706
|
+
self.selector = (xs, ys)
|
|
1692
1707
|
self.trace_point(xs, ys, type=MARK)
|
|
1693
1708
|
self.draw()
|
|
1694
1709
|
|
|
1695
1710
|
def OnMarkSkipNext(self, evt):
|
|
1696
|
-
n = self.
|
|
1711
|
+
n = self.markers.shape[1]
|
|
1697
1712
|
j = self.__marksel
|
|
1698
1713
|
if j:
|
|
1699
1714
|
self.next_mark((j[-1]+1) % n)
|
|
@@ -1701,7 +1716,7 @@ class GraphPlot(MatplotPanel):
|
|
|
1701
1716
|
self.next_mark(0)
|
|
1702
1717
|
|
|
1703
1718
|
def OnMarkSkipPrevious(self, evt):
|
|
1704
|
-
n = self.
|
|
1719
|
+
n = self.markers.shape[1]
|
|
1705
1720
|
j = self.__marksel
|
|
1706
1721
|
if j:
|
|
1707
1722
|
self.next_mark((j[-1]-1) % n)
|
mwx/matplot2lg.py
CHANGED
|
@@ -512,8 +512,8 @@ class LineProfile(LinePlot):
|
|
|
512
512
|
self.__plot.set_xdata(x * ru)
|
|
513
513
|
if self.region is not None:
|
|
514
514
|
self.region *= ru
|
|
515
|
-
sel = self.
|
|
516
|
-
self.
|
|
515
|
+
sel = self.selector
|
|
516
|
+
self.selector = (sel[0] * ru, sel[1])
|
|
517
517
|
self.draw()
|
|
518
518
|
|
|
519
519
|
def set_linewidth(self, w):
|
|
@@ -730,16 +730,16 @@ class LineProfile(LinePlot):
|
|
|
730
730
|
|
|
731
731
|
peaks = np.sort(np.append(maxima, minima))
|
|
732
732
|
if peaks.size:
|
|
733
|
-
self.
|
|
733
|
+
self.selector = x[peaks], y[peaks]
|
|
734
734
|
|
|
735
735
|
def OnMarkErase(self, evt):
|
|
736
736
|
"""Erase markers on peaks."""
|
|
737
|
-
## del self.
|
|
737
|
+
## del self.selector
|
|
738
738
|
self.OnEscapeSelection(evt)
|
|
739
739
|
|
|
740
740
|
def OnMarkSelectionBegin(self, evt):
|
|
741
741
|
org = self.p_event
|
|
742
|
-
xs, ys = self.
|
|
742
|
+
xs, ys = self.selector
|
|
743
743
|
xc, yc = org.xdata, org.ydata
|
|
744
744
|
## xc, yc = evt.xdata, evt.ydata
|
|
745
745
|
if xs.size:
|
|
@@ -750,7 +750,7 @@ class LineProfile(LinePlot):
|
|
|
750
750
|
self.draw()
|
|
751
751
|
|
|
752
752
|
def OnMarkSelectionMove(self, evt):
|
|
753
|
-
xs, ys = self.
|
|
753
|
+
xs, ys = self.selector
|
|
754
754
|
xc, yc = evt.xdata, evt.ydata
|
|
755
755
|
if xs.size:
|
|
756
756
|
ld = np.hypot((xs-xc)*self.ddpu[0], (ys-yc)*self.ddpu[1])
|