Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting ylim for utci_day_comfort_metrics plot causes odd overlaps between secondary axes #160

Open
tg359 opened this issue Dec 11, 2023 · 0 comments
Assignees
Labels
type:bug Error or unexpected behaviour

Comments

@tg359
Copy link
Contributor

tg359 commented Dec 11, 2023

Description:

In order to set ylims for the utci_day_comfort_metrics plot type (usually accessed via the ExternalComfort object), the axes added to this figure would need to each be individually access in order to modify these properties. In doing so, the plot getas a bit messed up and doesn't look as nice.

Merely exposing the ylims and variable-specific axes for this output would make it possible to fix the limits and ensure the plot gets generated correctly - without the need to hack apart something which mostly works.

The method can be found here:

Steps to reproduce:

Here is some code which does what we're trying to do ... but poorly

fig, ax = plt.subplots(1, 1, figsize=(10, 5))
ec.plot_utci_day_comfort_metrics(ax=ax, month=3, day=21)

_utci_ax, _dbt_ax, _mrt_ax, _rh_ax, _ws_ax = fig.get_children()[-5:]

_utci_ax.set_ylim(0, 40)
_dbt_ax.set_ylim(0, 50)
_mrt_ax.set_ylim(0, 100)
_ws_ax.set_ylim(0, 15)
_rh_ax.set_ylim(0, 100)

And this is what it generated, with the dodgy additional axes:
image

Expected behaviour:

ylims as additional args/kwargs to the plot method, also accessible from the ExternalComfort object which calls it.

Test file(s):

@tg359 tg359 added the type:bug Error or unexpected behaviour label Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Error or unexpected behaviour
Projects
None yet
Development

No branches or pull requests

2 participants