Skip to content

Commit

Permalink
update examples with graticule, change default lon_step=45 (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjlittle authored Jul 8, 2023
1 parent 460f32a commit c15f90f
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 13 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ plotter.add_mesh(
)
plotter.add_base_layer(texture=gv.natural_earth_hypsometric())
plotter.add_coastlines(resolution="10m")
plotter.add_graticule(lon_step=45)
plotter.add_graticule()
plotter.view_xy(negative=True)
plotter.add_axes()
plotter.show()
Expand Down Expand Up @@ -260,7 +260,7 @@ sargs = {"title": f"{sample.name} / {sample.units}"}
plotter.add_mesh(mesh, scalar_bar_args=sargs)
plotter.add_coastlines()
plotter.add_base_layer(texture=gv.natural_earth_hypsometric())
plotter.add_graticule(lon_step=45)
plotter.add_graticule()
plotter.add_axes()
plotter.view_xy()
plotter.show()
Expand Down Expand Up @@ -304,7 +304,7 @@ sargs = {"title": f"{sample.name} / {sample.units}"}
plotter.add_mesh(mesh, scalar_bar_args=sargs)
plotter.add_coastlines()
plotter.add_base_layer(texture=gv.natural_earth_hypsometric())
plotter.add_graticule(lon_step=45)
plotter.add_graticule()
plotter.add_axes()
plotter.view_xy()
plotter.show()
Expand Down
3 changes: 2 additions & 1 deletion src/geovista/examples/from_unstructured__icosahedral.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def main() -> None:
Circulation Model (GCM) part of Institut Pierre-Simon Laplace (IPSL-CM) Earth
System Model. The data targets the mesh faces/cells.
Note that, Natural Earth coastlines are also rendered.
Note that, a graticule and Natural Earth coastlines are also rendered.
"""
# load the sample data
Expand All @@ -40,6 +40,7 @@ def main() -> None:
sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True}
plotter.add_mesh(mesh, scalar_bar_args=sargs)
plotter.add_coastlines()
plotter.add_graticule()
plotter.add_axes()
plotter.add_text(
"DYNAMICO Icosahedral (10m Coastlines)",
Expand Down
5 changes: 3 additions & 2 deletions src/geovista/examples/from_unstructured__icosahedral_poly.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def main() -> None:
Circulation Model (GCM) part of Institut Pierre-Simon Laplace (IPSL-CM) Earth
System Model. The data targets the mesh faces/cells.
Note that, Natural Earth coastlines are also rendered, and the mesh is transformed
to the Polyconic pseudo-conical projection.
Note that, a graticule and Natural Earth coastlines are rendered, and the
mesh is also transformed to the Polyconic pseudo-conical projection.
"""
# load the sample data
Expand All @@ -41,6 +41,7 @@ def main() -> None:
sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True}
plotter.add_mesh(mesh, scalar_bar_args=sargs)
plotter.add_coastlines()
plotter.add_graticule()
plotter.add_axes()
plotter.add_text(
f"DYNAMICO Icosahedral ({projection})",
Expand Down
5 changes: 3 additions & 2 deletions src/geovista/examples/from_unstructured__lfric_sst.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def main() -> None:
It uses an unstructured Met Office LFRic C48 cubed-sphere of surface temperature
data located on the mesh faces/cells.
Note that, a threshold is also applied to remove land NaN cells, and a
Natural Earth base layer is rendered along with Natural Earth coastlines.
Note that, a threshold is also applied to remove land NaN cells. A Natural Earth
base layer is also rendered along with Natural Earth coastlines and a graticule.
"""
# load the sample data
Expand All @@ -49,6 +49,7 @@ def main() -> None:
plotter.add_mesh(mesh, show_edges=True, scalar_bar_args=sargs)
plotter.add_base_layer(texture=gv.natural_earth_1())
plotter.add_coastlines()
plotter.add_graticule()
plotter.add_axes()
plotter.add_text(
"LFRic C48 Unstructured Cube-Sphere (10m Coastlines)",
Expand Down
9 changes: 5 additions & 4 deletions src/geovista/examples/from_unstructured__lfric_sst_bonne.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ def main() -> None:
It uses an unstructured Met Office LFRic C48 cubed-sphere of surface temperature
data located on the mesh faces/cells.
Note that, a threshold is also applied to remove land NaN cells, and a
Natural Earth base layer is rendered along with Natural Earth coastlines. The mesh
is also transformed to the Bonne projection.
Note that, a threshold is also applied to remove land NaN cells. A Natural Earth
base layer is also rendered along with Natural Earth coastlines and a graticule.
The mesh is also transformed to the Bonne projection.
"""
# load the sample data
Expand All @@ -45,11 +45,12 @@ def main() -> None:
mesh = mesh.threshold()

# plot the mesh
plotter = gv.GeoPlotter(crs=(projection := "+proj=bonne +lat_1=10"))
plotter = gv.GeoPlotter(crs=(projection := "+proj=bonne +lat_1=10 +lon_0=180"))
sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True}
plotter.add_mesh(mesh, show_edges=True, scalar_bar_args=sargs)
plotter.add_base_layer(texture=gv.natural_earth_1())
plotter.add_coastlines()
plotter.add_graticule()
plotter.add_axes()
plotter.add_text(
f"LFRic C48 Unstructured Cube-Sphere ({projection})",
Expand Down
2 changes: 1 addition & 1 deletion src/geovista/gridlines.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
LONGITUDE_START: float = BASE

#: The default step size between graticule meridians (degrees).
LONGITUDE_STEP: float = 30.0
LONGITUDE_STEP: float = 45.0

#: The period or upper bound (degrees) for meridian step size.
LONGITUDE_STEP_PERIOD: float = 180.0
Expand Down

0 comments on commit c15f90f

Please sign in to comment.