Skip to content

Conversation

BibMartin
Copy link
Contributor

My idea when computing 3f4fc1b was to display in the notebook a figure with the same size as matplotlib figures. If you tune your figsize, it will keep the same shape :

fig = plt.figure(figsize=(17,10))
plt.plot(...)
mplleaflet.display(fig)

But as @jwass notice in 1c1ce59, the defaut matplotlib figure is tiny (and ugly for a map).

This PR adds a figsize option in the display, so that mplleaflet.display(fig) will keep the figure size, and mplleaflet.display(fig,figsie="100%") will enalble to use the full width of the output cell.
By the way, this latter example will keep the figure's aspect ratio.

You can also force the output size like:

mplleaflet.display(fig, figsize=("60%","150px"))
mplleaflet.display(fig, figsize=(17,5))
mplleaflet.display(fig, figsize="60%")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants