Skip to content

Setting y-axis to invisible does not clear its title #1914

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

Closed
hylkevds opened this issue Jul 25, 2017 · 3 comments · Fixed by #1981
Closed

Setting y-axis to invisible does not clear its title #1914

hylkevds opened this issue Jul 25, 2017 · 3 comments · Fixed by #1981
Labels
bug something broken

Comments

@hylkevds
Copy link

Changing the visibility of an y-axis to false with Plotly.update does not clear the axis title from the graph. The axis itself (ticks, numbers, etc.) is removed.

The following jsfiddle (https://jsfiddle.net/tf6urjuq/) shows the issue. It's a modification of the "multiple y-axes example", with only 2 traces. The last two lines hide the second y-axis:

layout.yaxis2.visible = false;
Plotly.update('myDiv', data, layout);

But the text "yaxis2 title" is still visible.

Interestingly, when the axis is re-enabled with a different position, the title is moved to the new position.

@etpinard etpinard added the bug something broken label Jul 25, 2017
@rreusser
Copy link
Contributor

rreusser commented Aug 7, 2017

Actually that's a good question: should a hidden axis display the title or not? I'd tend to say yes since hiding the lines and showing the title seems like a valid thing to do. Then to hide the title, you just unset it.

Another reproduction: https://codepen.io/rsreusser/pen/MvpKaX

@hylkevds
Copy link
Author

hylkevds commented Aug 8, 2017

Unsetting or changing the title doesn't work. In my jsFiddle, add layout.yaxis2.title = ""; between the two plot command, and the title still shows.

@rreusser
Copy link
Contributor

rreusser commented Aug 8, 2017

Ah yes. Apologies. I meant it's unclear to me that visibility should affect the title at all. Right now it does and right now it's buggy. The part I was thinking through out loud is how best to fix it. It's definitely buggy though. 👍🏼

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

Successfully merging a pull request may close this issue.

3 participants