mirror of
https://github.com/ArthurDanjou/handson-ml3.git
synced 2026-01-14 20:19:29 +01:00
fix colorbar ticks
This commit is contained in:
@@ -533,7 +533,7 @@
|
||||
"\n",
|
||||
"prices = housing[\"median_house_value\"]\n",
|
||||
"tick_values = np.linspace(prices.min(), prices.max(), 11)\n",
|
||||
"cbar = plt.colorbar()\n",
|
||||
"cbar = plt.colorbar(ticks=tick_values/prices.max())\n",
|
||||
"cbar.ax.set_yticklabels([\"$%dk\"%(round(v/1000)) for v in tick_values], fontsize=14)\n",
|
||||
"cbar.set_label('Median House Value', fontsize=16)\n",
|
||||
"\n",
|
||||
|
||||
Reference in New Issue
Block a user