Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wpbonelli committed Jan 9, 2024
1 parent 07eb2e8 commit e0d4f2a
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 5 deletions.
2 changes: 2 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ The `modflow-devtools` package provides a set of tools for developing and testin
:caption: Miscellaneous

md/download.md
md/figspec.md
md/latex.md
md/ostags.md
md/zip.md
md/timed.md
Expand Down
33 changes: 33 additions & 0 deletions docs/md/figspec.md
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,
)
```
3 changes: 3 additions & 0 deletions docs/md/latex.md
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.
7 changes: 2 additions & 5 deletions modflow_devtools/latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@ def build_table(caption, fpth, arr, headings=None, col_widths=None):
# footer
line += get_footer()

f = open(fpth, "w")
f.write(line)
f.close()

return
with open(fpth, "w") as f:
f.write(line)


def get_header(
Expand Down

0 comments on commit e0d4f2a

Please sign in to comment.