prettymaps icon indicating copy to clipboard operation
prettymaps copied to clipboard

add support for rectanular radius

Open alexrashed opened this issue 3 months ago • 0 comments

Currently it is not easily possible to create a rectangular shape from coordinates. This PR simply extends the get_boundary function to also accept a tuple for the radius (to define "x-radius" and "y-radius"). This is a bit of a hacky solution, but I hacked it into my fork for a small project, and I thought it might make sense to file a PR. Feel free to drop / close this PR if it's too hacky ;)

Here's a test-snippet for the barcelona example from the README:

from prettymaps import *
from matplotlib import pyplot as plt

plot(
    (41.39491,2.17557),
    radius=(500, 707),
    figsize=(8.27, 11.69),
    preset="barcelona",
    save_as=f'barcelona.svg'
)

This would result in the following image: barcelona

Fixes https://github.com/marceloprates/prettymaps/issues/81

PS.: Thanks for this awesome OSS project! 😍

alexrashed avatar May 12 '24 10:05 alexrashed