Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F60590693
interact.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, May 1, 07:53
Size
823 B
Mime Type
text/x-python
Expires
Fri, May 3, 07:53 (2 d)
Engine
blob
Format
Raw Data
Handle
17380143
Attached To
rJNAL Jupyter notebooks for Linear Algebra
interact.py
View Options
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 19 11:22:41 2019
@author: jecker
"""
import
gi
gi
.
require_version
(
'Gtk'
,
'3.0'
)
from
gi.repository
import
Gtk
from
matplotlib.figure
import
Figure
from
matplotlib.backends.backend_gtk3agg
import
FigureCanvas
from
matplotlib.backends.backend_gtk3
import
(
NavigationToolbar2GTK3
as
NavigationToolbar
)
win
=
Gtk
.
Window
()
win
.
connect
(
"destroy"
,
lambda
x
:
Gtk
.
main_quit
())
win
.
set_default_size
(
400
,
300
)
win
.
set_title
(
"Embedding in GTK"
)
vbox
=
Gtk
.
VBox
()
win
.
add
(
vbox
)
fig
=
Figure
(
figsize
=
(
5
,
4
),
dpi
=
100
)
ax
=
fig
.
add_subplot
(
111
)
ax
.
plot
([
1
,
2
,
3
])
canvas
=
FigureCanvas
(
fig
)
# a Gtk.DrawingArea
vbox
.
pack_start
(
canvas
,
True
,
True
,
0
)
toolbar
=
NavigationToolbar
(
canvas
,
win
)
vbox
.
pack_start
(
toolbar
,
False
,
False
,
0
)
win
.
show_all
()
Gtk
.
main
()
Event Timeline
Log In to Comment