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

allow for horizontal colorbar #1244

Closed
mg1075 opened this issue Dec 11, 2016 · 26 comments · Fixed by #6024
Closed

allow for horizontal colorbar #1244

mg1075 opened this issue Dec 11, 2016 · 26 comments · Fixed by #6024
Labels
feature something new
Milestone

Comments

@mg1075
Copy link

mg1075 commented Dec 11, 2016

feature request: horizontal colorbar for heatmap, 3d graphs, etc.

The api for the colorbar seems to only allow for a colorbar positioned vertically.
image

But what if someone wants the bar displayed horizontally?
As far as I can tell from the api, this is not possible, but it would be nice to have.

image

@etpinard etpinard added the feature something new label Dec 11, 2016
@isokrates
Copy link

This would be great—it would make things centre on the page in a much more visually appealing way!

@cdsontag
Copy link

This would be a great benefit to the JWST ETC project. With the colorbar vertical, any variation in the number of sig. figs shown for the colorbar numerical tick values change the width of the whole area.

@antoinerg
Copy link
Contributor

@divyachandran-ds brought this issue to my attention.

I think that allowing colorbars to have an horizontal orientation would be really useful as well as tight control of their position to not waste (sometimes very precious) space.

We should aim to reproduce a figure like this one:
screenshot_2019-03-01_14-45-00

@chriddyp
Copy link
Member

chriddyp commented Oct 23, 2019

If your organization has a software budget and needs this feature, you can prioritize & sponsor the development of it by reaching out to our team: https://plot.ly/products/consulting-and-oem/. Much of our development is funded this way.

Otherwise, we'll update this issue when it's planned for an upcoming release. There are no updates at this moment and it is still a great idea.

@Z-me
Copy link

Z-me commented Dec 6, 2019

I applied CSS forcibly because this issue is not solved... 😢

Since this way has a heavy browser load, I want you to create a property that makes this horizontal ColorBar quickly. 🙇

image

@JeroneGagliano
Copy link

Agree with @antoinerg. This also helps when the corresponding plot changes height based on the data (eg time-series heatmap) and the vertical bar can get cut off.

@theodcr
Copy link

theodcr commented Jun 30, 2020

@JeroneGagliano for your issue you can set the layout height and yaxis domain according to the size of your data, but I agree a horizontal colorbar would be more convenient.

@rusiano
Copy link

rusiano commented Jul 22, 2020

+1

1 similar comment
@elmargasimov
Copy link

+1

@essafik
Copy link

essafik commented Sep 27, 2020

I applied CSS forcibly because this issue is not solved... 😢

Since this way has a heavy browser load, I want you to create a property that makes this horizontal ColorBar quickly. 🙇

image

@Z-me Is that a workaround for the heatmap? If yes, could you share how you managed to get it?

@nicolaskruchten
Copy link
Contributor

This issue has been tagged with NEEDS SPON$OR

A community PR for this feature would certainly be welcome, but our experience is deeper features like this are difficult to complete without the Plotly maintainers leading the effort.

Sponsorship range: $10k-$15k

What Sponsorship includes:

  • Completion of this feature to the Sponsor's satisfaction, in a manner coherent with the rest of the Plotly.js library and API
  • Tests for this feature
  • Long-term support (continued support of this feature in the latest version of Plotly.js)
  • Documentation at plotly.com/javascript
  • Possibility of integrating this feature with Plotly Graphing Libraries (Python, R, F#, Julia, MATLAB, etc)
  • Possibility of integrating this feature with Dash
  • Feature announcement on community.plotly.com with shout out to Sponsor (or can remain anonymous)
  • Gratification of advancing the world's most downloaded, interactive scientific graphing libraries (>50M downloads across supported languages)

Please include the link to this issue when contacting us to discuss.

@essafik
Copy link

essafik commented Oct 15, 2020

Maybe I am missing something and I would like to understand where the difficulty resides. Can someone explain to me why implementing this feature is particularly difficult? From my perspective, it is simply a pi/2 rotation of the colorbar with a repositioning. So far, when I really need to have the colorbar horizontal, I just export my graph in svg and do the manipulation manually in Inkscape. It's not practical when having many graphs to do but it does the trick for now. From this manipulation, one can see that the colorbar is a seperate element from the graph so it should be possible to give us a way to rotate and choose the position of the colorbar.

@nicolaskruchten
Copy link
Contributor

Indeed graphically it's solely a question of rotation. The complexity lies partly in the automatic tick-label orientation, and in the interaction between the color bar, tick label lengths and the plot margins. If you have a color bar with long tick labels below a chart with long tick labels, there's a fair bit of interplay that we need to take into account to ensure that the tick labels don't overlap each other, or overlap the color bar, or run off the end of the plot.

We would love a pull request for this feature if you feel you're able to easily put together a solution :)

@usser123
Copy link

usser123 commented Aug 3, 2021

+1

@michaelcraige
Copy link

I would greatly appreciate a solution for moving the color scale bar up top or horizontal below

@plotly plotly deleted a comment from huangzhenyu Aug 10, 2021
@kingdom031
Copy link

I would greatly appreciate a solution for moving the color scale bar up top or horizontal below

+1

@ReichYang
Copy link

Any updates on this :(

@Tixierae
Copy link

Tixierae commented Nov 1, 2021

One more upvote for a horizontal colorbar

@archmoj
Copy link
Contributor

archmoj commented Nov 1, 2021

One more upvote for a horizontal colorbar

We are actually working on it : )

@JeroneGagliano
Copy link

JeroneGagliano commented Nov 1, 2021 via email

@archmoj archmoj added this to the v2.7.0 milestone Nov 23, 2021
@archmoj archmoj modified the milestones: v2.7.0, v2.8.0 Dec 3, 2021
@janosh
Copy link

janosh commented Dec 10, 2021

Thanks @archmoj! Will this be in the next release of plotly.py?

@archmoj
Copy link
Contributor

archmoj commented Dec 10, 2021

Thanks @archmoj! Will this be in the next release of plotly.py?

Yes

@arielhgl
Copy link

Thanks @archmoj! will this be available for the R Plotly distribution, wether through ggplotly or plot_ly?

@aalyousfi
Copy link

@archmoj I'm using Plotly JavaScript 1.58.5 and I'm still not able to make the colorbar horizontal in a choropleth map.

@alexcjohnson
Copy link
Collaborator

If you’re using 1.58.5 because it’s “latest” via CDN, please note that we did not advance the “latest” tag to v2.x, to avoid pushing breaking changes to users. Please use an explicit recent version, current is 2.24.2

@chanansh
Copy link

the issue is since 2016 and still have not solved in 2025! @archmoj

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

Successfully merging a pull request may close this issue.