Skip to content

Commit e44f534

Browse files
committed
Update K'gari transect example
1 parent 29658c4 commit e44f534

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

docs/_static/images/kgari-path.png

7.87 KB
Loading
2.76 KB
Loading

docs/examples/kgari-transect.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import emsarray
55
from emsarray import plot, transect
66

7-
dataset_url = 'https://thredds.nci.org.au/thredds/dodsC/fx3/model_data/gbr4_bgc_GBR4_H2p0_B2p0_Chyd_Dcrt.ncml'
7+
dataset_url = 'https://thredds.nci.org.au/thredds/dodsC/fx3/gbr4_H4p0_ABARRAr2_OBRAN2020_FG2Gv3_Dhnd/gbr4_simple_2022-10-31.nc'
88
dataset = emsarray.open_dataset(dataset_url).isel(time=-1)
99
dataset = dataset.ems.select_variables(['botz', 'temp'])
1010

@@ -34,7 +34,9 @@
3434
dataset, line, dataset['temp'],
3535
figsize=(7.9, 3),
3636
bathymetry=dataset['botz'],
37-
landmarks=landmarks)
37+
landmarks=landmarks,
38+
title="Temperature",
39+
cmap='Oranges_r')
3840
figure.savefig('kgari-transect.png')
3941

4042
# Plot the path of the transect
@@ -43,14 +45,15 @@
4345
axes.set_aspect(aspect='equal', adjustable='datalim')
4446
axes.set_title('Transect path')
4547
axes.add_collection(dataset.ems.make_poly_collection(
46-
dataset['botz'], cmap='Blues_r', edgecolor='face',
48+
dataset['botz'], cmap='Blues', clim=(0, 2000), edgecolor='face',
4749
linewidth=0.5, zorder=0))
50+
axes = figure.axes[0]
51+
axes.set_extent(plot.bounds_to_extent(line.envelope.buffer(0.2).bounds))
52+
axes.plot(*line.coords.xy, zorder=2, c='orange', linewidth=4)
53+
4854
plot.add_coast(axes, zorder=1)
4955
plot.add_gridlines(axes)
5056
plot.add_landmarks(axes, landmarks)
51-
axes = figure.axes[0]
52-
axes.set_extent(plot.bounds_to_extent(line.envelope.buffer(0.2).bounds))
53-
axes.plot(*line.coords.xy, zorder=2)
5457
figure.savefig('kgari-path.png')
5558

5659
pyplot.show(block=True)

0 commit comments

Comments
 (0)