Esempio n. 1
0
def example_plot_contour():
    # inspired by http://stackoverflow.com/questions/10291221/axis-limits-for-scatter-plot-not-holding-in-matplotlib
    # random data
    x = np.random.randn(50)
    y = np.random.randn(100)

    X, Y = np.meshgrid(y, x)
    Z1 = plt.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
    Z2 = plt.bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
    Z = 10 * (Z1 - Z2)

    plot_contour(Z,x,y,title='example_plot_contour',xtitle='x-stuff',ytitle='y-stuff',plot_points=1,show=1)
Esempio n. 2
0
def example_plot_contour():
    # inspired by http://stackoverflow.com/questions/10291221/axis-limits-for-scatter-plot-not-holding-in-matplotlib
    # random data
    x = np.random.randn(50)
    y = np.random.randn(100)

    X, Y = np.meshgrid(y, x)
    Z1 = plt.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
    Z2 = plt.bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
    Z = 10 * (Z1 - Z2)

    plot_contour(Z,
                 x,
                 y,
                 title='example_plot_contour',
                 xtitle='x-stuff',
                 ytitle='y-stuff',
                 plot_points=1,
                 show=1)
Esempio n. 3
0
sim_fix_count = 500

##### STEP B. #####
# Create 2D Gaussian Mask template as a 2D numpy array
#
# Create x and y pixel ranges for Gauss Mask.
#
x = np.arange(-sigma_x * 2.5, sigma_x * 2.5, 1)
y = np.arange(-sigma_y * 2.5, sigma_y * 2.5, 1)
# Create X and Y pixel position values for each element of Gauss. Mask.
#
X, Y = np.meshgrid(x, y)
# Create 2D Gauss Mask as numpy array using X and Y mesh grid data
# and sigma's, with Gauss centered in 2D array (0,0)
#
gauss = plb.bivariate_normal(X, Y, sigma_x, sigma_y, 0, 0)
# Normalize the Gausian, such that the max value in the is 1.0.
#
gauss *= 1.0 / gauss.flatten().max()
ghw, ghh = gauss.shape[0] // 2, gauss.shape[1] // 2

##### STEP C. #####
# Load Background Image Displayed During Eye Data Collection
# Flip vertically
#
image_array = np.flipud(mpimg.imread("./images/canal.jpg"))
# Get background image size
#
image_size = image_array.shape  #(image_array.shape[0],image_array.shape[1])
ihw, ihh = image_size[0] / 2, image_size[1] / 2
Esempio n. 4
0
sim_fix_count=500
 
##### STEP B. #####
# Create 2D Gaussian Mask template as a 2D numpy array
#
# Create x and y pixel ranges for Gauss Mask.
#
x = np.arange(-sigma_x*2.5,sigma_x*2.5, 1)
y = np.arange(-sigma_y*2.5, sigma_y*2.5, 1)
# Create X and Y pixel position values for each element of Gauss. Mask.
#
X, Y = np.meshgrid(x, y)
# Create 2D Gauss Mask as numpy array using X and Y mesh grid data
# and sigma's, with Gauss centered in 2D array (0,0)
#
gauss=plb.bivariate_normal(X, Y, sigma_x, sigma_y, 0,0)
# Normalize the Gausian, such that the max value in the is 1.0.
#
gauss*=1.0/gauss.flatten().max()
ghw,ghh=gauss.shape[0]//2,gauss.shape[1]//2

##### STEP C. #####
# Load Background Image Displayed During Eye Data Collection 
# Flip vertically
#
image_array=np.flipud(mpimg.imread("./images/canal.jpg"))    
# Get background image size
#
image_size=image_array.shape#(image_array.shape[0],image_array.shape[1])
ihw,ihh=image_size[0]/2,image_size[1]/2