1

I am trying to plot transparent scatters on a map creating by matplotlib.basemap with an arcgis image background. I have already set alpha as low as 0.1, but scatters are still not that transparent. In fact, the scatters do not have any changes when I change alpha. But the color-bar looks normal (see below image), that is the color I want for my scatters. What should I do?

enter image description here

fig = plt.figure(figsize=(20, 20))
m.shadedrelief()
m.drawcountries()
m.drawrivers()
m.arcgisimage(service = 'Ocean_Basemap')

t1 = t_AS.t
lat = t_AS.latitude
lon = t_AS.longitude
x,y=m(lon,lat)
m.scatter(lon,lat,s=500, c=t1,cmap=plt.cm.jet,alpha=0.1,vmin=195,vmax=360)
plt.colorbar()
plt.savefig('simul1.png')
Vlad
  • 8,225
  • 5
  • 33
  • 45
user10262232
  • 71
  • 1
  • 9
  • how dou you generate m? – warped Apr 28 '19 at 08:29
  • Displays the full image instead of link + code formatting – Vlad Apr 28 '19 at 11:00
  • 2
    The scatter dots *are* transparent, but you have many duplicate points, so if you create 100 dots with alpha 0.1 on top of each other, the overall alpha will be very close to 1. – ImportanceOfBeingErnest Apr 28 '19 at 11:54
  • You can try limiting your data to only a few (say 10) data points and see if it is really due to a lot of points on top of each other or if it is a different problem. – Thomas Kühn May 02 '19 at 08:46
  • If your case is same as @ImportanceOfBeingErnest described, this question could help https://stackoverflow.com/questions/30108372/how-to-make-matplotlib-scatterplots-transparent-as-a-group – YugoAmaryl Aug 25 '22 at 06:41

0 Answers0