Add cmap when plotting california image, fixes #65

main
Aurélien Geron 2018-03-15 23:26:18 +01:00
parent e9c97ff3b8
commit f9ac449f97
1 changed files with 8 additions and 3 deletions

View File

@ -66,7 +66,11 @@
" print(\"Saving figure\", fig_id)\n", " print(\"Saving figure\", fig_id)\n",
" if tight_layout:\n", " if tight_layout:\n",
" plt.tight_layout()\n", " plt.tight_layout()\n",
" plt.savefig(path, format=fig_extension, dpi=resolution)" " plt.savefig(path, format=fig_extension, dpi=resolution)\n",
"\n",
"# Ignore useless warnings (see SciPy issue #5998)\n",
"import warnings\n",
"warnings.filterwarnings(action=\"ignore\", module=\"scipy\", message=\"^internal gelsd\")"
] ]
}, },
{ {
@ -466,7 +470,8 @@
" c=\"median_house_value\", cmap=plt.get_cmap(\"jet\"),\n", " c=\"median_house_value\", cmap=plt.get_cmap(\"jet\"),\n",
" colorbar=False, alpha=0.4,\n", " colorbar=False, alpha=0.4,\n",
" )\n", " )\n",
"plt.imshow(california_img, extent=[-124.55, -113.80, 32.45, 42.05], alpha=0.5)\n", "plt.imshow(california_img, extent=[-124.55, -113.80, 32.45, 42.05], alpha=0.5,\n",
" cmap=plt.get_cmap(\"jet\"))\n",
"plt.ylabel(\"Latitude\", fontsize=14)\n", "plt.ylabel(\"Latitude\", fontsize=14)\n",
"plt.xlabel(\"Longitude\", fontsize=14)\n", "plt.xlabel(\"Longitude\", fontsize=14)\n",
"\n", "\n",
@ -2241,7 +2246,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.6.3" "version": "3.6.4"
}, },
"nav_menu": { "nav_menu": {
"height": "279px", "height": "279px",