-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hollow markers are not transparent #455
Comments
most likely, this is an issue with matplotlib rather than basemap itself. I
also suspect that this has something to do with the style change work for
matplotlib v2.0.
…On Tue, Mar 19, 2019 at 6:25 PM Jian Shi ***@***.***> wrote:
Hello,
When I tried to plot hollow markers on the map, the marker is actually
filled, not transparent. See this map below:
[image: image]
<https://user-images.githubusercontent.com/25124332/54645888-a3f89480-4a5a-11e9-8345-dec0ccb351c1.png>
Below is the code to reproduce this map:
import matplotlib.pyplot as pltfrom mpl_toolkits.basemap import Basemap
lon_ll = -124.5 # lower left corner, longitude
lon_ur = -105.2 # upper right corner, longitude
lat_ll = 32.0 # lower left corner, latitude
lat_ur = 42.0 # upper right corner, latitude
f = plt.figure(dpi=100)
ax = plt.axes()
m = Basemap(llcrnrlon=lon_ll,llcrnrlat=lat_ll,
urcrnrlon=lon_ur,urcrnrlat=lat_ur,\
rsphere=(6378137.00,6356752.3142),\
resolution='c',projection='merc',\
lat_0=(lat_ll+lat_ur)/2,\
lon_0=(lon_ll+lon_ur)/2,lat_ts=20.,
epsg = 3310)
m.arcgisimage(service='World_Physical_Map', xpixels=120, epsg=3310, verbose=False)
m.drawstates()
LA = (34.05, -118.25)LV = (36.175, -115.136389)SF = (37.783333, -122.416667)PH = (33.45, -112.066667)
ms = 15
alpha = 0.75
m.plot(*m(LV[1], LV[0]), marker='s', ms=ms,
ls='none', mew=1.25,c='blue', fillstyle='none', alpha=alpha)
m.plot(*m(LA[1], LA[0]), marker='o', ms=ms,
ls='none', mew=1.25,c='red', fillstyle='right', alpha=alpha)
m.plot(*m(PH[1], PH[0]), marker='o', ms=ms,
ls='none', mew=1.25,c='green', fillstyle='full', alpha=alpha)
m.plot(*m(SF[1], SF[0]), marker='o', ms=ms,
ls='none', mew=1.25,c='cyan', fillstyle='left', alpha=alpha,
markerfacecoloralt='white')
horiz_offset = 0.6 # unit: degrees
plt.text(*m(LA[1] + horiz_offset, LA[0]), 'Los Angeles')
plt.text(*m(LV[1] + horiz_offset, LV[0]), 'Las Vegas')
plt.text(*m(SF[1] + horiz_offset, SF[0]), 'San Francisco')
plt.text(*m(PH[1] + horiz_offset, PH[0]), 'Phoenix')
The markers for Los Angeles and Las Vegas should have been hollow (on the
left side for LA, and fully for LV), but they are not. For half-full
markers, such as the marker for San Francisco, I can set the
markerfacecoloralt to other colors, but not for fully open markers.
- Operating system: Windows 10
- Python version: 3.6.6
- Basemap version: both 1.1.0 and 1.2.0 have this issue
- matplotlib version: 2.2.2
Note that I used to *not* have this issue some time ago, with older
versions of matplotlib (I don't remember which).
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#455>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-Ai_7uLKFvfeMdwx7-UdaElM_dV6ks5vYWPegaJpZM4b9Pe4>
.
|
I was able to reproduce the result here: https://matplotlib.org/gallery/lines_bars_and_markers/marker_fillstyle_reference.html For "fill style" equal to "none", the markers are transparent. So it seems that matplotlib is normal. I am pretty sure the issue didn't come from matplotlib upgrading to v2.0, because when I was able to get proper hollow markers, the matplotlib version I was using was already v2.0+. Should I open an issue over at matplotlib? |
As shown in matplotlib/matplotlib#13725 this seems to be an issue in matplotlib 2.2.2, which has been fixed in matplotlib 2.2.3. |
Hello,
When I tried to plot hollow markers on the map, the marker is actually filled, not transparent. See this map below:
Below is the code to reproduce this map:
The markers for Los Angeles and Las Vegas should have been hollow (on the left side for LA, and fully for LV), but they are not. For half-full markers, such as the marker for San Francisco, I can set the
markerfacecoloralt
to other colors, but not for fully open markers.Note that I used to not have this issue some time ago, with older versions of matplotlib (I don't remember which).
The text was updated successfully, but these errors were encountered: