Exemple #1
0
def jm_set_Ylim_ticks(myMin=-1,myMax=1):
    myYlocs=pl.linspace(round(myMin,1),round(myMax,1),5)
    myLocator = pl.FixedLocator(myYlocs)
    ax=pl.gca()
    ax.yaxis.set_major_locator( myLocator )
    pl.ylim(myMin,myMax)
    jm_clip_Yticks()
Exemple #2
0
           vectorPotential[j, k] = trapz(g[j, :k]*B2[j, :k], dx=DX1) - trapz(g[:j, k]*B1[:j, k], dx=DX2)
            
    return vectorPotential

XMin = 0
XMax = 25
YMin = -25
YMax = 25

R_grid, THETA_grid = np.meshgrid(R[NG:-NG], THETA[NG:-NG])
X = R_grid*np.sin(THETA_grid)
Y = R_grid*np.cos(THETA_grid)
alpha = np.sqrt(-gCon[:,:,0,0])**(-1)
PolGamma = 4./3

minorLocatorX   = pl.FixedLocator(np.linspace(0,60,13))
minorLocatorY   = pl.FixedLocator(np.linspace(-20,20,9))
majorLocatorX   = pl.FixedLocator(np.linspace(0,60,7))
majorLocatorY   = pl.FixedLocator(np.linspace(-20,20,5))

for file_number, dump_file in yt.parallel_objects(enumerate(data_files)):

    print "File number = ", file_number
    frame_index = file_number

    data_file = h5py.File(dump_file, "r")
    primVars  = data_file['primVars']

    elem = returnFluidElement(primVars)
    A_plot = returnMagneticVectorPotential(elem)
    N_start = 1
