Skip to content

Commit

Permalink
stack + fill; better make_examples
Browse files Browse the repository at this point in the history
  • Loading branch information
0ctagon committed Oct 8, 2024
1 parent b91d70e commit b2c72e8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/examples/1d_hist/1d_elt1_stacked.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
ax=ax2,
edgecolor="black",
linewidth=0.5,
histtype="stepfilled",
stacked=True,
histtype="fill",
stack=True,
)

ax2.set_xlabel(name)
Expand Down
18 changes: 15 additions & 3 deletions src/plothist/scripts/make_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import hashlib
import warnings
import sys
import argparse


_matplotlib_version = "3.9.0"
Expand Down Expand Up @@ -143,7 +144,7 @@ def make_examples(no_input=False, check_svg=False, print_code=False):

# Iterate through all subfolders and files in the source folder
for root, dirs, files in os.walk(example_folder):
for file in files:
for i_file, file in enumerate(files, 1):
if file not in plots_to_redo:
continue

Expand Down Expand Up @@ -173,7 +174,7 @@ def make_examples(no_input=False, check_svg=False, print_code=False):
capture_output=True,
text=True,
)
if result.returncode != 0 and check_svg:
if result.returncode != 0:
fail(f"Error while redoing {file}:\n{result.stderr}\n{result.stdout}")

# Move the svg files to the img folder
Expand Down Expand Up @@ -209,4 +210,15 @@ def make_examples(no_input=False, check_svg=False, print_code=False):


if __name__ == "__main__":
make_examples()
parser = argparse.ArgumentParser()
parser.add_argument(
"--no_input",
action="store_true",
help="If True, the function will not ask for any input and will relaunch all the python files.",
)
parser.add_argument(
"--check_svg",
action="store_true",
help="If True, the function will check that the svg files have not changed after the relaunch.",
)
make_examples(**vars(parser.parse_args()))

0 comments on commit b2c72e8

Please sign in to comment.