diff --git a/ipython/CoupledSpringMassSystem.ipynb b/ipython/CoupledSpringMassSystem.ipynb index 109c920..afd5672 100644 --- a/ipython/CoupledSpringMassSystem.ipynb +++ b/ipython/CoupledSpringMassSystem.ipynb @@ -162,7 +162,7 @@ "with open('two_springs.dat', 'w') as f:\n", " # Print & save the solution.\n", " for t1, w1 in zip(t, wsol):\n", - " print >> f, t1, w1[0], w1[1], w1[2], w1[3]" + " print(t1, w1[0], w1[1], w1[2], w1[3], file=f)" ], "language": "python", "metadata": {}, @@ -183,7 +183,7 @@ "# Plot the solution that was generated\n", "\n", "from numpy import loadtxt\n", - "from pylab import figure, plot, xlabel, grid, hold, legend, title, savefig\n", + "from pylab import figure, plot, xlabel, grid, legend, title, savefig\n", "from matplotlib.font_manager import FontProperties\n", "\n", "t, x1, xy, x2, y2 = loadtxt('two_springs.dat', unpack=True)\n", @@ -192,7 +192,6 @@ "\n", "xlabel('t')\n", "grid(True)\n", - "hold(True)\n", "lw = 1\n", "\n", "plot(t, x1, 'b', linewidth=lw)\n", @@ -220,4 +219,4 @@ "metadata": {} } ] -} \ No newline at end of file +}