##// END OF EJS Templates
Fix small bug in display protocol example (numpy polynomials).
Fernando Perez -
Show More
@@ -127,7 +127,7 b''
127 },
127 },
128 {
128 {
129 "cell_type": "code",
129 "cell_type": "code",
130 "collapsed": true,
130 "collapsed": false,
131 "input": [
131 "input": [
132 "x = Gaussian()",
132 "x = Gaussian()",
133 "x"
133 "x"
@@ -144,7 +144,7 b''
144 },
144 },
145 {
145 {
146 "cell_type": "code",
146 "cell_type": "code",
147 "collapsed": true,
147 "collapsed": false,
148 "input": [
148 "input": [
149 "x.png"
149 "x.png"
150 ],
150 ],
@@ -154,7 +154,7 b''
154 },
154 },
155 {
155 {
156 "cell_type": "code",
156 "cell_type": "code",
157 "collapsed": true,
157 "collapsed": false,
158 "input": [
158 "input": [
159 "x.svg"
159 "x.svg"
160 ],
160 ],
@@ -171,7 +171,7 b''
171 },
171 },
172 {
172 {
173 "cell_type": "code",
173 "cell_type": "code",
174 "collapsed": true,
174 "collapsed": false,
175 "input": [
175 "input": [
176 "display(x.png)",
176 "display(x.png)",
177 "display(x.svg)"
177 "display(x.svg)"
@@ -188,7 +188,7 b''
188 },
188 },
189 {
189 {
190 "cell_type": "code",
190 "cell_type": "code",
191 "collapsed": true,
191 "collapsed": false,
192 "input": [
192 "input": [
193 "x2 = Gaussian(0.5, 0.2, 2000)",
193 "x2 = Gaussian(0.5, 0.2, 2000)",
194 "x2"
194 "x2"
@@ -205,7 +205,7 b''
205 },
205 },
206 {
206 {
207 "cell_type": "code",
207 "cell_type": "code",
208 "collapsed": true,
208 "collapsed": false,
209 "input": [
209 "input": [
210 "display(x.hist)",
210 "display(x.hist)",
211 "display(x2.hist)"
211 "display(x2.hist)"
@@ -232,7 +232,7 b''
232 },
232 },
233 {
233 {
234 "cell_type": "code",
234 "cell_type": "code",
235 "collapsed": true,
235 "collapsed": false,
236 "input": [
236 "input": [
237 "p = np.polynomial.Polynomial([1,2,3], [-10, 10])",
237 "p = np.polynomial.Polynomial([1,2,3], [-10, 10])",
238 "p"
238 "p"
@@ -268,12 +268,11 b''
268 " terms.append(term)",
268 " terms.append(term)",
269 " px = '$P(x)=%s$' % '+'.join(terms)",
269 " px = '$P(x)=%s$' % '+'.join(terms)",
270 " dom = r', domain: $[%.2g,\\ %.2g]$' % tuple(p.domain)",
270 " dom = r', domain: $[%.2g,\\ %.2g]$' % tuple(p.domain)",
271 " win = r', window: $[%.2g,\\ %.2g]$' % tuple(p.window)",
271 " return px+dom"
272 " return px+dom+win"
273 ],
272 ],
274 "language": "python",
273 "language": "python",
275 "outputs": [],
274 "outputs": [],
276 "prompt_number": 9
275 "prompt_number": 11
277 },
276 },
278 {
277 {
279 "cell_type": "markdown",
278 "cell_type": "markdown",
@@ -283,13 +282,13 b''
283 },
282 },
284 {
283 {
285 "cell_type": "code",
284 "cell_type": "code",
286 "collapsed": true,
285 "collapsed": false,
287 "input": [
286 "input": [
288 "poly2latex(p)"
287 "poly2latex(p)"
289 ],
288 ],
290 "language": "python",
289 "language": "python",
291 "outputs": [],
290 "outputs": [],
292 "prompt_number": 10
291 "prompt_number": 12
293 },
292 },
294 {
293 {
295 "cell_type": "markdown",
294 "cell_type": "markdown",
@@ -301,14 +300,14 b''
301 },
300 },
302 {
301 {
303 "cell_type": "code",
302 "cell_type": "code",
304 "collapsed": true,
303 "collapsed": false,
305 "input": [
304 "input": [
306 "from IPython.core.display import Math",
305 "from IPython.core.display import Math",
307 "Math(poly2latex(p))"
306 "Math(poly2latex(p))"
308 ],
307 ],
309 "language": "python",
308 "language": "python",
310 "outputs": [],
309 "outputs": [],
311 "prompt_number": 11
310 "prompt_number": 13
312 },
311 },
313 {
312 {
314 "cell_type": "markdown",
313 "cell_type": "markdown",
@@ -330,7 +329,7 b''
330 ],
329 ],
331 "language": "python",
330 "language": "python",
332 "outputs": [],
331 "outputs": [],
333 "prompt_number": 12
332 "prompt_number": 14
334 },
333 },
335 {
334 {
336 "cell_type": "markdown",
335 "cell_type": "markdown",
@@ -346,24 +345,24 b''
346 },
345 },
347 {
346 {
348 "cell_type": "code",
347 "cell_type": "code",
349 "collapsed": true,
348 "collapsed": false,
350 "input": [
349 "input": [
351 "p"
350 "p"
352 ],
351 ],
353 "language": "python",
352 "language": "python",
354 "outputs": [],
353 "outputs": [],
355 "prompt_number": 13
354 "prompt_number": 15
356 },
355 },
357 {
356 {
358 "cell_type": "code",
357 "cell_type": "code",
359 "collapsed": true,
358 "collapsed": false,
360 "input": [
359 "input": [
361 "p2 = np.polynomial.Polynomial([-20, 71, -15, 1])",
360 "p2 = np.polynomial.Polynomial([-20, 71, -15, 1])",
362 "p2"
361 "p2"
363 ],
362 ],
364 "language": "python",
363 "language": "python",
365 "outputs": [],
364 "outputs": [],
366 "prompt_number": 14
365 "prompt_number": 16
367 },
366 },
368 {
367 {
369 "cell_type": "code",
368 "cell_type": "code",
General Comments 0
You need to be logged in to leave comments. Login now