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

Draw y axis in different ticks #3608

Closed
eromoe opened this issue Mar 6, 2019 · 3 comments
Closed

Draw y axis in different ticks #3608

eromoe opened this issue Mar 6, 2019 · 3 comments

Comments

@eromoe
Copy link

eromoe commented Mar 6, 2019

I don't see this feature in docs, so ask here.

For example, I create a scratter to show the percentage difference between real sale_count and my model predicted sale_count of some products :

image

--

percentage_difference = (predict_value - real_value)/real_value

Most of points mainly locate in 0 ~ 1 . (percentage 0% ~ 100% )
As we know, there are always some outliers in the data, some of them may exceed 10 .

So I want to display the plot y axis in : [-10, -5, -1, 0, 1, 5, 10]

500% ~ 1000% with length 1
100% ~ 500% with length 2
0% ~ 100% with length 3
0% ~ -100% with length 3
-100% ~ -500% with length 2
-500% ~ -1000% with length 1

I think this is an usual requirement.

@alexcjohnson
Copy link
Collaborator

Sounds like what you're interested in is a symlog / asinh transform as discussed in #221
Other arbitrary transformations (as well as symlog unless and until we add it to plotly.js) can be handled with custom tick labels - you can do something like:

  • set the trace.y values to the transformed data
  • provide the original data as part of trace.hovertext (or hovertemplate with the original data in customdata perhaps)
  • use yaxis.tickvals/ticktext to label the axis according to the transformation

@etpinard
Copy link
Contributor

etpinard commented Mar 8, 2019

Merging into #221

@etpinard etpinard closed this as completed Mar 8, 2019
@zxdawn
Copy link

zxdawn commented Aug 23, 2019

@eromoe I want the similar setting as yours: control the length for specific space. How did you deal with it at the end?

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

4 participants