Changing scale on axes (matplotlib)

33 views Asked by At
x, y, z = np.mgrid[xx[0]:xx[-1]:complex(0, nx), yy[0]:yy[-1]:complex(0, ny), zz[0]:zz[-1]:complex(0, nz)]


extent1 = [x.min(), x.max(), z.min(), z.max()]
extent2 = [y.min(), y.max(), z.min(), z.max()]
extent3 = [x.min(), x.max(), y.min(), y.max()]

time_index = 15

# Make 2D cuts along the x-z plane
plt.figure(figsize=(16, 4))

# x-z plane
plt.subplot(131)
plt.imshow(By_side[:, :, time_index], cmap='plasma', origin='lower', extent= extent1, interpolation = 'nearest' )
plt.colorbar(label='Magnetic field strength')
plt.title('By from the side at t=15 sec.')
plt.xlabel('X')
plt.ylabel('Z')

# y-z plane
plt.subplot(132)
plt.imshow(By_front[:, :, time_index].T, cmap='plasma', origin='lower', extent= extent2)
plt.colorbar(label='Data')
plt.title('By  from the front at t=15 sec')
plt.xlabel('Y')
plt.ylabel('Z')

# x-y plane
# x-y plane
plt.subplot(133)
plt.imshow(Bz_top[:, :, time_index], cmap='viridis', origin='lower', extent=extent3)
plt.colorbar(label='Data')
plt.title('Bz component from the top at t=15')
plt.xlabel('X')
plt.ylabel('Y')




plt.tight_layout()
plt.show()

enter image description here

This is my code in python! It runs well but I want to zoom in to the center of the magnetic field components that I have, to be more cleared and more detailed! How I change my size?

I try to change the figsize but it doesn't work. As a beginner in python some things with sizes and arrays still confuse me. Can I get any help? Thanks!!

0

There are 0 answers