From 9970eefe05ebe345f1f47f656d5c47d356e62184 Mon Sep 17 00:00:00 2001 From: 1kastner Date: Tue, 19 Sep 2023 22:46:02 +0200 Subject: [PATCH] Use new name for matplotlib style (#198) * Use new name for matplotlib style --- conflowgen/reporting/__init__.py | 2 +- docs/notebooks/analyses.ipynb | 16 +++++++++++++--- docs/notebooks/in_spotlight.ipynb | 2 +- docs/notebooks/input_distributions.ipynb | 2 +- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/conflowgen/reporting/__init__.py b/conflowgen/reporting/__init__.py index 4e31df91..3d2f71b4 100644 --- a/conflowgen/reporting/__init__.py +++ b/conflowgen/reporting/__init__.py @@ -144,7 +144,7 @@ def show_report_as_graph(self, **kwargs) -> None: kwargs.pop("static", None) kwargs.pop("display_as_ipython_svg", None) - with plt.style.context('seaborn-colorblind'): + with plt.style.context('seaborn-v0_8-colorblind'): self.get_report_as_graph(**kwargs) plt.show(block=True) diff --git a/docs/notebooks/analyses.ipynb b/docs/notebooks/analyses.ipynb index 1b3d8110..9b3ff56a 100644 --- a/docs/notebooks/analyses.ipynb +++ b/docs/notebooks/analyses.ipynb @@ -58,6 +58,16 @@ "database_chooser.load_existing_sqlite_database(\"demo_poc.sqlite\")" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "1a83ad5a-1afa-468d-a254-d0137ebdf260", + "metadata": {}, + "outputs": [], + "source": [ + "preferred_matplotlib_style = \"seaborn-v0_8-colorblind\"" + ] + }, { "cell_type": "markdown", "id": "3a6a56f9-45ad-497d-a243-82d81130a7d7", @@ -232,7 +242,7 @@ "source": [ "yard_capacity_analysis_report = conflowgen.YardCapacityAnalysisReport()\n", "\n", - "with plt.style.context(\"seaborn-colorblind\"):\n", + "with plt.style.context(preferred_matplotlib_style):\n", " yard_capacity_analysis_report.get_report_as_graph(\n", " storage_requirement=conflowgen.StorageRequirement.reefer\n", " )\n", @@ -254,7 +264,7 @@ "metadata": {}, "outputs": [], "source": [ - "with plt.style.context(\"seaborn-colorblind\"):\n", + "with plt.style.context(preferred_matplotlib_style):\n", " yard_capacity_analysis_report.get_report_as_graph(\n", " storage_requirement=[\n", " conflowgen.StorageRequirement.standard,\n", @@ -310,7 +320,7 @@ "source": [ "container_dwell_time_report = conflowgen.ContainerDwellTimeAnalysisReport()\n", "\n", - "with plt.style.context(\"seaborn-colorblind\"):\n", + "with plt.style.context(preferred_matplotlib_style):\n", " container_dwell_time_report.get_report_as_graph(\n", " container_delivered_by_vehicle_type={\n", " conflowgen.ModeOfTransport.deep_sea_vessel,\n", diff --git a/docs/notebooks/in_spotlight.ipynb b/docs/notebooks/in_spotlight.ipynb index 2a3ee409..a19aa8ae 100644 --- a/docs/notebooks/in_spotlight.ipynb +++ b/docs/notebooks/in_spotlight.ipynb @@ -70,7 +70,7 @@ "metadata": {}, "outputs": [], "source": [ - "plt.style.use(\"seaborn-colorblind\")" + "plt.style.use(\"seaborn-v0_8-colorblind\")" ] }, { diff --git a/docs/notebooks/input_distributions.ipynb b/docs/notebooks/input_distributions.ipynb index 6c7219ed..b89e6ce7 100644 --- a/docs/notebooks/input_distributions.ipynb +++ b/docs/notebooks/input_distributions.ipynb @@ -53,7 +53,7 @@ "metadata": {}, "outputs": [], "source": [ - "plt.style.use(\"seaborn-colorblind\")" + "plt.style.use(\"seaborn-v0_8-colorblind\")" ] }, {