-
Notifications
You must be signed in to change notification settings - Fork 390
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
Fail on basemap.drawcounties() Python 3.5.2 #324
Comments
|
Does installing the version that is in the repository fix the problem? |
Having this problem too. Python 3.5.2 on matplotlib version 1.5.1 and 1.5.3 (tried both). |
but which version of basemap?
…On Tue, Jan 10, 2017 at 4:39 PM, John Lawson ***@***.***> wrote:
Having this problem too. Python 3.5.2 on matplotlib version 1.5.1 and
1.5.3 (tried both).
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#324 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-EnEDI6AQBQzV5dH-unS9GNh2iMmks5rQ_qIgaJpZM4KVEE9>
.
|
Is it possible to have the failing code to try and reproduce the issue? |
I'm using Basemap version 1.0.7, which is the newest Anaconda will install under Python 3.5.2. (I notice there are newer Basemap versions.) The code uses one of my own packages but you can get the idea with this example:
|
@johnrobertlawson I had to tweak your code for me but it seems there is no issue for basemap 1.0.8 Here is the quick notebook: https://github.com/guziy/PyNotebooks/blob/master/basemap_demos/drawcoastlines_issue.ipynb Cheers |
@guziy Thanks for verifying that. What's your Python version? |
My python info: Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 26 2016, 10:47:25) What worries me a bit here is that I do not see the plotted field... Are my projection params too off? Cheers |
Ah ok, now I see the field, had lons and lats in the wrong order in Cheers |
Turns out, after removing the data plotting (i.e. simply trying to plot a basemap), the counties still break the script. I tried to reproduce your exact code and it also breaks. This leaves just the 1.0.7 vs 1.0.8 version. I'm going to look into why |
@johnrobertlawson |
@micahcochran Good to know, thanks. |
Set your channel to conda-forge to get the unofficial v1.0.8.
…On Wed, Jan 11, 2017 at 10:11 AM, John Lawson ***@***.***> wrote:
@micahcochran <https://github.com/micahcochran> Good to know, thanks.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#324 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-HsCTjpPRQXbNAHOs3R0WSdp2hfgks5rRPEEgaJpZM4KVEE9>
.
|
@WeatherGod I'm running basemap version 1.0.8, Python version 3.5.2, matplotlib 2.0.0. For me, drawcounties() doesn't give an error, it simply does nothing. I get no county boundaries drawn. Here is my code:
There is a similar problem on stackoverflow here but unfortunately it has no answer. Any ideas? |
Could you try explicitly setting a color for the county lines? I am
starting to wonder if a change in defaults in matplotlib is causing a
problem.
…On Thu, Feb 2, 2017 at 1:42 PM, Catharine Wyss ***@***.***> wrote:
@WeatherGod <https://github.com/WeatherGod> I'm running basemap version
1.0.8, Python version 3.5.2, matplotlib 2.0.0. For me, drawcounties()
doesn't give an error, it simply does nothing. I get no county boundaries
drawn. Here is my code:
mm = Basemap(projection = 'merc', lat_0 = 42.0, lon_0 = -83.0, resolution = 'i', area_thresh = 0.1,
llcrnrlon = -86.0, llcrnrlat = 39.0, urcrnrlon = -80.0, urcrnrlat = 45.0)
mm.drawmapboundary()
mm.fillcontinents(color = 'brown', lake_color = 'blue')
mm.drawcounties()
plt.show()
There is a similar problem on stackoverflow here
<http://stackoverflow.com/questions/38827756/matplotlib-basemap-drawcounties-doesnt-work>
but unfortunately it has no answer. Any ideas?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#324 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-NdVBXbNyKLOETYfUv_QadMMF_Drks5rYiODgaJpZM4KVEE9>
.
|
It fills continents over your county boundaries (which is a bit weird)... Cheers |
oooh, good catch! Perhaps I should update the default zorder of the county
stuff so that it goes above other stuff?
…On Thu, Feb 2, 2017 at 1:53 PM, Huziy Oleksandr (Sasha) < ***@***.***> wrote:
@datacathy <https://github.com/datacathy>
It fills continents over your county boundaries (which is a bit weird)...
A workaround is to use mm.drawcounties(zorder=20)
Cheers
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#324 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-LwitRatOYuc_zzXTN5aFVK1crWEks5rYiYWgaJpZM4KVEE9>
.
|
Oooh, it is a bit more trickier than that. drawstates() and drawcountries()
is implemented using LineCollection objects, but drawcounties() is
implemented using a PolyCollection, which has a lower default zorder. This
wouldn't be too much of an issue, but because the coastline drawing is done
as PolyCollection, and came after the county drawing, the coastline stuff
clobbers the county polygons. Perhaps I can "fix" it by keeping the
counties as PolyCollection for backwards compat, but initializing it with
the default zorder of a LineCollection (which is what the documentation
says it should do, anyway).
…On Thu, Feb 2, 2017 at 2:00 PM, Benjamin Root ***@***.***> wrote:
oooh, good catch! Perhaps I should update the default zorder of the county
stuff so that it goes above other stuff?
On Thu, Feb 2, 2017 at 1:53 PM, Huziy Oleksandr (Sasha) <
***@***.***> wrote:
> @datacathy <https://github.com/datacathy>
>
> It fills continents over your county boundaries (which is a bit weird)...
> A workaround is to use mm.drawcounties(zorder=20)
>
> Cheers
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#324 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AARy-LwitRatOYuc_zzXTN5aFVK1crWEks5rYiYWgaJpZM4KVEE9>
> .
>
|
@guziy it works, thanks for the workaround! |
Created #340 that should help fix this
…On Thu, Feb 2, 2017 at 2:16 PM, Benjamin Root ***@***.***> wrote:
Oooh, it is a bit more trickier than that. drawstates() and
drawcountries() is implemented using LineCollection objects, but
drawcounties() is implemented using a PolyCollection, which has a lower
default zorder. This wouldn't be too much of an issue, but because the
coastline drawing is done as PolyCollection, and came after the county
drawing, the coastline stuff clobbers the county polygons. Perhaps I can
"fix" it by keeping the counties as PolyCollection for backwards compat,
but initializing it with the default zorder of a LineCollection (which is
what the documentation says it should do, anyway).
On Thu, Feb 2, 2017 at 2:00 PM, Benjamin Root ***@***.***>
wrote:
> oooh, good catch! Perhaps I should update the default zorder of the
> county stuff so that it goes above other stuff?
>
> On Thu, Feb 2, 2017 at 1:53 PM, Huziy Oleksandr (Sasha) <
> ***@***.***> wrote:
>
>> @datacathy <https://github.com/datacathy>
>>
>> It fills continents over your county boundaries (which is a bit weird)...
>> A workaround is to use mm.drawcounties(zorder=20)
>>
>> Cheers
>>
>> —
>> You are receiving this because you were mentioned.
>> Reply to this email directly, view it on GitHub
>> <#324 (comment)>,
>> or mute the thread
>> <https://github.com/notifications/unsubscribe-auth/AARy-LwitRatOYuc_zzXTN5aFVK1crWEks5rYiYWgaJpZM4KVEE9>
>> .
>>
>
>
|
I have the same problem. I've solved it. |
The suggestion given by @Ackeraa worked for me as well. 👍🏽 |
Platform:
Throws error on basemap.drawcounties() (over Illinois)
The text was updated successfully, but these errors were encountered: