-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
Vertical or horizontal frame alignment of plot elements in a layout. #5673
Comments
Just came to thing of one possibly related topic: I am not sure what the future holds in terms of implementing something for the concept of multiple axes, e.g. twin axes #5355 and if this needs to be considered for the feature of axis alignment. |
Multiple-axis support is already ongoing in #5621. The changes to support this are done upstream in Bokeh, so I am unsure about all the details. The reason why I used |
Thanks for explanations! Really great to also see support for multiple axes is coming :-) |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi, I wanted to share a need that I sometime come across and one which I think could be common for more users. If tackled it could potentially simplify working with plotting in holoviews/hvplot even more.
Problem description
Mostly plots align quite well when composing holoviews elements into a layout, but sometimes I experience that axes are not aligned and it can be needs for cumbersome workarounds to make the axes/plots align. When composing a layout of two or more elements and these share one axis/dimension I kind of have an intuitive expectation that the axes would align.
The typical situation where the problem arises is when there is two or more plot elements and the width of the formatted label ticks are different on the dimensions that are not shared. This could be due to different number scales (e.g. ratio vs. thousands), custom tick formatting or no ticks in selected dimensions. This basically means different space taken by the ticks, ticks labels and axis label for the dimension not shared and thus the frames and axes are not auto-aligned anymore.
Code illustrating the issue:
df content:
lay dislays as:
Describe the solution you'd like
First I must say I really love the ‘frame_height’ and ‘frame_width’ arguments to holoviews bokeh elements as opposed to only having ‘height’ and ‘width’. These arguments provide ways to have the output much more as one expect it. I am wondering if it could be a similar concept for frame alignment (top, bottom, left, right) in elements input to holoviews layouts too. I am uncertain if this means development in the backend plotting library such as 'bokeh and do not really know the consequences in terms of effort.
I would want to say ‘frame_align’ = ‘left’, ‘x_dim_align’ = ‘True’ or similar. Not sure if it should be an option to layout or the elements though.
Describe alternatives you've considered
I raised a discussion in holoviz discourse on this and @MarcSkovMadsen showed a mitigating workaround using panel which is very useful, but also seems complicated if there was options to control alignment inside holoviews itself.
A workaround solution with panel aligment as proposed by @MarcSkovMadsen in holoviz discourse:
displays as:
which is good, but the toolbar is repeated and the workflow a bit complicated as it needs panel to be involved.
Additional context
I would think frame alignment may have been discussed for holoviews before especially for situations when one dimension and it's range is shared across several elements so this may be input to some already ongoing discussion.
The text was updated successfully, but these errors were encountered: