Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8cc21db

Browse filesBrowse files
committed
Add IPython display hook.
This is configurable using rc params, and defaults to off.
1 parent 8cdc00a commit 8cc21db
Copy full SHA for 8cc21db

File tree

Expand file treeCollapse file tree

2 files changed

+10
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+10
-0
lines changed

‎lib/matplotlib/animation.py

Copy file name to clipboardExpand all lines: lib/matplotlib/animation.py
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,12 @@ def to_html5_video(self):
932932
size=self._video_size,
933933
options=' '.join(options))
934934

935+
def _repr_html_(self):
936+
r'IPython display hook for rendering.'
937+
fmt = rcParams['animation.html']
938+
if fmt == 'html5':
939+
return self.to_html5_video()
940+
935941

936942
class TimedAnimation(Animation):
937943
'''

‎lib/matplotlib/rcsetup.py

Copy file name to clipboardExpand all lines: lib/matplotlib/rcsetup.py
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,9 @@ def validate_hinting(s):
499499

500500
validate_axis_locator = ValidateInStrings('major', ['minor', 'both', 'major'])
501501

502+
validate_movie_html_fmt = ValidateInStrings('animation.html',
503+
['html5', 'none'])
504+
502505
def validate_bbox(s):
503506
if isinstance(s, six.string_types):
504507
s = s.lower()
@@ -944,6 +947,7 @@ def __call__(self, s):
944947
'examples.directory': ['', six.text_type],
945948

946949
# Animation settings
950+
'animation.html': ['none', validate_movie_html_fmt],
947951
'animation.writer': ['ffmpeg', validate_movie_writer],
948952
'animation.codec': ['mpeg4', six.text_type],
949953
'animation.bitrate': [-1, validate_int],

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.