Exemplo n.º 1
0
def plot_tunnels(tunnels,horiz,fignum=1,keep_lim=True,clear_lines=True,**kwargs):
	'''plot current tunnels in specified figure (axes[0])
	re-zoom to limits at time of call after plotting if keep_lim
	clear previous plotted lines in axes[0] if clear_lines
	'''
	ax = pylab.figure(fignum).axes[0]
	prev_ylim = ax.get_ybound()
	prev_xlim = ax.get_xbound()

	ax.lines = []

	x,y = Util.dezip(horiz)
	pylab.plot(x,y,'k--',lw=2)
	for c,k in iplot.subspec_enum(sorted(tunnels.keys())):
		x,y = Util.dezip(tunnels[k])
		if not '.' in k:
		    pylab.plot(x,y,'w:',lw=2)
		else:
		    pylab.plot(x,y,c=c,lw=2)

	pylab.xlim(*prev_xlim)
	pylab.ylim(*prev_ylim[::-1])
Exemplo n.º 2
0
reload(measure_burrows_from_image)
cm_pts,horiz = measure_burrows_from_image.get_calibration(2)
x,y = Util.dezip(horiz)
plot(x,y,'k--')
tunnels2 = {}
reload(measure_burrows_from_image)
reload(measure_burrows_from_image)
tunnel_oris = {}
measure_burrows_from_image.add_straight_tunnel(tunnels2,tunnel_oris,'MRhill')
measure_burrows_from_image.add_straight_tunnel(tunnels2,tunnel_oris,'MR1.1','MRhill')
measure_burrows_from_image.add_curved_tunnel(tunnels2,tunnel_oris,'MR1.2','MR1.1')
measure_burrows_from_image.add_curved_tunnel(tunnels2,tunnel_oris,'MR1.2','MR1.1')
measure_burrows_from_image.add_straight_tunnel(tunnels2,tunnel_oris,'MR1.3','MR1.2')
tunnel_oris
tunnels2
for c,k in iplot.subspec_enum(tunnels2):
    x,y = Util.dezip(tunnels2[k])
    if not '.' in k:
        plot(x,y,'w--',lw=2)
    else:
        plot(x,y,c=c,lw=2)
        

figure(2).axes[0].lines
figure(2).axes[0].lines = []
for c,k in iplot.subspec_enum(tunnels2):
    x,y = Util.dezip(tunnels2[k])
    if not '.' in k:
        plot(x,y,'w--',lw=2)
    else:
        plot(x,y,c=c,lw=2)