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

Standalone colorbar #6354

Open
LecrisUT opened this issue Aug 2, 2024 · 4 comments
Open

Standalone colorbar #6354

LecrisUT opened this issue Aug 2, 2024 · 4 comments

Comments

@LecrisUT
Copy link
Contributor

LecrisUT commented Aug 2, 2024

Is your feature request related to a problem? Please describe.

I am trying to plot a stacked line plot with a colorbar. I am able to construct it using the *= operator like:

            for t_ind, t_val in enumerate(curr_data["t"]):
                if t_ind % _skip != 0:
                    continue
                plot_data = curr_data.sel(t=t_val)
                plot_data = abs(plot_data)
                plot_data += _y_offset * (t_ind // _skip)
                overlay *= plot_data.hvplot(kind="line", x="x")
            overlay = overlay.opts(
                holoviews.opts.Curve(color=holoviews.Palette("Viridis")),
            )

The issue comes when I try to add colorbar=True either to .opts() or to .hvplot(), neither of which create the colorbar associated with it. On top of this, I would want to customize the position of the colorbar to be horizontal because I need it to span a layout of such plots

Describe the solution you'd like

Two features that would help here:

  • Ability to use colorbar=true with line plots. Probably there is a bug that this is not possible
  • Ability to create an independent colorbar that can be used with overlay *= or a layout

Describe alternatives you've considered

See #6355

@ahuang11
Copy link
Collaborator

Can you clarify what a colorbar for a line plot would look like?

@LecrisUT
Copy link
Contributor Author

I might have cropped the plot in #6355, but basically it is for a stacked lineplot and the colorbar goes across the overlay's dimension, i.e. across the stack's offset.

@ahuang11
Copy link
Collaborator

I'm still somewhat confused what the colors in the colorbar would represent.

@LecrisUT
Copy link
Contributor Author

I'm on mobile now, but consider this graph but with a semi-continuous transition. The colorbar would be a z-axis of time or applied laser strength, etc.

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

No branches or pull requests

2 participants