Created
May 22, 2020 14:47
Rent Owerview
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Now this part of code gives me figures for each cells on each map region, even on these which has no data at all. How to show it only for regions which has values in initial table? | |
import matplotlib as mpl | |
import matplotlib.pyplot as plt | |
import geopandas as gpd | |
import pandas as pd | |
... | |
variable = 'price' | |
vmin, vmax = 10,90 | |
fig=plt.figure(figsize=(12,12)) | |
axK = fig.add_subplot(2,2,1) | |
mergedK.plot(column=variable, cmap='Blues', | |
vmin=vmin, | |
vmax=vmax, | |
linewidth=0.8, ax=axK, edgecolor='0.8') | |
for _,region in merged2.iterrows(): | |
if pd.notna(region['price']): | |
ax2.annotate(region['price'], | |
xy=(region.geometry.centroid.x, | |
region.geometry.centroid.y),fontsize=8) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment