Skip to content

Commit cc99d61

Browse files
committed
added example notebook for toolbar_visible
1 parent 484b5fe commit cc99d61

File tree

1 file changed

+98
-0
lines changed

1 file changed

+98
-0
lines changed

examples/header_visible.ipynb

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"%matplotlib widget"
10+
]
11+
},
12+
{
13+
"cell_type": "code",
14+
"execution_count": null,
15+
"metadata": {
16+
"ExecuteTime": {
17+
"end_time": "2019-08-07T08:07:06.908562Z",
18+
"start_time": "2019-08-07T08:07:06.602919Z"
19+
}
20+
},
21+
"outputs": [],
22+
"source": [
23+
"import matplotlib.pyplot as plt"
24+
]
25+
},
26+
{
27+
"cell_type": "code",
28+
"execution_count": null,
29+
"metadata": {},
30+
"outputs": [],
31+
"source": [
32+
"fig, ax = plt.subplots()\n",
33+
"fig.canvas.layout.width = '7in'\n",
34+
"fig.canvas.layout.height= '5in'\n",
35+
"\n",
36+
"# if I hide the header here, I get a libpng error\n",
37+
"# fig.canvas.header_visible = False\n",
38+
"\n",
39+
"ax.plot([1,2,3], [4,5,3])"
40+
]
41+
},
42+
{
43+
"cell_type": "code",
44+
"execution_count": null,
45+
"metadata": {},
46+
"outputs": [],
47+
"source": [
48+
"# hiding after rendering works\n",
49+
"fig.canvas.header_visible = False"
50+
]
51+
},
52+
{
53+
"cell_type": "code",
54+
"execution_count": null,
55+
"metadata": {},
56+
"outputs": [],
57+
"source": [
58+
"# hiding together with calls to toolbar options, work.\n",
59+
"fig, ax = plt.subplots()\n",
60+
"fig.canvas.layout.width = '7in'\n",
61+
"fig.canvas.layout.height= '5in'\n",
62+
"\n",
63+
"fig.canvas.toolbar_visible = False\n",
64+
"fig.canvas.header_visible = False\n",
65+
"\n",
66+
"ax.plot([1,2,3], [4,5,3])"
67+
]
68+
},
69+
{
70+
"cell_type": "code",
71+
"execution_count": null,
72+
"metadata": {},
73+
"outputs": [],
74+
"source": []
75+
}
76+
],
77+
"metadata": {
78+
"kernelspec": {
79+
"display_name": "Python 3",
80+
"language": "python",
81+
"name": "python3"
82+
},
83+
"language_info": {
84+
"codemirror_mode": {
85+
"name": "ipython",
86+
"version": 3
87+
},
88+
"file_extension": ".py",
89+
"mimetype": "text/x-python",
90+
"name": "python",
91+
"nbconvert_exporter": "python",
92+
"pygments_lexer": "ipython3",
93+
"version": "3.7.3"
94+
}
95+
},
96+
"nbformat": 4,
97+
"nbformat_minor": 2
98+
}

0 commit comments

Comments
 (0)