##// END OF EJS Templates
Simpler if statement and added line to the docs
Koen van Besien -
Show More
@@ -42,7 +42,7 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',
45 @magic_arguments.argument('-l', '--list', default=False, action='store_true',
46 help='Show available matplotlib backends')
46 help='Show available matplotlib backends')
47 @magic_gui_arg
47 @magic_gui_arg
48 def matplotlib(self, line=''):
48 def matplotlib(self, line=''):
@@ -85,11 +85,15 b' class PylabMagics(Magics):'
85 But you can explicitly request a different GUI backend::
85 But you can explicitly request a different GUI backend::
86
86
87 In [3]: %matplotlib qt
87 In [3]: %matplotlib qt
88 """
89
88
90 args = magic_arguments.parse_argstring(self.matplotlib, line)
89 You can list the available backends using the -l/--list option
91
90
92 if args.list is not None:
91 In [4]: %matplotlib --list
92 Available matplotlib backends: ['osx', 'qt4', 'qt5', 'gtk3', 'notebook', 'wx', 'qt', 'nbagg',
93 'gtk', 'tk', 'inline']
94 """
95 args = magic_arguments.parse_argstring(self.matplotlib, line)
96 if args.list:
93 backends_list = list(backends.keys())
97 backends_list = list(backends.keys())
94 print("Available matplotlib backends: %s" % backends_list)
98 print("Available matplotlib backends: %s" % backends_list)
95 else:
99 else:
General Comments 0
You need to be logged in to leave comments. Login now