Show More
@@ -6,6 +6,11 b' octavemagic' | |||||
6 |
|
6 | |||
7 | Magics for interacting with Octave via oct2py. |
|
7 | Magics for interacting with Octave via oct2py. | |
8 |
|
8 | |||
|
9 | .. note:: | |||
|
10 | ||||
|
11 | The ``oct2py`` module needs to be installed separately, and in turn depends | |||
|
12 | on ``h5py``. Both can be obtained using ``easy_install`` or ``pip``. | |||
|
13 | ||||
9 | Usage |
|
14 | Usage | |
10 | ===== |
|
15 | ===== | |
11 |
|
16 | |||
@@ -169,11 +174,11 b' class OctaveMagics(Magics):' | |||||
169 | 'whitespace.' |
|
174 | 'whitespace.' | |
170 | ) |
|
175 | ) | |
171 | @argument( |
|
176 | @argument( | |
172 |
'-s', '--size', action=' |
|
177 | '-s', '--size', action='store', | |
173 | help='Pixel size of plots, "width,height". Default is "-s 400,250".' |
|
178 | help='Pixel size of plots, "width,height". Default is "-s 400,250".' | |
174 | ) |
|
179 | ) | |
175 | @argument( |
|
180 | @argument( | |
176 |
'-f', '--format', action=' |
|
181 | '-f', '--format', action='store', | |
177 | help='Plot format (png, svg or jpg).' |
|
182 | help='Plot format (png, svg or jpg).' | |
178 | ) |
|
183 | ) | |
179 |
|
184 | |||
@@ -248,12 +253,12 b' class OctaveMagics(Magics):' | |||||
248 | # generate plots in a temporary directory |
|
253 | # generate plots in a temporary directory | |
249 | plot_dir = tempfile.mkdtemp() |
|
254 | plot_dir = tempfile.mkdtemp() | |
250 | if args.size is not None: |
|
255 | if args.size is not None: | |
251 |
size = args.size |
|
256 | size = args.size | |
252 | else: |
|
257 | else: | |
253 | size = '400,240' |
|
258 | size = '400,240' | |
254 |
|
259 | |||
255 | if args.format is not None: |
|
260 | if args.format is not None: | |
256 |
plot_format = args.format |
|
261 | plot_format = args.format | |
257 | else: |
|
262 | else: | |
258 | plot_format = 'png' |
|
263 | plot_format = 'png' | |
259 |
|
264 | |||
@@ -292,8 +297,7 b' class OctaveMagics(Magics):' | |||||
292 | end |
|
297 | end | |
293 | end |
|
298 | end | |
294 |
|
299 | |||
295 | ''' % {'plot_dir': plot_dir, 'size': size, |
|
300 | ''' % locals() | |
296 | 'plot_format': plot_format} |
|
|||
297 |
|
301 | |||
298 | code = ' '.join((pre_call, code, post_call)) |
|
302 | code = ' '.join((pre_call, code, post_call)) | |
299 | try: |
|
303 | try: |
General Comments 0
You need to be logged in to leave comments.
Login now