-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add latex and plot style utilities (#132)
* move figspec and latex utilities from mf6 examples repo * add matplotlib as optional dependency * update readme
- Loading branch information
Showing
10 changed files
with
714 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from modflow_devtools.figspec import USGSFigure | ||
|
||
|
||
def test_usgs_figure(): | ||
fig = USGSFigure() |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Plot styles | ||
|
||
Matplotlib is an optional dependency, installable via e.g. `pip install modflow_devtools[optional]`. | ||
|
||
## `USGSFigure` | ||
|
||
A convenience class `modflow_devtools.figspec.USGSFigure` is provided to create figures with the default USGS style sheet. For instance: | ||
|
||
```python | ||
# create figure | ||
fs = USGSFigure(figure_type="graph", verbose=False) | ||
|
||
# ...add some plots | ||
|
||
# add a heading | ||
title = f"Layer {ilay + 1}" | ||
letter = chr(ord("@") + idx + 2) | ||
fs.heading(letter=letter, heading=title) | ||
|
||
# add an annotation | ||
fs.add_annotation( | ||
ax=ax, | ||
text="Well 1, layer 2", | ||
bold=False, | ||
italic=False, | ||
xy=w1loc, | ||
xytext=(w1loc[0] - 3200, w1loc[1] + 1500), | ||
ha="right", | ||
va="center", | ||
zorder=100, | ||
arrowprops=arrow_props, | ||
) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# LaTeX utilities | ||
|
||
The `modflow_devtools.latex` module provides utility functions for building LaTeX tables from arrays. |
Oops, something went wrong.