From 1857b2468ee35e5a3e89332751483775e67af9f7 Mon Sep 17 00:00:00 2001 From: olive004 Date: Tue, 17 Dec 2024 16:22:55 +0000 Subject: [PATCH] scrappy --- notebooks/scrappy.ipynb | 43 ++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/notebooks/scrappy.ipynb b/notebooks/scrappy.ipynb index a8386acb..77c4eba3 100644 --- a/notebooks/scrappy.ipynb +++ b/notebooks/scrappy.ipynb @@ -119,6 +119,40 @@ "bokeh.io.output_notebook()" ] }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Reading package lists... Done\n", + "Building dependency tree... Done\n", + "Reading state information... Done\n", + "libcairo2 is already the newest version (1.16.0-5ubuntu2).\n", + "0 upgraded, 0 newly installed, 0 to remove and 79 not upgraded.\n", + "SVG file has been converted to PNG and saved at ../data/ensemble_simulate_by_interaction/2024_12_05_210221/vis_6_scatter/adaptation_m0_log_overshoot.png\n" + ] + } + ], + "source": [ + "# !pip install cairosvg\n", + "# !apt -y install libcairo2\n", + "import cairosvg\n", + "\n", + "# Load the SVG file\n", + "svg_file_path = '../data/ensemble_simulate_by_interaction/2024_12_05_210221/vis_6_scatter/adaptation_m0_log_overshoot.svg'\n", + "\n", + "# Convert SVG to PNG\n", + "png_file_path = svg_file_path.replace('svg', 'png')\n", + "cairosvg.svg2png(url=svg_file_path, write_to=png_file_path, output_width=500, output_height=500)\n", + "\n", + "print(f'SVG file has been converted to PNG and saved at {png_file_path}')\n", + "\n" + ] + }, { "cell_type": "code", "execution_count": 4, @@ -499,7 +533,7 @@ ], "metadata": { "kernelspec": { - "display_name": "env_circuits", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -515,12 +549,7 @@ "pygments_lexer": "ipython3", "version": "3.10.12" }, - "orig_nbformat": 4, - "vscode": { - "interpreter": { - "hash": "172594369b7e917b537188c81f1a7108d427e78c3b158785db52bc1182200d3e" - } - } + "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2