"outputs": [],
"source": [
"from scipy import misc\n",
+ "from PIL import Image\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"\n",
"outputs": [],
"source": [
"im = np.loadtxt('paws.numpy')\n",
- "im = misc.imresize(im, 2.0)\n",
+ "print(\"pre shape:\", im.shape)\n",
+ "w, h = im.shape\n",
+ "im = np.array(Image.fromarray(im).resize((h*2, w*2)))\n",
+ "print(\"post shape:\", im.shape)\n",
"im = im * (255 / np.max(im))"
]
},
"metadata": {},
"outputs": [],
"source": [
- "fig = plt.figure()\n",
- "ax = fig.gca(projection='3d')\n",
+ "fig = plt.figure(figsize=(6, 6))\n",
+ "ax = fig.add_subplot(111, projection='3d')\n",
+ "ax.set_zlim(0, 800)\n",
"ax.plot_surface(xx, yy, im ,rstride=1, cstride=1, cmap=plt.cm.jet,\n",
- " linewidth=0)"
+ " linewidth=0)\n",
+ "plt.show()"
]
},
{
"execution_count": null,
"metadata": {},
"outputs": [],
- "source": [
- "plt.show()"
- ]
+ "source": []
},
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": true
- },
+ "metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
- "display_name": "Python 3",
- "language": "python3.5",
+ "display_name": "Python 3 (ipykernel)",
+ "language": "python",
"name": "python3"
},
"language_info": {
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.5.5"
+ "version": "3.11.8"
}
},
"nbformat": 4,
- "nbformat_minor": 1
+ "nbformat_minor": 4
}