|
7 | 7 | "metadata": {}, |
8 | 8 | "outputs": [], |
9 | 9 | "source": [ |
10 | | - "from tqdm.notebook import trange\n", |
| 10 | + "from tqdm.notebook import trange, tqdm\n", |
11 | 11 | "import numpy as np\n", |
12 | 12 | "from numpy import pi as π\n", |
13 | 13 | "import matplotlib.pyplot as plt\n", |
|
700 | 700 | "source": [ |
701 | 701 | "%%capture\n", |
702 | 702 | "\n", |
703 | | - "from matplotlib.animation import FuncAnimation\n", |
704 | | - "\n", |
705 | 703 | "fig, axes = plt.subplots()\n", |
706 | 704 | "axes.set_aspect(\"equal\")\n", |
707 | 705 | "axes.set_xlim((0, 10e3))\n", |
708 | 706 | "axes.set_ylim((0, 10e3))\n", |
709 | 707 | "colors = firedrake.tripcolor(hs[0], vmax=130.0, num_sample_points=4, axes=axes)\n", |
710 | | - "fig.colorbar(colors)\n", |
| 708 | + "fig.colorbar(colors);" |
| 709 | + ] |
| 710 | + }, |
| 711 | + { |
| 712 | + "cell_type": "code", |
| 713 | + "execution_count": null, |
| 714 | + "id": "66704ac7-81e5-4586-be98-86f821228ca4", |
| 715 | + "metadata": {}, |
| 716 | + "outputs": [], |
| 717 | + "source": [ |
| 718 | + "from matplotlib.animation import FuncAnimation\n", |
711 | 719 | "\n", |
712 | 720 | "fn_plotter = firedrake.FunctionPlotter(mesh, num_sample_points=4)\n", |
713 | 721 | "def animate(h):\n", |
714 | 722 | " colors.set_array(fn_plotter(h))\n", |
715 | 723 | "\n", |
716 | | - "animation = FuncAnimation(fig, animate, hs, interval=1e3/60)" |
| 724 | + "animation = FuncAnimation(fig, animate, tqdm(hs), interval=1e3/60)" |
717 | 725 | ] |
718 | 726 | }, |
719 | 727 | { |
|
0 commit comments