matplotlib / matplotlib/basemap

small bug in drawmapscale

Open Beginner friendly
#368 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
817
Forks
395
PR merge metrics
No merged PRs in 30d

Description

When using fancy style, the argument ax is not passed to self.plot while plotting the frame and ticks, ex:
#plot bottom line
rets.append(self.plot([x1,x4],[ybottom,ybottom],color=fontcolor)[0])

Thus, part of the map scale may be plotted in a different axes. Ex:

```
import pylab as pl
from mpl_toolkits.basemap import Basemap
m = Basemap(width=3000e3,height=3000e3,resolution='l',
projection='lcc',lat_1=50.,lat_0=47,lon_0=1.)

ax0=pl.axes()
ax1=pl.axes([.6,.5,.15,.15])
m.drawcoastlines(ax=ax0)
lon,lat=-15,47
lon0,lat0=lon,lat
scaleL=400
#pl.axes(ax0) #this will avoid the problem...
o=m.drawmapscale(ax=ax0,lon=lon,lat=lat,lon0=lon0,lat0=lat0,
length=scaleL,barstyle='fancy',fontcolor='r')
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the Basemap.drawmapscale entry point and inspect the fancy-style frame and tick plotting calls shown in the issue. Reproduce the supplied example with two axes, then verify that every part of the map scale is plotted on the ax0 axes rather than the current axes.

Written by the indexing model from the issue text.

Assessment

Tech stack
matplotlib, python
Domain
data-visualization
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.