peus-plot: optionally give x-range as 2nd argument
Change-Id: I445ef00487fc34343f5a0333643f61753a1c4948
This commit is contained in:
parent
75783b211a
commit
343ce90321
@ -25,13 +25,16 @@ t_rois = get_modules('roi%d')
|
|||||||
i_rois = get_modules('roi%di')
|
i_rois = get_modules('roi%di')
|
||||||
q_rois = get_modules('roi%dq')
|
q_rois = get_modules('roi%dq')
|
||||||
|
|
||||||
|
maxx = None
|
||||||
if len(sys.argv) > 1:
|
if len(sys.argv) > 1:
|
||||||
maxy = float(sys.argv[1])
|
maxy = float(sys.argv[1])
|
||||||
|
if len(sys.argv) > 2:
|
||||||
|
maxx = float(sys.argv[2])
|
||||||
else:
|
else:
|
||||||
maxy = 0.02
|
maxy = 0.02
|
||||||
|
|
||||||
|
|
||||||
iqplot = Plot(maxy)
|
iqplot = Plot(maxy, maxx)
|
||||||
|
|
||||||
for i in range(99):
|
for i in range(99):
|
||||||
pass
|
pass
|
||||||
|
@ -70,9 +70,10 @@ def rects(intervals, y12):
|
|||||||
|
|
||||||
|
|
||||||
class Plot:
|
class Plot:
|
||||||
def __init__(self, maxy):
|
def __init__(self, maxy, maxx=None):
|
||||||
self.lines = {}
|
self.lines = {}
|
||||||
self.yaxis = ((-2 * maxy, maxy), (-maxy, 2 * maxy))
|
self.yaxis = ((-2 * maxy, maxy), (-maxy, 2 * maxy))
|
||||||
|
self.maxx = maxx
|
||||||
self.first = True
|
self.first = True
|
||||||
self.fig = None
|
self.fig = None
|
||||||
|
|
||||||
@ -124,7 +125,7 @@ class Plot:
|
|||||||
self.fig, axleft = plt.subplots(figsize=(15,7))
|
self.fig, axleft = plt.subplots(figsize=(15,7))
|
||||||
self.pause = Pause(self.fig)
|
self.pause = Pause(self.fig)
|
||||||
plt.title("I/Q", fontsize=14)
|
plt.title("I/Q", fontsize=14)
|
||||||
axleft.set_xlim(0, curves[0][-1])
|
axleft.set_xlim(0, self.maxx or curves[0][-1])
|
||||||
self.ax = [axleft, axleft.twinx()]
|
self.ax = [axleft, axleft.twinx()]
|
||||||
self.ax[0].axhline(y=0, color='#cccccc') # show x-axis line
|
self.ax[0].axhline(y=0, color='#cccccc') # show x-axis line
|
||||||
self.ax[1].axhline(y=0, color='#cccccc')
|
self.ax[1].axhline(y=0, color='#cccccc')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user