Skip to content

Commit 4528dc1

Browse files
committed
another attempt at plotly shape
1 parent 1b648cf commit 4528dc1

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

Examples.ipynb

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
"\n",
2121
"from IPython.display import Image\n",
2222
"\n",
23-
"%load_ext rpy2.ipython\n",
24-
"\n",
2523
"from pylab import rcParams\n",
2624
"\n",
2725
"size = 20\n",
@@ -43,13 +41,22 @@
4341
") # for plotnine\n",
4442
"\n",
4543
"\n",
46-
"fig = graph_objects.Figure(layout = dict(width=10, height=10))\n",
44+
"fig = graph_objects.Figure(layout = dict(width=100, height=100))\n",
4745
"\n",
4846
"templated_fig = pio.to_templated(fig)\n",
4947
"pio.templates['my_template'] = templated_fig.layout.template\n",
5048
"pio.templates.default = 'my_template'"
5149
]
5250
},
51+
{
52+
"cell_type": "code",
53+
"execution_count": null,
54+
"metadata": {},
55+
"outputs": [],
56+
"source": [
57+
"%load_ext rpy2.ipython"
58+
]
59+
},
5360
{
5461
"cell_type": "code",
5562
"execution_count": null,
@@ -62,6 +69,13 @@
6269
"theme_set(theme_grey(base_size = 24))"
6370
]
6471
},
72+
{
73+
"cell_type": "code",
74+
"execution_count": null,
75+
"metadata": {},
76+
"outputs": [],
77+
"source": []
78+
},
6579
{
6680
"cell_type": "markdown",
6781
"metadata": {},
@@ -266,6 +280,7 @@
266280
"cell_type": "code",
267281
"execution_count": null,
268282
"metadata": {
283+
"scrolled": true,
269284
"tags": [
270285
"ex",
271286
"name:bar-counts",
@@ -284,7 +299,7 @@
284299
" \n",
285300
" })\n",
286301
"fig.add_trace(bar)\n",
287-
"fig.show(renderer='png')"
302+
"Image(fig.to_image(format=\"png\", width=900, height=900))"
288303
]
289304
},
290305
{

0 commit comments

Comments
 (0)