cartopy icon indicating copy to clipboard operation
cartopy copied to clipboard

Add functionality for correct transforms in ax.annotate

Open abrammer opened this issue 2 years ago • 0 comments

fixes https://github.com/SciTools/cartopy/issues/1720

Rationale

Annotate has been "broken" for quite some time (https://stackoverflow.com/questions/25416600/why-the-annotate-worked-unexpected-here-in-cartopy), and while the work around is somewhat simple, fixing it to be more intuitive also seems fairly straight forward. Also recently raised in the open issue https://github.com/SciTools/cartopy/issues/1720 which spurred me on to open this PR.

I'm not particularly aware of underlying stuff here or if this is the "correct" way to fix it, but it seems like a relatively simple fix.

Implications

ax.annotate will function like most other GeoAxes.methods, but previous work arounds will continue to work.

Examples

added a couple simple tests which exemplify the various annotate transform configurations.

Example annotated maps: annotate_homolosine annotate_mercator

abrammer avatar Aug 04 '22 22:08 abrammer