We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e2833a commit f1fdbc5Copy full SHA for f1fdbc5
ipython/CoupledSpringMassSystem.ipynb
@@ -162,7 +162,7 @@
162
"with open('two_springs.dat', 'w') as f:\n",
163
" # Print & save the solution.\n",
164
" for t1, w1 in zip(t, wsol):\n",
165
- " print >> f, t1, w1[0], w1[1], w1[2], w1[3]"
+ " print(t1, w1[0], w1[1], w1[2], w1[3], file=f)"
166
],
167
"language": "python",
168
"metadata": {},
@@ -183,15 +183,14 @@
183
"# Plot the solution that was generated\n",
184
"\n",
185
"from numpy import loadtxt\n",
186
- "from pylab import figure, plot, xlabel, grid, hold, legend, title, savefig\n",
+ "from pylab import figure, plot, xlabel, grid, legend, title, savefig\n",
187
"from matplotlib.font_manager import FontProperties\n",
188
189
"t, x1, xy, x2, y2 = loadtxt('two_springs.dat', unpack=True)\n",
190
191
"figure(1, figsize=(6, 4.5))\n",
192
193
"xlabel('t')\n",
194
- "grid(True)\n",
195
"hold(True)\n",
196
"lw = 1\n",
197
@@ -220,4 +219,4 @@
220
219
"metadata": {}
221
}
222
]
223
-}
+}
0 commit comments