def plot(save=False): shell.close('all') x = fetch() #.reshape((len(tau),4)) x1 = x[0] x2 = x[1] shell.figure() shell.plot(tau, x1) shell.hold(True) shell.plot(tau, x2, "b-") #fitPoints = hahnFit( tau,x1) #shell.plot(tau,fitPoints(tau), "r-") shell.xtitle('tau [ns]') shell.ytitle('counts [a.u.]') shell.figure(title='ratio') shell.plot(tau, x[0] / x[1]) shell.xtitle('tau [ns]') shell.ytitle('normalized fluorescence [a.u.]') shell.figure(title='difference') shell.plot(tau, x[0] - x[1]) if save: np.savetxt("BP/Results/hahn1.txt", x1) np.savetxt("BP/Results/hahn2.txt", x2) np.savetxt("BP/Results/hahnTau.txt", tau)
def plot(): shell.close('all') x=fetch().reshape((len(tau),4)) shell.plot(tau,x[:,0],'-b') shell.hold(True) shell.plot(tau,x[:,1],'-r') shell.plot(tau,x[:,2],'-g') shell.plot(tau,x[:,3],'-c')
def plot(save=False): shell.close('all') x = fetch() #.reshape((len(tau),4)) shell.figure() shell.plot(tau, x) shell.hold(True) fitPoints = rabiFit(tau, x) shell.plot(tau, fitPoints(tau), "r-") shell.xtitle('tau [ns]') shell.ytitle('counts [a.u.]') if save: np.savetxt("BP/Results/Rabi.txt", x) np.savetxt("BP/Results/RabiTau.txt", tau) np.savetxt("BP/Results/RabiFit.txt", fitPoints(tau))
"""This example shows how to create a scatter plot using the `shell` package. """ # Major library imports from numpy import linspace, random, pi # Enthought library imports from chaco.shell import plot, hold, title, show # Create some data x = linspace(-2*pi, 2*pi, 100) y1 = random.random(100) y2 = random.random(100) # Create some scatter plots plot(x, y1, "b.") hold(True) plot(x, y2, "g+", marker_size=2) # Add some titles title("simple scatter plots") # This command is only necessary if running from command line show()
# Mayor Library imports from numpy import linspace, random, pi # Enthought library imports from chaco.shell import plot, hold, title, show # Create some data x = linspace(-2 * pi, 2 * pi, 100) y1 = random.random(100) y2 = random.random(100) # Create some scatter plots plot(x, y1, "b.") hold() plot(x, y2, "g+", marker_size=2) # Add some titles title("simple scatter plots") # This command is only necessary if running from command line show()
""" This example displays some line plots in different colors and styles using the chaco.shell subpackage. The functions in the chaco.shell package allow us to quickly generate plots with some basic interactivity without using the object-oriented core of Chaco. """ from numpy import linspace, pi, sin, cos from chaco.shell import plot, hold, title, show # Create some data x = linspace(-2 * pi, 2 * pi, 100) y1 = sin(x) y2 = cos(x) # Create some line plots using the plot() command and using # Matlab-style format specifiers plot(x, y1, "b-", bgcolor="white") hold() plot(x, y2, "g-.", marker_size=2) # Set the plot title title("simple line plots") # If running this from the command line and outside of a wxPython # application or process, the show() command is necessary to keep # the plot from disappearing instantly. If a wxPython mainloop # is already running, then this command is not necessary. show()