Exemple #3
0
 pylab.rcParams['text.latex.preamble'] = [
     r'\usepackage{helvet}', r'\usepackage{sansmath}', r'\sansmath'
 ]
 unique_energy = np.asarray(unique_energy) - unique_energy[0]
 fig = pylab.figure(figsize=(4, 7))
 #pylab.rc('lines',linewidth=1.5)
 rcParams['axes.linewidth'] = 1.5
 rcParams['lines.linewidth'] = 1.5
 rcParams['ytick.major.size'] = 12
 rcParams['ytick.major.width'] = 1.5
 rcParams['ytick.minor.size'] = 5
 rcParams['ytick.minor.width'] = 1.5
 canvas = fig.add_subplot(1, 1, 1)
 pylab.minorticks_on()
 canvas.yaxis.set_minor_locator(
     pylab.FixedLocator(np.arange(-0.5, 6, 1)))
 for i, eg in enumerate(unique_energy):
     energies = []
     domain = []
     energies.append(eg)
     domain.append(-0.5)
     energies.append(eg)
     domain.append(+0.5)
     pylab.plot(domain, energies, color="red")
     try:
         J = unique_js[i]
     except:
         J = 0
     if eg < 6:
         if smObj.nparticles % 2 != 0:
             canvas.annotate(str(int(J * 2)) + '/2+',
K_prime1_area_dict = area_level_dict(K_prime1_dict, M_base.N)

dev_areas_matrix = np.zeros((len(area_list), len(area_list)))
for ii, area1 in enumerate(area_list[::-1]):
    for jj, area2 in enumerate(area_list):
        dev_areas_matrix[ii][jj] = (
            (K_prime1_area_dict[area1][area2] - M_base.K_areas[area1][area2]) /
            sum(K_prime1_area_dict[area1].values()))

clim = max(abs(np.min(dev_areas_matrix)), abs(np.max(dev_areas_matrix)))
im = ax.pcolormesh(dev_areas_matrix, cmap=cmap, vmin=-clim, vmax=clim)
ax.set_xlim((0, 32))
ax.set_ylim((0, 32))

ax.set_xticks([0.5, 3.5, 14.5, 24.5, 28.5])
ax.xaxis.set_major_locator(pl.FixedLocator([0, 1, 4, 9, 24, 31]))
ax.xaxis.set_major_formatter(pl.NullFormatter())
ax.xaxis.set_minor_locator(pl.FixedLocator([0.5, 2.5, 6.5, 16.5, 27.5, 31.5]))
ax.set_xticklabels([8, 7, 6, 5, 4, 2], minor=True)
ax.tick_params(axis='x', which='minor', length=0.)
ax.set_xlabel('Arch. type', labelpad=-0.3)

ax.set_yticks([0.5, 3.5, 14.5, 24.5, 28.5])
ax.yaxis.set_major_locator(pl.FixedLocator([0, 1, 4, 9, 24, 31]))
ax.yaxis.set_major_formatter(pl.NullFormatter())
ax.yaxis.set_minor_locator(pl.FixedLocator([0.5, 4.5, 15.5, 25.5, 28.5, 31.5]))
ax.set_yticklabels([2, 4, 5, 6, 7, 8], minor=True)
ax.tick_params(axis='y', which='minor', length=0.)
ax.set_ylabel('Arch. type')

t = pl.FixedLocator([-0.1, -0.05, 0, 0.05, 0.1])
        plot.min_pass_vector(),  # y axis
        linestyle="dashed",
        color="xkcd:lime green",
        alpha=0.21,  # make transparent
    )
    plt.plot(  # max bound
        users,  # x axis
        plot.max_pass_vector(),  # y axis
        linestyle="dashed",
        color="xkcd:lime green",
        alpha=0.21,  # make transparent
    )
    ax = plt.gca()
    ax.fill_between(  # shade region for data range
        users,  # x axis
        plot.min_pass_vector(),  # y min
        plot.max_pass_vector(),  # y max
        color="xkcd:lime green",
        alpha=0.21,  # make transparent
    )
    plt.suptitle(plot.name, fontsize=18)
    plt.title(" | ".join([TITLE, plot.subtitle]), fontsize=14)
    plt.xlabel(XLABEL)
    ax.set_xlim([1, 30])
    ax.xaxis.set_major_locator(
        plt.FixedLocator([1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 30]))
    ax.xaxis.set_minor_locator(plt.FixedLocator(np.arange(1, 31, 1)))
    plt.ylabel(YLABEL)
    ax.set_ylim([0, 100])
    plt.savefig("{}.png".format(plot.file_name), bbox_inches="tight")
Exemple #6
0
    ax.yaxis.set_ticks_position('none')
    ax.xaxis.set_ticks_position('bottom')

    matrix = np.zeros((len(area_list), 8))
    for i, area in enumerate(area_list):
        mask = create_vector_mask(M_base.structure, areas=[area])
        m = np.real(uc[mask])
        if area == 'TH':
            m = np.insert(m, 2, 0.0)
            m = np.insert(m, 2, 0.0)
        matrix[i, :] = m[::-1]
    matrix = np.transpose(matrix)

    im = ax.pcolormesh(matrix, vmin=-1., vmax=1., cmap=cmap2)
    ax.set_xlim((0, 32))
    t = pl.FixedLocator(np.arange(-1., 1.01, 0.5))
    pl.colorbar(im, ticks=t)

    ax.set_xticks([0.5, 3.5, 14.5, 24.5, 28.5])
    ax.xaxis.set_major_locator(pl.FixedLocator([0, 1, 4, 9, 24, 31]))
    ax.xaxis.set_major_formatter(pl.NullFormatter())
    ax.xaxis.set_minor_locator(
        pl.FixedLocator([0.5, 2.5, 6.5, 16.5, 27.5, 31.5]))
    ax.set_xticklabels([8, 7, 6, 5, 4, 2], minor=True)
    ax.tick_params(axis='x', which='minor', length=0.)
    ax.set_xlabel('Arch. type', labelpad=-0.1)

    y_index = list(range(len(MAM.structure['V1'])))
    y_index = [a + 0.5 for a in y_index]

    ax.set_yticks(y_index)