import matplotlib.pyplot as plt
import numpy as np
N = 64 # resolution N x 3N
boxsizeX = 0.5
boxsizeY = 1.5
dx = boxsizeX / N
vol = dx**2
xlin = np.linspace(0.5*dx, boxsizeX-0.5*dx, N)
ylin = np.linspace(0.5*dx, boxsizeY-0.5*dx, 3*N)
Y, X = np.meshgrid( ylin, xlin )
rho = 1. + (Y > 0.75)
fig = plt.figure(figsize=(4,4), dpi=80)
plt.cla()
plt.imshow(rho.T)
using Plots
N = 64 # resolution N x 3N
boxsizeX = 0.5
boxsizeY = 1.5
dx = boxsizeX / N
vol = dx^2
xlin = range(0.5*dx, boxsizeX-0.5*dx,length=N)
ylin = range(0.5*dx, boxsizeY-0.5*dx, length=3*N)
ρ=(0*xlin').+(ylin.>0.75).+1
heatmap(ρ)
1 Like
heatmap() is incredibly slow for large data sets in Julia.
there should be a possibility of using python’s imshow()
but I have no idea how to change the color map and aspect ratio using actual pythonplots