Show More
@@ -91,6 +91,7 b' class OctaveMagics(Magics):' | |||
|
91 | 91 | ''' |
|
92 | 92 | inputs = line.split(' ') |
|
93 | 93 | for input in inputs: |
|
94 | input = unicode_to_str(input) | |
|
94 | 95 | self.oct.put(input, self.shell.user_ns[input]) |
|
95 | 96 | |
|
96 | 97 | |
@@ -123,11 +124,14 b' class OctaveMagics(Magics):' | |||
|
123 | 124 | @magic_arguments() |
|
124 | 125 | @argument( |
|
125 | 126 | '-i', '--input', action='append', |
|
126 |
help='Names of input variables to be pushed to Octave. Multiple names |
|
|
127 | help='Names of input variables to be pushed to Octave. Multiple names ' | |
|
128 | 'can be passed, separated by commas with no whitespace.' | |
|
127 | 129 | ) |
|
128 | 130 | @argument( |
|
129 | 131 | '-o', '--output', action='append', |
|
130 |
help='Names of variables to be pulled from Octave after executing cell |
|
|
132 | help='Names of variables to be pulled from Octave after executing cell ' | |
|
133 | 'body. Multiple names can be passed, separated by commas with no ' | |
|
134 | 'whitespace.' | |
|
131 | 135 | ) |
|
132 | 136 | @argument( |
|
133 | 137 | '-s', '--size', action='append', |
@@ -209,12 +213,13 b' class OctaveMagics(Magics):' | |||
|
209 | 213 | |
|
210 | 214 | function fig_create(src, event) |
|
211 | 215 | global __ipy_figures; |
|
212 |
__ipy_figures( |
|
|
216 | __ipy_figures(gcf()) = src; | |
|
213 | 217 | set(src, "visible", "off"); |
|
214 | 218 | end |
|
215 | 219 | |
|
216 | 220 | set(0, 'DefaultFigureCreateFcn', @fig_create); |
|
217 | 221 | |
|
222 | close all; | |
|
218 | 223 | clear ans; |
|
219 | 224 | ''' |
|
220 | 225 | |
@@ -228,12 +233,12 b' class OctaveMagics(Magics):' | |||
|
228 | 233 | end |
|
229 | 234 | |
|
230 | 235 | for f = __ipy_figures |
|
231 |
|
|
|
232 | print(f, outfile, '-dpng', '-S%(size)s'); | |
|
236 | outfile = sprintf('%(plot_dir)s/__ipy_oct_fig_%%03d.png', f); | |
|
237 | try | |
|
238 | print(f, outfile, '-dpng', '-tight', '-S%(size)s'); | |
|
239 | end | |
|
233 | 240 | end |
|
234 | 241 | |
|
235 | # close all; | |
|
236 | ||
|
237 | 242 | ''' % {'plot_dir': plot_dir, 'size': size} |
|
238 | 243 | |
|
239 | 244 | code = ' '.join((pre_call, code, post_call)) |
General Comments 0
You need to be logged in to leave comments.
Login now