Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How do I change the scale size of my scatter points with values based on a column?

So, I have the following plot, which is a map I’m projecting for my work, I have the data of mean frequency which is plotted and the size must vary within the hv_mean_freq values, but even though I think its happening, the sizes are too small to visualize, how can I change that? So they still follow the sizes of the values given but on a larger scale?

ax = fig.add_subplot()
plt.axis([-50.05,-49.4, -13.3, -12.62])
aguabonita = bacia_aguiar.plot(ax=ax, figsize=(25, 15), color='#FFE5AC')

vereda_verde.plot(ax=aguabonita, color='#F3A773', label='Fm. Vereda Verde')
bacia_aguiar.boundary.plot(ax=ax, color='Brown', linewidth=1, label='Bacia segundo Aguiar(2013)')
bacia.boundary.plot(ax=aguabonita, color="#7814F9",linewidth=1, label='Bacia segundo CPRM(2016)' )
lineamento.plot(ax=aguabonita, color='#461706', linewidth=.9, LineStyle='--', label='Lineamentos' )

rodovia_TO.plot(ax=aguabonita,color="#CA9222", linewidth=2, alpha=.4, label='Rodovias')
hidrografia.plot(ax=aguabonita, color="LightBlue", linewidth=1.5, label="CorposD'água")
hidrografia_02.plot(ax=aguabonita, color="LightBlue", linewidth=1.5)
limites.boundary.plot(ax=aguabonita, color="Gray",linewidth=.7, label='Limite Estadual')
sre.plot(ax=aguabonita, color="#CA9222", linewidth=2, alpha=.4)




####### MunicĂ­pios
ax.text(-49.83, -12.92, "Araguaçu", transform=ax.transData, fontsize="14")
ax.text(-49.59, -12.98, "Marilândia", transform=ax.transData)
ax.text(-49.97, -13.08, "TataĂ­ra", transform=ax.transData)
ax.text(-49.50, -13.24, "Novo Planalto", transform=ax.transData, fontsize="14")
ax.text(-50.02, -12.75, "BaianĂłpolis", transform=ax.transData)
ax.text(-49.55, -13.22, "GO", transform=ax.transData, rotation=-35, fontsize="24", alpha=0.3, color="Gray")
ax.text(-49.53, -13.19, "TO", transform=ax.transData, rotation=-35, fontsize="24", alpha=0.3, color="Gray")

plt.legend(loc="upper left")
plt.yticks(rotation = 90)


###scatter plots of results
s=hvsrperfil_04.hv_mean_f0_fr_
plt.scatter(hvsrperfil_04.Longitude, hvsrperfil_04.Latitude,c=s, s=s, cmap='inferno', label='HVSR Mean F0 Frequencies') # not sure of your x, y
plt.colorbar()


####### Norte
x, y, arrow_length = 0.95, 0.99, 0.1
ax.annotate('N', xy=(x, y), xytext=(x, y-arrow_length),
            arrowprops=dict(facecolor='black', width=5, headwidth=25),
            ha='center', va='center', fontsize=20,
            xycoords=ax.transAxes)

####### Escala Gráfica
df = aguabonita
A=[-49.5*np.pi/180.,-12.7*np.pi/180.] #Latitude of interest here 40.7 deg, longitude -74.5
B=[-50.5*np.pi/180.,-12.7*np.pi/180.] ##Latitude of interest here 40.7 deg, longitude -74.5+1
dx=(6371000)*haversine_distances([A,B])[0,1]
ax.add_artist(ScaleBar(dx=dx,units="m", location="lower center")) 

map with the results, as you can(or cannot) see, the points representing the results are too small, even though the very of size

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can to use a multiplication factor. For example, instead of using s=s in matplotlib scatter function, you can use s=10*s or even s=100*s.

Because i suppose they are just very small:
enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading