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

Colorbar tick labels overlap with colorbar title #1396

Closed
jdugge opened this issue Feb 20, 2017 · 2 comments
Closed

Colorbar tick labels overlap with colorbar title #1396

jdugge opened this issue Feb 20, 2017 · 2 comments
Labels
bug something broken

Comments

@jdugge
Copy link
Contributor

jdugge commented Feb 20, 2017

When using a colorbar with titleside: 'right' and a small value for len, the colorbar tick labels can overlap with the colorbar title:

image

(Codepen: http://codepen.io/anon/pen/YNoOML)

var data = [ {
  z: [[0, 100],
       [75, 0]],
  type: 'heatmap',
  colorbar:{
    len: 0.35,
    title: 'My long label',
    titleside:'right',
    tickvals:[0,50,100],
    tickfont: {color: 'red'}
  }
}]; 

var layout = {};

Plotly.newPlot('myDiv', data, layout);

The workaround for avoiding this overlap given in #938 (comment) (using an invisible tickprefix) only works for titles that are to the left of the tick labels, unfortunately.

Is there a way to avoid this overlap with titles to the right of the tick labels?

@etpinard etpinard added the bug something broken label Feb 20, 2017
@hiteshsahu
Copy link

hiteshsahu commented Jun 16, 2017

You need to add <br> with the title text

Add <br\> as prefix if you want to add space on top of the title. Add <br\> with a &nbsp; if you want to add space after the title.

colorbar:{
         title: 'Speed(RPM)<br\> &nbsp;',
         titleside:'top',
         titlefont: {color: 'blue'}
       },

You can use <br> trick on other elements of Plotly as well. Hope it helps somebody. @etpinard you may close it.

@alexcjohnson
Copy link
Collaborator

closed by #2227

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

No branches or pull requests

4 participants