Show More
@@ -42,6 +42,8 b' class PylabMagics(Magics):' | |||||
42 | @skip_doctest |
|
42 | @skip_doctest | |
43 | @line_magic |
|
43 | @line_magic | |
44 | @magic_arguments.magic_arguments() |
|
44 | @magic_arguments.magic_arguments() | |
|
45 | @magic_arguments.argument('-l', '--list', default=None, action='store_true', | |||
|
46 | help='Show available matplotlib backends') | |||
45 | @magic_gui_arg |
|
47 | @magic_gui_arg | |
46 | def matplotlib(self, line=''): |
|
48 | def matplotlib(self, line=''): | |
47 | """Set up matplotlib to work interactively. |
|
49 | """Set up matplotlib to work interactively. | |
@@ -84,9 +86,15 b' class PylabMagics(Magics):' | |||||
84 |
|
86 | |||
85 | In [3]: %matplotlib qt |
|
87 | In [3]: %matplotlib qt | |
86 | """ |
|
88 | """ | |
|
89 | ||||
87 | args = magic_arguments.parse_argstring(self.matplotlib, line) |
|
90 | args = magic_arguments.parse_argstring(self.matplotlib, line) | |
88 | gui, backend = self.shell.enable_matplotlib(args.gui) |
|
91 | ||
89 | self._show_matplotlib_backend(args.gui, backend) |
|
92 | if args.list is not None: | |
|
93 | backends_list = list(backends.keys()) | |||
|
94 | print("Available matplotlib backends: %s" % backends_list) | |||
|
95 | else: | |||
|
96 | gui, backend = self.shell.enable_matplotlib(args.gui) | |||
|
97 | self._show_matplotlib_backend(args.gui, backend) | |||
90 |
|
98 | |||
91 | @skip_doctest |
|
99 | @skip_doctest | |
92 | @line_magic |
|
100 | @line_magic |
General Comments 0
You need to be logged in to leave comments.
Login now