Skip to content

Add options to set plot dimensions#25

Merged
lispandfound merged 2 commits intomainfrom
plot_dimensions
Feb 4, 2025
Merged

Add options to set plot dimensions#25
lispandfound merged 2 commits intomainfrom
plot_dimensions

Conversation

@lispandfound
Copy link
Copy Markdown
Contributor

PR just adds --height and --width options to every CLI plotting tool to set the width and height of matplotlib plots in centimetres.


fig = plotting.gen_region_fig(title, region=region, map_data=None)
cm = 1 / 2.54
fig.set_size_inches(width * cm, height * cm)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests seem to not like this

  fig.set_size_inches(width * cm, height * cm)

E AttributeError: 'Figure' object has no attribute 'set_size_inches'

Copy link
Copy Markdown
Contributor Author

@lispandfound lispandfound Feb 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's because pygmt sets the plot size via the projection. I am updating that now.

@lispandfound lispandfound merged commit 8efe546 into main Feb 4, 2025
5 checks passed
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.

3 participants