import os
import glob

import yt

model = 'spruit'
datadir = os.path.expanduser('~/mhs_atmosphere/'+model+'/')

files = glob.glob(datadir+'/*')
files.sort()

print(files)


ds = yt.load(files[0])

slc = yt.SlicePlot(ds, normal='y', fields='density_bg')
slc.save('~/yt.png')
import os
import glob

import yt

model = 'spruit'
datadir = os.path.expanduser('~/mhs_atmosphere/'+model+'/')

files = glob.glob(datadir+'/*')
files.sort()

print(files)


ds = yt.load(files[0])

# uncomment for axis swapping for normal='y'
ds.coordinates.x_axis = {0: 2, 1: 0, 2: 1, 'x': 2, 'y': 0, 'z': 1}
ds.coordinates.y_axis = {0: 1, 1: 2, 2: 0, 'x': 1, 'y': 2, 'z': 0}

slc = yt.SlicePlot(ds, normal='y', fields='density_bg')
slc.save('~/yt.png')
Add in axes swapping for normal='y'
Add in axes swapping for normal='y'

  import os
  import glob
  
  import yt
  
  model = 'spruit'
  datadir = os.path.expanduser('~/mhs_atmosphere/'+model+'/')
  
  files = glob.glob(datadir+'/*')
  files.sort()
  
  print(files)
  
  
  ds = yt.load(files[0])
  
+ # uncomment for axis swapping for normal='y'
+ ds.coordinates.x_axis = {0: 2, 1: 0, 2: 1, 'x': 2, 'y': 0, 'z': 1}
+ ds.coordinates.y_axis = {0: 1, 1: 2, 2: 0, 'x': 1, 'y': 2, 'z': 0}
+ 
  slc = yt.SlicePlot(ds, normal='y', fields='density_bg')
  slc.save('~/yt.png')
Add in axes swapping for normal='y'
## Code Before:
import os
import glob

import yt

model = 'spruit'
datadir = os.path.expanduser('~/mhs_atmosphere/'+model+'/')

files = glob.glob(datadir+'/*')
files.sort()

print(files)


ds = yt.load(files[0])

slc = yt.SlicePlot(ds, normal='y', fields='density_bg')
slc.save('~/yt.png')
## Instruction:
Add in axes swapping for normal='y'
## Code After:
import os
import glob

import yt

model = 'spruit'
datadir = os.path.expanduser('~/mhs_atmosphere/'+model+'/')

files = glob.glob(datadir+'/*')
files.sort()

print(files)


ds = yt.load(files[0])

# uncomment for axis swapping for normal='y'
ds.coordinates.x_axis = {0: 2, 1: 0, 2: 1, 'x': 2, 'y': 0, 'z': 1}
ds.coordinates.y_axis = {0: 1, 1: 2, 2: 0, 'x': 1, 'y': 2, 'z': 0}

slc = yt.SlicePlot(ds, normal='y', fields='density_bg')
slc.save('~/yt.png')