本文整理汇总了Python中taref.plotter.api.scatter函数的典型用法代码示例。如果您正苦于以下问题:Python scatter函数的具体用法?Python scatter怎么用?Python scatter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了scatter函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ifft_plot
def ifft_plot(self, **kwargs):
process_kwargs(self, kwargs, pl="hannifft_{0}_{1}_{2}".format(self.filter_type, self.bgsub_type, self.name))
on_res=10*log10(absolute(self.filt.window_ifft(self.MagcomData[:,0])))
pl=line(self.time_axis-0.05863, self.filt.fftshift(on_res), color="purple",
plot_name="onres_{}".format(self.on_res_ind), alpha=0.8, label="IFFT", **kwargs)
self.filt.N=len(on_res)
filt=self.filt.freqz
#filt=filt_prep(len(on_res), self.filt_start_ind, self.filt_end_ind)
top=36.0#amax(on_res)
line(self.time_axis-0.05863, filt*top-70, plotter=pl, color="green",
linestyle="dotted", label="Filter window")
pl.xlabel=kwargs.pop("xlabel", self.time_axis_label)
pl.ylabel=kwargs.pop("ylabel", "Mag abs")
scatter(array([0.05863, 0.2, 0.337, 0.48, 0.761, 1.395, 1.455])-0.05863,
array([0.0, 500.0, 1000.0, 1500.0, 2500.0, 4500, 200+2500+2500-300])/100.0-60,
marker_size=4.0, pl=pl, label="IFFT peak")
t=linspace(0,2,1001) #self.time_axis-0.05863
line(t, 3488.0*t/100.0-60, pl=pl, color="black", linestyle="dashed", auto_xlim=False, x_min=-0.2, x_max=1.0,
auto_ylim=False, y_min=-65, y_max=-15, label="$d=v_ft$")
t=array([8.7e-8, 2.64e-7, 3.79e-7, 4.35e-7, 6.6e-7])-8.7e-8
scatter(t*1e6, array([0.0, 600.0, 1000.0, 1200.0, 2000.0])/100.0-60, pl=pl,
facecolor="red", edgecolor="red", label="100 ns pulse",
marker_size=4.0)
pl.legend()
#b.line_plot("spd_fit", t*1e6, (t*qdt.vf)*1e6, label="(3488 m/s)t")
return pl
示例2: flux_plots
def flux_plots():
data=npr.read()
frequency=linspace(3.5e9, 7.5e9, 1000)
freq=append(frequency/1e9, frequency/1e9)
freq=append(freq, freq)
V=qdt._get_Vfq0_many(f=frequency)[1]
pl1=scatter(data[:, 0], data[:, 1], fig_width=6.0, fig_height=4.0, color="red", pl="fitVvsf")
line(freq, V, pl=pl1, ylabel="Yoko (V)", xlabel="Frequency (GHz)")
pl1.add_label("a)")
V2=ideal_qdt._get_Vfq0_many(f=frequency)[1]
pl2=scatter(data[:, 0], data[:, 1], fig_width=6.0, fig_height=4.0, color="red", pl="idealVvsf")
line(freq, V2, pl=pl2, ylabel="Yoko (V)", xlabel="Frequency (GHz)")
pl2.add_label("b)")
pl3=scatter(data[:, 1], data[:, 0], fig_width=6.0, fig_height=4.0, color="red", pl="fitfvsV")
line(V, freq, pl=pl3, xlabel="Yoko (V)", ylabel="Frequency (GHz)")
pl3.add_label("c)")
pl4=scatter(data[:, 1], data[:, 0], fig_width=6.0, fig_height=4.0, color="red", pl="idealfvsV")
line(V2, freq, pl=pl4, xlabel="Yoko (V)", ylabel="Frequency (GHz)")
pl4.add_label("d)")
#pls=[pl1, pl2, pl3, pl4]
#for pl in pls:
return [pl1, pl2, pl3, pl4]
示例3: plot_widths
def plot_widths(self, plotter=None):
print "first fit"
tstart=time()
fq_vec=array([sqrt(f*(f-2*self.qdt._get_Lamb_shift(f=f))) for f in self.frequency])
#fit_p=self.fano_fit(263, fq_vec)
#print self.p_guess, fit_p
#fit=lorentzian(fq_vec, fit_p[1:])
#pl, pf=line(fq_vec, self.MagAbsFilt_sq[263, :])
#line(fq_vec, fit, plotter=pl, color="red")
#pl.show()
fit_params=self.full_fano_fit(fq_vec)
pl, pf=scatter(self.frequency, absolute(fit_params[1, :]), color="red", label=self.name, plot_name="widths_{}".format(self.name))
line(self.frequency, self.qdt._get_coupling(self.frequency)+18e6, plotter=pl)
pl, pf=scatter(self.frequency, fit_params[2, :], color="red", label=self.name, plot_name="widths_{}".format(self.name))
line(self.frequency, fq_vec, #flux_par3(self),
plotter=pl)
print "fit second", tstart-time()
tstart=time()
fq_vec=array([sqrt(f*(f-2*self.qdt._get_Lamb_shift(f=f))) for f in self.frequency])
pl, pf = scatter(fit_params[2, :], fq_vec, color="red")
#flux_d_flux0=self.qdt._get_flux_over_flux0(voltage=self.yoko, offset=0.0)
fq=self.qdt._get_flux_parabola(voltage=self.yoko, offset=0.0)
line(self.yoko, fq, plotter=pl)
#fit_params=self.full_fano_fit2()
#def rpt_fit2(self):
# MagAbsFilt_sq=self.MagAbsFilt**2
# return rpt_fit(lorentzian2, self.p_guess, MagAbsFilt_sq[440, :], self.yoko)
#fit2_p=rpt_fit2(self)
#print fit2_p
#fit2=lorentzian2(self.yoko, *fit2_p)
#line(self.yoko, fit2, plotter=pl, color="green")
#scatter(absolute(fit_params[1, :]), color="red", label=self.name, plot_name="widths_{}".format(self.name))
print "fit third", tstart-time()
tstart=time()
#fit_params=self.full_fano_fit3()
#scatter(absolute(fit_params[1, :]), color="red", label=self.name, plot_name="widths_{}".format(self.name))
print "fit done", tstart-time()
示例4: center_plot
def center_plot(self, **kwargs):
process_kwargs(self, kwargs, pl="center_{0}_{1}_{2}".format(self.filter_type, self.bgsub_type, self.name))
pl=scatter(self.freq_axis[self.flat_indices], array([fp[1] for fp in self.fit_params]), **kwargs)
if self.show_quick_fit:
if self.flux_axis_type=="fq":
line(self.freq_axis[self.indices], self.ls_f[self.indices]/1e9, plotter=pl, color="red", linewidth=1.0)
elif self.flux_axis_type=="yoko":
line(self.freq_axis[self.indices], self.qdt._get_Vfq0(f=self.frequency[self.indices]), plotter=pl, color="red", linewidth=1.0)
else:
line(self.freq_axis, self.qdt._get_fluxfq0(f=self.frequency), plotter=pl, color="red", linewidth=1.0)
if self.fitter.p_guess is not None:
line(self.freq_axis[self.indices], array([pg[1] for pg in self.fitter.p_guess]), pl=pl, color="green", linewidth=1.0) #self.voltage_from_frequency(self.qdt._get_coupling(self.frequency)), plotter=pl, color="red")
return pl
示例5: widths_plot
def widths_plot(self, **kwargs):
process_kwargs(self, kwargs, pl="widths_{0}_{1}_{2}".format(self.filter_type, self.bgsub_type, self.name))
pl=scatter(self.freq_axis[self.flat_indices], absolute([fp[0] for fp in self.fit_params]), **kwargs)
if self.show_quick_fit:
if self.flux_axis_type=="fq":
#line(self.freq_axis[self.indices], self.qdt._get_coupling(f=self.frequency[self.indices])/1e9, plotter=pl, color="red")
line(self.freq_axis[self.indices], self.qdt._get_fFWHM(f=self.frequency[self.indices])[2]/2.0/1e9, plotter=pl, color="red")
elif self.flux_axis_type=="yoko":
line(self.freq_axis[self.indices], self.qdt._get_VfFWHM(f=self.frequency[self.indices])[2]/2.0, pl=pl, color="red") #self.voltage_from_frequency(self.qdt._get_coupling(self.frequency)), plotter=pl, color="red")
else:
line(self.freq_axis[self.indices], self.qdt._get_fluxfFWHM(f=self.frequency[self.indices])[2]/2.0, pl=pl, color="red") #self.voltage_from_frequency(self.qdt._get_coupling(self.frequency)), plotter=pl, color="red")
if self.fitter.p_guess is not None:
line(self.freq_axis[self.flat_indices], array([pg[0] for pg in self.fitter.p_guess]), pl=pl, color="green") #self.voltage_from_frequency(self.qdt._get_coupling(self.frequency)), plotter=pl, color="red")
return pl
示例6: flux_plots
def flux_plots():
data=npr.read()
frequency=linspace(3.5e9, 7.5e9, 1000)
freq=append(frequency/1e9, frequency/1e9)
freq=append(freq, freq)
qdt.gate_type="constant" #"capacitive"
V=qdt._get_Vfq0_many(f=frequency)[1]
#pl1=scatter(data[:, 0], data[:, 1], fig_width=6.0, fig_height=4.0, color="red", pl="fitVvsf")
#line(freq, V, pl=pl1, ylabel="Yoko (V)", xlabel="Frequency (GHz)")
#pl1.add_label("a)")
#V2=ideal_qdt._get_Vfq0_many(f=frequency)[1]
#pl2=scatter(data[:, 0], data[:, 1], fig_width=6.0, fig_height=4.0, color="red", pl="idealVvsf")
#line(freq, V2, pl=pl2, ylabel="Yoko (V)", xlabel="Frequency (GHz)")
#pl2.add_label("b)")
flux=qdt._get_flux_over_flux0(voltage=data[:,1], offset=a.offset, flux_factor=a.flux_factor)
pl3=scatter(flux, data[:, 0], color="red", pl=pl,)
# auto_xlim=False, x_min=-3, x_max=3)
flux=qdt._get_flux_over_flux0(V, offset=a.offset, flux_factor=a.flux_factor)
line(flux, freq, pl=pl3, xlabel="$\Phi/\Phi_0$ ", ylabel="Frequency (GHz) ", color ="red")
voltage=linspace(-6,6, 1001)
flux=qdt._get_flux_over_flux0(voltage=voltage, offset=a.offset, flux_factor=a.flux_factor)
line(flux, qdt._get_flux_parabola(voltage=voltage, ng=0.0)/1e9, pl=pl, color="green")#.show()
#pl3.add_label("c)")
#pl4=scatter(data[:, 1], data[:, 0], fig_width=6.0, fig_height=4.0, color="red", pl="idealfvsV")
#line(V2, freq, pl=pl4, xlabel="Yoko (V)", ylabel="Frequency (GHz)")
#pl4.add_label("d)")
#pls=[pl1, pl2, pl3, pl4]
#for pl in pls:
pl.axes.set_xticks(linspace(-1, 1, 3))
pl.axes.set_yticks(linspace(4, 7, 4))
return pl3 #[pl1, pl2, pl3, pl4]
示例7: lgf_test_plot
def lgf_test_plot(self, pl="lgf_test", **kwargs):
"""test plot of legendre functions to legendre polynomials using Legendre class"""
nu_max=30
v_arr=linspace(-1.0, nu_max, 1000)
print "start plot"
pl=line(v_arr, self.Pv(v_arr, 0.0), pl=pl, color="blue", linewidth=0.5, label=r"$P_{\nu}(0)$")
line(v_arr, self.Pv(v_arr, 0.25), pl=pl, color="red", linewidth=0.5, label=r"$P_{\nu}(0.25)$")
line(v_arr, self.Pv(v_arr, 0.5), pl=pl, color="green", linewidth=0.5, label=r"$P_{\nu}(0.5)$")
line(v_arr, self.Pv(v_arr, 0.75), pl=pl, color="purple", linewidth=0.5, label=r"$P_{\nu}(0.75)$")
print "stop plot"
if 1:
for nu in range(nu_max):
scatter(array([nu]), array([legendre(nu)(0.0)]), pl=pl, color="blue", marker_size=3.0)
scatter(array([nu]), array([legendre(nu)(0.25)]), pl=pl, color="red", marker_size=3.0)
scatter(array([nu]), array([legendre(nu)(0.5)]), pl=pl, color="green", marker_size=3.0)
scatter(array([nu]), array([legendre(nu)(0.75)]), pl=pl, color="purple", marker_size=3.0)
pl.xlabel=r"$\nu$"
pl.ylabel=r"$P_{\nu}(x)$"
pl.legend()
pl.set_ylim(-0.75, 1.5)
return pl
示例8: plot_widths
def plot_widths(self, plotter=None):
print "first fit"
#tstart=time()
#fq_vec=array([sqrt(f*(f-2*self.qdt._get_Lamb_shift(f=f))) for f in self.frequency])
#fit_p=self.fano_fit(263, fq_vec)
#print self.p_guess, fit_p
#fit=lorentzian(fq_vec, fit_p[1:])
#pl, pf=line(fq_vec, self.MagAbsFilt_sq[263, :])
#line(fq_vec, fit, plotter=pl, color="red")
#pl.show()
print self.ls_f.shape, self.yoko.shape
fit_params=self.full_fano_fit(self.fq)
print (fit_params[1, :]).shape
pl, pf=scatter(self.frequency[self.indices], absolute(fit_params[1, :]), color="red", label=self.name, plot_name="widths_{}".format(self.name))
line(self.frequency, self.qdt._get_coupling(self.frequency)+0*1.8e6, plotter=pl)
return pl
示例9: lgf_plot
def lgf_plot(pl="legendre", **kwargs):
"""test plot of legendre functions compared to legendre polynomials"""
nu_max=30
v_arr=linspace(-1.0, nu_max, 1000)
print "start plot"
pl=line(v_arr, lgf_arr(v_arr, 0.0), pl=pl, color="blue", linewidth=0.5, label=r"$P_{\nu}(0)$")[0]
line(v_arr, lgf_arr(v_arr, 0.25, nu_max), pl=pl, color="red", linewidth=0.5, label=r"$P_{\nu}(0.25)$")
line(v_arr, lgf_arr(v_arr, 0.5, nu_max), pl=pl, color="green", linewidth=0.5, label=r"$P_{\nu}(0.5)$")
line(v_arr, lgf_arr(v_arr, 0.75, nu_max), pl=pl, color="purple", linewidth=0.5, label=r"$P_{\nu}(0.75)$")
print "stop plot"
for nu in range(nu_max):
scatter(array([nu]), array([legendre(nu)(0.0)]), pl=pl, color="blue")
scatter(array([nu]), array([legendre(nu)(0.25)]), pl=pl, color="red")
scatter(array([nu]), array([legendre(nu)(0.5)]), pl=pl, color="green")
scatter(array([nu]), array([legendre(nu)(0.75)]), pl=pl, color="purple")
pl.xlabel=r"$\nu$"
pl.ylabel=r"$P_{\nu}(x)$"
pl.legend()
pl.set_ylim(-0.75, 1.5)
return pl
示例10: phase_ed
def phase_ed(self):
return a.frequency[a.indices]/1e9, angle(a.Magcom[:,1]*exp(1j*a.frequency[a.indices]*self.ed))#+a.frequency[0]*self.ed
a.filter_type="FFT"
b=ElectricalDelay()
b.plotter
pl=colormesh(angle(a.Magcom[a.flat_indices].transpose()*exp(1j*a.frequency[a.flat_indices]*b.ed)))
a.MagAbsFit
print a.fitter.fit_params
#colormesh(-0.5+1.5/6.0*angle([1.0-1.0/(1.0+1.0j*(a.yoko-absolute(fp[1]))/absolute(fp[0])) for n, fp in enumerate(a.fitter.fit_params)]).transpose(), pl=pl)#a.fitter.fit_params[0]))
#b.show()
#print diff(a.Phase[0, :])
from numpy import unwrap
scatter(unwrap(a.Phase[:,0], discont=3)).show()
line(diff(a.Phase[:,0])).show()
#pl=a.magabs_colormesh()#magabs_colormesh3(s3a4_wg)
#pl=a.hann_ifft_plot()
#pl=a.ifft_plot()
#a.filt_compare(a.on_res_ind)
#filt=filt_prep(601, s3a4_wg.filt_start_ind, s3a4_wg.filt_end_ind)
#line(filt*0.001, plotter=pl)
#colormesh(s3a4_wg.MagAbsFilt)#, plotter="magabsfilt_{}".format(self.name))
pl=a.magabs_colormesh()
#a.phase_colormesh()#.show()
a.filter_type="FFT"
#a.filt.filter_type="FFT"
pl=a.magabs_colormesh()
示例11: plot_widths
def plot_widths(self, plotter=None):
fit_params=self.full_fano_fit()
scatter(fit_params[0, :], absolute(fit_params[1, :]), color="red", label=self.name, plot_name="widths_{}".format(self.name), plotter=plotter)
示例12: widths_plot
def widths_plot(self, pl=None):
scatter(self.frequency[self.indices]/1e9, absolute([fp[0] for fp in self.fit_params]), plotter=pl)
line(self.frequency/1e9, self.qdt._get_coupling(self.frequency), plotter=pl, color="red")
return pl
示例13: line
fig_width=7.2
fig_height=5.0
c.save_folder.main_dir="sup_fig2_for_TA88"
if __name__=="__main__":
nskip=50
d0527.read_data()
magfilt88=MagcomFilt88(d0527)
magabs88=absolute(magfilt88)
#line(d0527.frequency/1e9, magabs88)
pl88=scatter(d0527.frequency[::nskip]/1e9, 20.0*log10(magabs88[::nskip])-bg_A4(d0527.frequency[::nskip]),
facecolor="blue", edgecolor="blue", pl=pl88, nrows=2, ncols=3, nplot=1,
fig_width=fig_width, fig_height=fig_height, marker_size=10)
(S11, S12, S13,
S21, S22, S23,
S31, S32, S33)=idt88._get_simple_S(f=d0527.frequency)
S13xS31=S13*S31
print idt88.Np, idt88.K2
print idt88.f0
print d0527.comment
print -d0527.fridge_atten+d0527.fridge_gain-d0527.rt_atten+d0527.rt_gain-10
line(d0527.frequency/1e9, 20*log10(absolute(S13xS31))-4, color="red", pl=pl88,
auto_ylim=False, y_min=-40, y_max=0,
auto_xlim=False, x_min=4.2, x_max=4.7, xlabel="Frequency (GHz)",
ylabel="Transmission (dB)", linewidth=1.0,
示例14: argers
return data
#print argers(gamma/2.0)
gamma_frac=linspace(0.5, 20.0, 1001)
gd=gamma/gamma_frac
#print array([argers(g)[-1] for g in gd])
pl1=line(gd*Np/f0*2*pi, array([argers(g)[-1] for g in gd])/f0, pl=pl,
auto_xlim=False, x_min=0.0, x_max=20.0,
auto_ylim=False, y_min=0.8, y_max=1.2,
xlabel="$N_p\Gamma_0/f_0$", ylabel="Frequency ($f_0$)", color="red")
pl1=line(gd*Np/f0*2*pi, array([argers(g)[-2] for g in gd])/f0, pl=pl, color="red")
#pl1=line(gd*Np/f0*2*pi, array([argers(g)[0] for g in gd])/f0, pl=pl)
line(array([0.0, 20.0]), array([1.0, 1.0]), color="green", pl=pl)
scatter(array([1.0, 1.0])*gamma*Np/f0*2*pi, array([4.85, 5.75])/f0, pl=pl, marker_size=3.0)
#scatter(array([1.0, 1.0, 1.0])*gamma*Np/f0*2*pi, array([5.694, 5.414, 4.784])/f0, pl=pl, marker_size=3.0)
scatter(array([2.9,]), array([1.0]), pl=pl, marker_size=3.0, facecolor="black", edgecolor="black")
pl.axes.set_xticks(linspace(0, 20, 5))
pl.axes.set_yticks(linspace(0.8, 1.2, 5))
# def coup(G):
# inner=(1.0/3.0-5.0/(2*pi*9*G))*15
# if inner<0:
# return 0.0
# return sqrt(inner)
#
# from numpy import sin
# f0=qdt.f0/1e9
示例15: Coil_Lyzer
#self.filt.N=len(self.frequency)
class Coil_Lyzer(TA88_Lyzer):
current=Array().tag(unit="V", plot=True, label="Current", sub=True)
a=Coil_Lyzer(read_data=read_data,
rd_hdf=TA88_Read(main_file="Data_1011/test_coil_setup_overnight.hdf5"))
a.read_data()
#print a.yoko
#print a.current
pf=polyfit(a.yoko, a.current, 3)
print pf
p=poly1d(pf)
pl=scatter(a.yoko, a.current)
line(a.yoko, p(a.yoko), pl=pl)#.show()
#pl=scatter(a.yoko, a.current)
endskip=0
mean_yoko=(a.yoko[1500-endskip:500+endskip:-1]+a.yoko[1500+endskip:2500-endskip]+a.yoko[3500-endskip:2500+endskip:-1]+a.yoko[3500+endskip:4500-endskip])/4.0
mean_current=(a.current[1500-endskip:500+endskip:-1]+a.current[1500+endskip:2500-endskip]+a.current[3500-endskip:2500+endskip:-1]+a.current[3500+endskip:4500-endskip])/4.0
#mean_current=(a.current[1499:501:-1]+a.current[1501:2499]+a.current[3499:2501:-1]+a.current[3501:4499])/4.0
line(a.yoko, a.current-p(a.yoko))#.show()
line(a.yoko)
line(a.yoko[a.yoko<5.9], a.current[a.yoko<5.9]-interp(a.yoko[a.yoko<5.9], mean_yoko, mean_current)).show()
line(a.yoko, a.current-interp(a.yoko, a.yoko[1500:500:-1], a.current[1500:500:-1])).show()
line(a.yoko[a.yoko<5.9], a.current-interp(a.yoko, a.yoko[1500:2500], a.current[1500:2500])).show()