Skip to content

Commit

Permalink
scrappy
Browse files Browse the repository at this point in the history
  • Loading branch information
olive004 committed Dec 17, 2024
1 parent 53cb4ea commit 1857b24
Showing 1 changed file with 36 additions and 7 deletions.
43 changes: 36 additions & 7 deletions notebooks/scrappy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -499,7 +533,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "env_circuits",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -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
Expand Down

0 comments on commit 1857b24

Please sign in to comment.