mwxlib 0.96.7__py3-none-any.whl → 0.96.8__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/framework.py +3 -3
- mwx/graphman.py +9 -19
- mwx/matplot2.py +2 -16
- mwx/matplot2g.py +72 -86
- mwx/matplot2lg.py +21 -15
- mwx/wxwil.py +0 -3
- {mwxlib-0.96.7.dist-info → mwxlib-0.96.8.dist-info}/METADATA +1 -1
- {mwxlib-0.96.7.dist-info → mwxlib-0.96.8.dist-info}/RECORD +11 -11
- {mwxlib-0.96.7.dist-info → mwxlib-0.96.8.dist-info}/LICENSE +0 -0
- {mwxlib-0.96.7.dist-info → mwxlib-0.96.8.dist-info}/WHEEL +0 -0
- {mwxlib-0.96.7.dist-info → mwxlib-0.96.8.dist-info}/top_level.txt +0 -0
mwx/framework.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#! python3
|
|
2
2
|
"""mwxlib framework.
|
|
3
3
|
"""
|
|
4
|
-
__version__ = "0.96.
|
|
4
|
+
__version__ = "0.96.8"
|
|
5
5
|
__author__ = "Kazuya O'moto <komoto@jeol.co.jp>"
|
|
6
6
|
|
|
7
7
|
from functools import wraps, partial
|
|
@@ -1630,9 +1630,9 @@ class ShellFrame(MiniFrame):
|
|
|
1630
1630
|
if isinstance(obj, wx.Object):
|
|
1631
1631
|
self.monitor.watch(obj)
|
|
1632
1632
|
self.popup_window(self.monitor)
|
|
1633
|
-
|
|
1633
|
+
if hasattr(obj, '__dict__'):
|
|
1634
1634
|
self.linfo.watch(obj.__dict__)
|
|
1635
|
-
self.ginfo.watch(
|
|
1635
|
+
self.ginfo.watch(None)
|
|
1636
1636
|
self.popup_window(self.linfo)
|
|
1637
1637
|
|
|
1638
1638
|
def highlight(self, obj, *args, **kwargs):
|
mwx/graphman.py
CHANGED
|
@@ -541,19 +541,6 @@ class Graph(GraphPlot):
|
|
|
541
541
|
if self.infobar.IsShown():
|
|
542
542
|
self.infobar.ShowMessage(frame.annotation)
|
|
543
543
|
|
|
544
|
-
def get_frame_visible(self):
|
|
545
|
-
if self.frame:
|
|
546
|
-
return self.frame.get_visible()
|
|
547
|
-
return False
|
|
548
|
-
|
|
549
|
-
def set_frame_visible(self, v):
|
|
550
|
-
if self.frame:
|
|
551
|
-
if self.frame.get_visible() != v:
|
|
552
|
-
self.frame.set_visible(v)
|
|
553
|
-
return True
|
|
554
|
-
return False
|
|
555
|
-
return None
|
|
556
|
-
|
|
557
544
|
def get_markups_visible(self):
|
|
558
545
|
return self.marked.get_visible()
|
|
559
546
|
|
|
@@ -823,11 +810,13 @@ class Frame(mwx.Frame):
|
|
|
823
810
|
self.Bind(wx.EVT_CLOSE, self.OnClose)
|
|
824
811
|
|
|
825
812
|
def on_move(evt, show):
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
813
|
+
def _display(view, show):
|
|
814
|
+
if view.frame:
|
|
815
|
+
view.frame.set_visible(show)
|
|
816
|
+
if show:
|
|
817
|
+
view.draw()
|
|
818
|
+
_display(self.graph, show)
|
|
819
|
+
_display(self.output, show)
|
|
831
820
|
evt.Skip()
|
|
832
821
|
self.Bind(wx.EVT_MOVE_START, lambda v :on_move(v, show=0))
|
|
833
822
|
self.Bind(wx.EVT_MOVE_END, lambda v :on_move(v, show=1))
|
|
@@ -943,9 +932,10 @@ class Frame(mwx.Frame):
|
|
|
943
932
|
return
|
|
944
933
|
|
|
945
934
|
## Set the graph and output window sizes to half & half.
|
|
935
|
+
## ドッキング時に再計算される
|
|
946
936
|
if name == "output" or name is self.output:
|
|
947
937
|
w, h = self.graph.GetClientSize()
|
|
948
|
-
pane.best_size = (w//2, h) #
|
|
938
|
+
pane.best_size = (w//2 - 3, h) # 分割線幅補正 -12pix (Windows only ?)
|
|
949
939
|
|
|
950
940
|
## Force Layer windows to show.
|
|
951
941
|
if interactive:
|
mwx/matplot2.py
CHANGED
|
@@ -100,10 +100,7 @@ class MatplotPanel(wx.Panel):
|
|
|
100
100
|
self.toolbar.Show(0)
|
|
101
101
|
|
|
102
102
|
## modeline bar
|
|
103
|
-
self.modeline = wx.StaticText(self,
|
|
104
|
-
self.modeline.write = self.modeline.SetLabel
|
|
105
|
-
self.modeline.read = self.modeline.GetLabel
|
|
106
|
-
self.modeline.SetToolTip("")
|
|
103
|
+
self.modeline = wx.StaticText(self, style=wx.ST_NO_AUTORESIZE)
|
|
107
104
|
|
|
108
105
|
self.modeline.Bind(wx.EVT_MOTION, self.on_modeline_tip)
|
|
109
106
|
self.modeline.Bind(wx.EVT_LEFT_DOWN, lambda v: self.canvas.SetFocus())
|
|
@@ -390,7 +387,7 @@ class MatplotPanel(wx.Panel):
|
|
|
390
387
|
def on_modeline_tip(self, evt): #<wx._core.MouseEvent>
|
|
391
388
|
flag = self.modeline.HitTest(evt.Position)
|
|
392
389
|
if flag == wx.HT_WINDOW_INSIDE:
|
|
393
|
-
self.modeline.
|
|
390
|
+
self.modeline.ToolTip = self.modeline.Label
|
|
394
391
|
evt.Skip()
|
|
395
392
|
|
|
396
393
|
def on_focus_set(self, evt): #<wx._core.FocusEvent>
|
|
@@ -655,17 +652,6 @@ class MatplotPanel(wx.Panel):
|
|
|
655
652
|
del self.Selector
|
|
656
653
|
self.canvas.draw_idle()
|
|
657
654
|
|
|
658
|
-
## def OnShiftLimit(self, evt, r=0.1):
|
|
659
|
-
## w = self.xlim[1] - self.xlim[0]
|
|
660
|
-
## h = self.ylim[1] - self.ylim[0]
|
|
661
|
-
## if 'up' in evt.key: self.ylim += h * r
|
|
662
|
-
## elif 'down' in evt.key: self.ylim -= h * r
|
|
663
|
-
## elif 'left' in evt.key: self.xlim -= w * r
|
|
664
|
-
## elif 'right' in evt.key: self.xlim += w * r
|
|
665
|
-
## if 1:
|
|
666
|
-
## self.toolbar.push_current()
|
|
667
|
-
## self.draw()
|
|
668
|
-
|
|
669
655
|
def zoomlim(self, lim, M, c=None):
|
|
670
656
|
## The limitation of zoom is necessary; If the axes is enlarged too much,
|
|
671
657
|
## the processing speed will significantly slow down.
|
mwx/matplot2g.py
CHANGED
|
@@ -359,33 +359,6 @@ class AxesImagePhantom(object):
|
|
|
359
359
|
x = l + (nx + 0.5) * ux
|
|
360
360
|
y = t - (ny + 0.5) * uy # Y ピクセルインデクスは座標と逆
|
|
361
361
|
return (x, y)
|
|
362
|
-
|
|
363
|
-
def calc_point(self, x, y, centred=True, inaxes=False):
|
|
364
|
-
"""Computes the nearest pixelated point from a point (x, y).
|
|
365
|
-
If centred, correct the points to the center of the nearest pixel.
|
|
366
|
-
If inaxes, restrict the points in image area.
|
|
367
|
-
"""
|
|
368
|
-
if isinstance(x, (list, tuple)):
|
|
369
|
-
x = np.array(x)
|
|
370
|
-
y = np.array(y)
|
|
371
|
-
l,r,b,t = self.__art.get_extent()
|
|
372
|
-
if inaxes:
|
|
373
|
-
x[x < l] = l
|
|
374
|
-
x[x > r] = r
|
|
375
|
-
y[y < b] = b
|
|
376
|
-
y[y > t] = t
|
|
377
|
-
nx, ny = self.xytopixel(x, y)
|
|
378
|
-
ux, uy = self.xy_unit
|
|
379
|
-
if centred:
|
|
380
|
-
x = l + (nx + 0.5) * ux
|
|
381
|
-
y = t - (ny + 0.5) * uy
|
|
382
|
-
if inaxes:
|
|
383
|
-
x[x > r] -= ux
|
|
384
|
-
y[y < b] += uy
|
|
385
|
-
else:
|
|
386
|
-
x = l + nx * ux
|
|
387
|
-
y = t - ny * uy
|
|
388
|
-
return (x, y)
|
|
389
362
|
|
|
390
363
|
|
|
391
364
|
class GraphPlot(MatplotPanel):
|
|
@@ -589,6 +562,8 @@ class GraphPlot(MatplotPanel):
|
|
|
589
562
|
|
|
590
563
|
self.modeline.Show(1)
|
|
591
564
|
self.Layout()
|
|
565
|
+
|
|
566
|
+
self.writeln()
|
|
592
567
|
|
|
593
568
|
def clear(self):
|
|
594
569
|
MatplotPanel.clear(self)
|
|
@@ -907,13 +882,12 @@ class GraphPlot(MatplotPanel):
|
|
|
907
882
|
|
|
908
883
|
def trace_point(self, x, y, type=NORMAL):
|
|
909
884
|
"""Puts (override) a message of points x and y."""
|
|
910
|
-
|
|
885
|
+
frame = self.frame
|
|
886
|
+
if frame:
|
|
911
887
|
if not hasattr(x, '__iter__'): # called from OnMotion
|
|
912
|
-
nx, ny =
|
|
913
|
-
z =
|
|
914
|
-
self.message(
|
|
915
|
-
"[{:-4d},{:-4d}] "
|
|
916
|
-
"({:-8.3f},{:-8.3f}) value: {}".format(nx, ny, x, y, z))
|
|
888
|
+
nx, ny = frame.xytopixel(x, y)
|
|
889
|
+
z = frame.xytoc(x, y)
|
|
890
|
+
self.message(f"[{nx:-4d},{ny:-4d}] ({x:-8.3f},{y:-8.3f}) value: {z}")
|
|
917
891
|
return
|
|
918
892
|
|
|
919
893
|
if len(x) == 0: # no selection
|
|
@@ -923,43 +897,41 @@ class GraphPlot(MatplotPanel):
|
|
|
923
897
|
return self.trace_point(x[0], y[0], type)
|
|
924
898
|
|
|
925
899
|
if len(x) == 2: # 2-Selector trace line (called from Selector:setter)
|
|
926
|
-
nx, ny =
|
|
900
|
+
nx, ny = frame.xytopixel(x, y)
|
|
927
901
|
dx = x[1] - x[0]
|
|
928
902
|
dy = y[1] - y[0]
|
|
929
903
|
a = np.arctan2(dy, dx) * 180/pi
|
|
930
904
|
lu = np.hypot(dy, dx)
|
|
931
905
|
li = np.hypot(nx[1]-nx[0], ny[1]-ny[0])
|
|
932
|
-
self.message("[Line] "
|
|
933
|
-
"Length: {:.1f} pixel ({:g}u) "
|
|
934
|
-
"Angle: {:.1f} deg".format(li, lu, a))
|
|
906
|
+
self.message(f"[Line] Length: {li:.1f} pixel ({lu:g}u) Angle: {a:.1f} deg")
|
|
935
907
|
|
|
936
908
|
elif type == REGION: # N-Selector trace polygon (called from Region:setter)
|
|
937
|
-
nx, ny =
|
|
909
|
+
nx, ny = frame.xytopixel(x, y)
|
|
938
910
|
xo, yo = min(nx), min(ny) # top-left
|
|
939
911
|
xr, yr = max(nx), max(ny) # bottom-right
|
|
940
|
-
self.message("[Region] "
|
|
941
|
-
"crop={}:{}:{}:{}".format(xr-xo, yr-yo, xo, yo)) # (W:H:left:top)
|
|
912
|
+
self.message(f"[Region] crop={xr-xo}:{yr-yo}:{xo}:{yo}") # (W:H:left:top)
|
|
942
913
|
|
|
943
914
|
def writeln(self):
|
|
944
915
|
"""Puts (override) attributes of current frame to the modeline."""
|
|
945
916
|
if not self.modeline.IsShown():
|
|
946
917
|
return
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
918
|
+
frame = self.frame
|
|
919
|
+
if frame:
|
|
920
|
+
self.modeline.SetLabel(
|
|
921
|
+
"[{page}/{maxpage}] -{a}- {name} ({data.dtype}:{cmap}{bins}) "
|
|
922
|
+
"[{data.shape[1]}:{data.shape[0]}] {x} [{unit:g}/pixel]".format(
|
|
951
923
|
page = self.__index,
|
|
952
924
|
maxpage = len(self),
|
|
953
|
-
name =
|
|
954
|
-
data =
|
|
955
|
-
cmap =
|
|
956
|
-
bins = ' bin{}'.format(
|
|
957
|
-
unit =
|
|
958
|
-
x = '**' if
|
|
959
|
-
a = '%%' if not
|
|
925
|
+
name = frame.name,
|
|
926
|
+
data = frame.buffer,
|
|
927
|
+
cmap = frame.get_cmap().name,
|
|
928
|
+
bins = ' bin{}'.format(frame.binning) if frame.binning > 1 else '',
|
|
929
|
+
unit = frame.unit,
|
|
930
|
+
x = '**' if frame.localunit else '--',
|
|
931
|
+
a = '%%' if not frame.buffer.flags.writeable else '--'))
|
|
960
932
|
else:
|
|
961
|
-
self.modeline.
|
|
962
|
-
|
|
933
|
+
self.modeline.SetLabel(
|
|
934
|
+
"[{page}/{maxpage}] ---- No buffer (-:-) [-:-] -- [{unit:g}/pixel]".format(
|
|
963
935
|
page = '-',
|
|
964
936
|
maxpage = len(self),
|
|
965
937
|
unit = self.__unit))
|
|
@@ -973,15 +945,16 @@ class GraphPlot(MatplotPanel):
|
|
|
973
945
|
|
|
974
946
|
def write_buffer_to_clipboard(self):
|
|
975
947
|
"""Write buffer data to clipboard."""
|
|
976
|
-
|
|
948
|
+
frame = self.frame
|
|
949
|
+
if not frame:
|
|
977
950
|
self.message("No frame")
|
|
978
951
|
return
|
|
979
952
|
try:
|
|
980
|
-
name =
|
|
981
|
-
data =
|
|
953
|
+
name = frame.name
|
|
954
|
+
data = frame.roi
|
|
982
955
|
GraphPlot.clipboard_name = name
|
|
983
956
|
GraphPlot.clipboard_data = data
|
|
984
|
-
bins, vlim, img = imconvert(data,
|
|
957
|
+
bins, vlim, img = imconvert(data, frame.vlim)
|
|
985
958
|
Clipboard.imwrite(img)
|
|
986
959
|
self.message("Write buffer to clipboard.")
|
|
987
960
|
except Exception as e:
|
|
@@ -1034,10 +1007,6 @@ class GraphPlot(MatplotPanel):
|
|
|
1034
1007
|
self.handler.bind('frame_shown', self.update_colorbar)
|
|
1035
1008
|
else:
|
|
1036
1009
|
self.message("- A frame must exist to create a colorbar.")
|
|
1037
|
-
## self['*dummy*'] = np.random.rand(2,2) # dummy
|
|
1038
|
-
## self.create_colorbar()
|
|
1039
|
-
## del self['*dummy*']
|
|
1040
|
-
pass
|
|
1041
1010
|
|
|
1042
1011
|
## --------------------------------
|
|
1043
1012
|
## matplotlib interfaces
|
|
@@ -1047,9 +1016,9 @@ class GraphPlot(MatplotPanel):
|
|
|
1047
1016
|
"""Pickup image and other arts.
|
|
1048
1017
|
Called (maybe) after mouse buttons are pressed.
|
|
1049
1018
|
"""
|
|
1050
|
-
## canvas 全体に有効だが,分割された axes (colorbar 領域など)
|
|
1051
|
-
## image
|
|
1052
|
-
##
|
|
1019
|
+
## canvas 全体に有効だが,分割された axes (colorbar 領域など) は無効.
|
|
1020
|
+
## image - plot が重なっている場合,plot -> image の順に呼び出される.
|
|
1021
|
+
## 多重呼び出しが起きないように __isPicked フラグで排他制御する.
|
|
1053
1022
|
|
|
1054
1023
|
if evt.mouseevent.button != 1 or not evt.artist.get_visible():
|
|
1055
1024
|
return
|
|
@@ -1118,15 +1087,16 @@ class GraphPlot(MatplotPanel):
|
|
|
1118
1087
|
"""Called before canvas.draw (overridden)."""
|
|
1119
1088
|
if not self.interpolation_mode:
|
|
1120
1089
|
return
|
|
1121
|
-
|
|
1090
|
+
frame = self.frame
|
|
1091
|
+
if frame:
|
|
1122
1092
|
## [dots/pixel] = [dots/u] * [u/pixel]
|
|
1123
|
-
dots = self.ddpu[0] *
|
|
1093
|
+
dots = self.ddpu[0] * frame.unit * frame.binning
|
|
1124
1094
|
|
|
1125
|
-
if
|
|
1126
|
-
|
|
1095
|
+
if frame.get_interpolation() == 'nearest' and dots < 1:
|
|
1096
|
+
frame.set_interpolation(self.interpolation_mode)
|
|
1127
1097
|
|
|
1128
|
-
elif
|
|
1129
|
-
|
|
1098
|
+
elif frame.get_interpolation() != 'nearest' and dots > 1:
|
|
1099
|
+
frame.set_interpolation('nearest')
|
|
1130
1100
|
|
|
1131
1101
|
def OnMotion(self, evt):
|
|
1132
1102
|
"""Called when mouse moves in axes (overridden)."""
|
|
@@ -1135,13 +1105,15 @@ class GraphPlot(MatplotPanel):
|
|
|
1135
1105
|
|
|
1136
1106
|
def OnPageDown(self, evt):
|
|
1137
1107
|
"""Next page."""
|
|
1138
|
-
|
|
1139
|
-
|
|
1108
|
+
i = self.__index
|
|
1109
|
+
if i is not None and i < len(self)-1:
|
|
1110
|
+
self.select(i + 1)
|
|
1140
1111
|
|
|
1141
1112
|
def OnPageUp(self, evt):
|
|
1142
1113
|
"""Previous page."""
|
|
1143
|
-
|
|
1144
|
-
|
|
1114
|
+
i = self.__index
|
|
1115
|
+
if i is not None and i > 0:
|
|
1116
|
+
self.select(i - 1)
|
|
1145
1117
|
|
|
1146
1118
|
def OnHomePosition(self, evt):
|
|
1147
1119
|
self.update_axis()
|
|
@@ -1152,14 +1124,6 @@ class GraphPlot(MatplotPanel):
|
|
|
1152
1124
|
if len(xs) > 1:
|
|
1153
1125
|
self.handler('line_removed', self.frame)
|
|
1154
1126
|
|
|
1155
|
-
## def zoomlim(self, lim, M, c=None): # virtual call from OnZoom, OnScrollZoom
|
|
1156
|
-
## if c is None:
|
|
1157
|
-
## c = (lim[1] + lim[0]) / 2
|
|
1158
|
-
## y = c - M * (c - lim)
|
|
1159
|
-
## if self.frame:
|
|
1160
|
-
## if abs(y[1] - y[0]) > self.frame.unit or M > 1:
|
|
1161
|
-
## return y
|
|
1162
|
-
|
|
1163
1127
|
def OnXAxisPanZoom(self, evt, c=None):
|
|
1164
1128
|
org = self.p_event
|
|
1165
1129
|
M = np.exp(-(evt.x - org.x)/100)
|
|
@@ -1184,11 +1148,33 @@ class GraphPlot(MatplotPanel):
|
|
|
1184
1148
|
## Selector interface
|
|
1185
1149
|
## --------------------------------
|
|
1186
1150
|
|
|
1187
|
-
def calc_point(self, x, y, centred=True):
|
|
1188
|
-
"""
|
|
1189
|
-
If centred, correct the
|
|
1151
|
+
def calc_point(self, x, y, centred=True, inaxes=False):
|
|
1152
|
+
"""Computes the nearest pixelated point from a point (x, y).
|
|
1153
|
+
If centred, correct the points to the center of the nearest pixel.
|
|
1154
|
+
If inaxes, restrict the points in image area.
|
|
1190
1155
|
"""
|
|
1191
|
-
|
|
1156
|
+
frame = self.frame
|
|
1157
|
+
if isinstance(x, (list, tuple)):
|
|
1158
|
+
x = np.array(x)
|
|
1159
|
+
y = np.array(y)
|
|
1160
|
+
l,r,b,t = frame.get_extent()
|
|
1161
|
+
if inaxes:
|
|
1162
|
+
x[x < l] = l
|
|
1163
|
+
x[x > r] = r
|
|
1164
|
+
y[y < b] = b
|
|
1165
|
+
y[y > t] = t
|
|
1166
|
+
nx, ny = frame.xytopixel(x, y)
|
|
1167
|
+
ux, uy = frame.xy_unit
|
|
1168
|
+
if centred:
|
|
1169
|
+
x = l + (nx + 0.5) * ux
|
|
1170
|
+
y = t - (ny + 0.5) * uy
|
|
1171
|
+
if inaxes:
|
|
1172
|
+
x[x > r] -= ux
|
|
1173
|
+
y[y < b] += uy
|
|
1174
|
+
else:
|
|
1175
|
+
x = l + nx * ux
|
|
1176
|
+
y = t - ny * uy
|
|
1177
|
+
return (x, y)
|
|
1192
1178
|
|
|
1193
1179
|
def calc_shiftpoint(self, xo, yo, x, y, centred=True):
|
|
1194
1180
|
"""Restrict point (x, y) from (xo, yo) in pi/8 step angles.
|
mwx/matplot2lg.py
CHANGED
|
@@ -59,8 +59,9 @@ class LinePlot(MatplotPanel):
|
|
|
59
59
|
|
|
60
60
|
## Note for matplotlib >= 3.9.0:
|
|
61
61
|
## axhspan and axvspan now return Rectangles, not Polygons.
|
|
62
|
-
|
|
62
|
+
|
|
63
63
|
#<matplotlib.patches.Polygon>
|
|
64
|
+
#<matplotlib.patches.Rectangle>
|
|
64
65
|
self.__vspan = self.axes.axvspan(0, 0,
|
|
65
66
|
color='none', ls='dashed', lw=1, ec='black', visible=0, zorder=2)
|
|
66
67
|
|
|
@@ -331,15 +332,17 @@ class Histogram(LinePlot):
|
|
|
331
332
|
frame = self.__frame
|
|
332
333
|
if frame:
|
|
333
334
|
x, y = frame.__data
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
335
|
+
if self.region is not None:
|
|
336
|
+
i, j = x.searchsorted(self.region)
|
|
337
|
+
else:
|
|
338
|
+
i, j = np.uint8(self.xlim)
|
|
339
|
+
self.modeline.SetLabel(
|
|
340
|
+
"[--] ---- {name} ({type}:) [{}:{}]".format(i, j,
|
|
337
341
|
name = frame.name,
|
|
338
342
|
type = frame.buffer.dtype,
|
|
339
|
-
|
|
340
|
-
bins = (i, j)))
|
|
343
|
+
))
|
|
341
344
|
else:
|
|
342
|
-
self.modeline.
|
|
345
|
+
self.modeline.SetLabel("")
|
|
343
346
|
|
|
344
347
|
## --------------------------------
|
|
345
348
|
## Motion/Drag actions (override)
|
|
@@ -349,7 +352,10 @@ class Histogram(LinePlot):
|
|
|
349
352
|
if self.__frame:
|
|
350
353
|
x, y = self.__frame.__data
|
|
351
354
|
if len(x) > 1:
|
|
352
|
-
|
|
355
|
+
if self.region is not None:
|
|
356
|
+
i, j = x.searchsorted(self.region)
|
|
357
|
+
else:
|
|
358
|
+
i, j = (0, -1)
|
|
353
359
|
self.__fil.set_xy(list(chain([(x[i],0)], zip(x[i:j],y[i:j]), [(x[j-1],0)])))
|
|
354
360
|
else:
|
|
355
361
|
self.__fil.set_xy([(0,0)])
|
|
@@ -601,19 +607,19 @@ class LineProfile(LinePlot):
|
|
|
601
607
|
return
|
|
602
608
|
frame = self.__frame
|
|
603
609
|
if frame:
|
|
604
|
-
self.modeline.
|
|
605
|
-
|
|
606
|
-
|
|
610
|
+
self.modeline.SetLabel(
|
|
611
|
+
"[--] -{a}- {name} ({type}:{mode}) "
|
|
612
|
+
"[{length}:{width}] {x} [{unit:g}/pixel]".format(
|
|
607
613
|
name = frame.name,
|
|
608
614
|
type = frame.buffer.dtype,
|
|
609
|
-
mode = "
|
|
615
|
+
mode = "logic" if self.__logicp else "pixel",
|
|
610
616
|
width = self.__linewidth,
|
|
611
617
|
length = len(self.plotdata[0]),
|
|
612
|
-
unit = frame.unit
|
|
613
|
-
x = '
|
|
618
|
+
unit = frame.unit,
|
|
619
|
+
x = '**' if frame.localunit else '--',
|
|
614
620
|
a = '%%' if not frame.buffer.flags.writeable else '--'))
|
|
615
621
|
else:
|
|
616
|
-
self.modeline.
|
|
622
|
+
self.modeline.SetLabel("")
|
|
617
623
|
|
|
618
624
|
def write_data_to_clipboard(self):
|
|
619
625
|
"""Write plot data to clipboard."""
|
mwx/wxwil.py
CHANGED
|
@@ -69,11 +69,8 @@ class LocalsWatcher(wx.ListCtrl, ListCtrlAutoWidthMixin, CtrlInterface):
|
|
|
69
69
|
def watch(self, locals):
|
|
70
70
|
self.clear()
|
|
71
71
|
if not isinstance(locals, dict):
|
|
72
|
-
## wx.MessageBox("Cannot watch the locals.\n\n"
|
|
73
|
-
## "- {!r} is not a dict object.".format(locals))
|
|
74
72
|
self.unwatch()
|
|
75
73
|
return
|
|
76
|
-
busy = wx.BusyCursor()
|
|
77
74
|
self.target = locals
|
|
78
75
|
try:
|
|
79
76
|
self.Freeze()
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
mwx/__init__.py,sha256=nN62CGTWjME7Zz2h-jIRB8MxwuErIkHPGrlBzydkF0o,643
|
|
2
2
|
mwx/bookshelf.py,sha256=CjcgtHC33KR5mHp1lW6Bqfndpzr7hC8ICkFihw4kM3g,5134
|
|
3
3
|
mwx/controls.py,sha256=s6yJzQyYnjCzcjXa6nbTJncxzpMI0E5zYWPn3-cFy5Q,48378
|
|
4
|
-
mwx/framework.py,sha256=
|
|
5
|
-
mwx/graphman.py,sha256=
|
|
4
|
+
mwx/framework.py,sha256=WdKCaMnp3S0_PbpAfK2AxfUZgriUMFPAP2I4yGzZoVA,75227
|
|
5
|
+
mwx/graphman.py,sha256=DtTnz2fW78eAIWC1QV8nMuSddiIsjb4cSnXb3BkTpdI,71043
|
|
6
6
|
mwx/images.py,sha256=_-Eh3xF7Khu42ivkYp97NXIzSNGbjcidqtWjZQFGtqE,47827
|
|
7
|
-
mwx/matplot2.py,sha256
|
|
8
|
-
mwx/matplot2g.py,sha256=
|
|
9
|
-
mwx/matplot2lg.py,sha256=
|
|
7
|
+
mwx/matplot2.py,sha256=NcNOIhOzrzU6smRtCnHZxJenkrHq0R4D7bWp7PF4QVA,32913
|
|
8
|
+
mwx/matplot2g.py,sha256=ydqAiM_gw9DwjOOc_akKeVsVKPD8KfXu8KFJx32dlZ0,64453
|
|
9
|
+
mwx/matplot2lg.py,sha256=JRWjWnLJUytbSq6wxs4P0gbVUr3xoLSF6Wwqd5V_pJI,27404
|
|
10
10
|
mwx/mgplt.py,sha256=ITzxA97yDwr_35BUk5OqnyskSuKVDbpf2AQCKY1jHTI,5671
|
|
11
11
|
mwx/nutshell.py,sha256=cdrg3cuF6AVU2OuR3QswSiTWrTsGIVaqrBSMuxJIjdE,137364
|
|
12
12
|
mwx/utilus.py,sha256=8GK_2mGY08DVN5_SGWynLKQEJsCKqvqWTDToar1XozM,37333
|
|
13
13
|
mwx/wxmon.py,sha256=f3V24EF7kdMlYF7usLYK9QE5KU6fSu0jVqsvwAiA-Ag,12647
|
|
14
14
|
mwx/wxpdb.py,sha256=lLowkkAgMhPFHAfklD7wZHq0qbSMjRxnBFtSajmVgME,19133
|
|
15
|
-
mwx/wxwil.py,sha256=
|
|
15
|
+
mwx/wxwil.py,sha256=hhyB1lPrF9ixeObxCOKQv0Theu-B-kpJg_yVU3EGSNg,5406
|
|
16
16
|
mwx/wxwit.py,sha256=yU6XeCCWRBP7CLmpphjT072PfXAL30DNaxoChDX2p0I,7322
|
|
17
17
|
mwx/plugins/__init__.py,sha256=jnJ-Sl9XJ_7BFDslD_r7dsbxsOT57q_IaEriV53XIGY,41
|
|
18
18
|
mwx/plugins/ffmpeg_view.py,sha256=QjNqnvPEd9vCwfATU2BOO75fIOFD5LQ-Wf-BBhvZNZs,9368
|
|
@@ -21,8 +21,8 @@ mwx/plugins/frame_listview.py,sha256=7LDAYbl5NvmD4Ehc690IrTbcRgCALRWeLVVOT9cm9Do
|
|
|
21
21
|
mwx/plugins/line_profile.py,sha256=--9NIc3x5EfRB3L59JvD7rzENQHyiYfu7wWJo6AuMkA,820
|
|
22
22
|
mwx/py/__init__.py,sha256=xykgfOytOwNuvXsfkLoumFZSTN-iBsHOjczYXngjmUE,12
|
|
23
23
|
mwx/py/filling.py,sha256=KaHooM32hrGGgqw75Cbt8lAvACwC6RXadob9LGgNnEc,16806
|
|
24
|
-
mwxlib-0.96.
|
|
25
|
-
mwxlib-0.96.
|
|
26
|
-
mwxlib-0.96.
|
|
27
|
-
mwxlib-0.96.
|
|
28
|
-
mwxlib-0.96.
|
|
24
|
+
mwxlib-0.96.8.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
|
|
25
|
+
mwxlib-0.96.8.dist-info/METADATA,sha256=eNdwrk8WxGhWphg4UbZrKiMynpJ1_f17-8NpqR2F-j0,1880
|
|
26
|
+
mwxlib-0.96.8.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
|
|
27
|
+
mwxlib-0.96.8.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
|
|
28
|
+
mwxlib-0.96.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|