Skip to content

Commit

Permalink
Add histograms of areaCell and dcEdge to init plots
Browse files Browse the repository at this point in the history
  • Loading branch information
xylar committed May 9, 2024
1 parent dae9a81 commit 587fb78
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions compass/ocean/plot.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import xarray
import xarray.plot
import numpy as np
import datetime

import matplotlib.pyplot as plt
import numpy as np
import xarray
import xarray.plot
from matplotlib.font_manager import FontProperties


Expand Down Expand Up @@ -109,6 +110,24 @@ def plot_initial_state(input_file_name='initial_state.nc',
txt = '{}{:9.2e} {:9.2e} {}\n'.format(txt, var.min().values,
var.max().values, varName)

plt.subplot(3, 3, 8)
varName = 'areaCell'
var = ds[varName]
xarray.plot.hist(1e-6 * var, bins=100, log=True)
plt.ylabel('frequency')
plt.xlabel(r'cell area (km$^2$)')
txt = '{}{:9.2e} {:9.2e} {}\n'.format(txt, var.min().values,
var.max().values, varName)

plt.subplot(3, 3, 9)
varName = 'dcEdge'
var = ds[varName]
xarray.plot.hist(1e-3 * var, bins=100, log=True)
plt.ylabel('frequency')
plt.xlabel(r'dcEdge: cell-to-cell great-circle distance (km)')
txt = '{}{:9.2e} {:9.2e} {}\n'.format(txt, var.min().values,
var.max().values, varName)

font = FontProperties()
font.set_family('monospace')
font.set_size(12)
Expand Down

0 comments on commit 587fb78

Please sign in to comment.