Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Log scale and tickmode #2885

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
WG- opened this issue Aug 8, 2018 · 4 comments
Closed

Log scale and tickmode #2885

WG- opened this issue Aug 8, 2018 · 4 comments
Labels
bug something broken

Comments

@WG-
Copy link

WG- commented Aug 8, 2018

I wanted to create a bode plot using plotly.js (Awesome framework btw guys, thumbs up for that). Now I stumbled upon some problems. The main problem is, is that tickmode: 'array' does not work when the axis type of the plot is type: 'log'. As such, you cannot use tickvals and ticktext.

In my current plot the x-axis of the plot (log-scale) the labels are formatted as: 10, 20, 50, 100, 200, 500, 1000, this is chosen by Plotly. However, I only want the labels 1, 100 and 1000. This I can easily establish, via tickmode: 'linear' for instance. However, doing this will remove all the tick lines for 20, 50, 200 and 500. So I tried forcing the tick lines via setting tickmode: 'array' and as follows tickvals: [10,20,30,40,50,60,70,80,90,100,200,300,400,500,600,700,800,900,1000] and ticktext: ['10','','','','','','','','','','100','','','','','','','','','','1000']

So what I want to end up with, are only the labels + ticklines of multiple of 10 and the ticklines of 20,30,40...,100,200,300,...,1000 et cetera.
Bode plot example

Codepen example: https://codepen.io/anon/pen/EpdqzQ

@alexcjohnson
Copy link
Collaborator

Thanks for the report @WG-

Oddly enough it works if you don't tell it to use tickmode: 'array' but provide tickvals and ticktext anyway so the plot infers tickmode: 'array' https://codepen.io/alexcjohnson/pen/QBJdQV?editors=0010

But you're of course correct that this isn't the intended behavior!

@alexcjohnson alexcjohnson added the bug something broken label Aug 8, 2018
@alexcjohnson
Copy link
Collaborator

(see also #903, which would be the better solution once we et around to implementing it)

@WG-
Copy link
Author

WG- commented Aug 8, 2018

Thanks @alexcjohnson for the workarround, and indeed #903 would indeed be a better solution.

@gvwilson
Copy link
Contributor

Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

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

3 participants