gboeing / osmnx-examples

Gallery of OSMnx tutorials, usage examples, and feature demonstations.
https://osmnx.readthedocs.io
MIT License
1.52k stars 521 forks source link

PolarAxesSubplot' object has no attribute 'flat #18

Closed rs06085 closed 6 years ago

rs06085 commented 6 years ago

Hello, when I am trying to run your example, I receive the following error:

AttributeError: 'PolarAxesSubplot' object has no attribute 'flat'

I use python 3.6 version

Thanks in advance

wetneb commented 5 years ago

As far as I can tell, this issue is genuinely about osmnx-examples, specifically about the example on street orientations. The bug appears when the dictionary of city names has only one element. (Just take the existing script, remove all but one city, and run it.)

gboeing commented 5 years ago

@wetneb @rs06085 this isn't a bug... the script works fine as-is. It takes multiple places, constructs graphs, and plots them. If you want to change how this operates (i.e., a single city instead), you'll have to change how this is handled throughout the script, including for instance how the plotting logic flattens the numpy array of matplotlib axes since it expects more than 1.

gboeing commented 5 years ago

OP moved this to here: https://github.com/gboeing/osmnx/issues/192