plotly / plotly.py

The interactive graphing library for Python :sparkles: This project now includes Plotly Express!
https://plotly.com/python/
MIT License
16.2k stars 2.55k forks source link

implement logarithmic color_continuous_scale #3616

Open eisenlohr opened 2 years ago

eisenlohr commented 2 years ago

It would be helpful to have an option (named, for instance, log_color) that allows using color maps on logarithmic scales, similar to log_x, log_y, log_z. This would essentially rescale the standard linear color range to the corresponding log values, i.e. coloring of v would be linear in log(v).

cemde commented 1 year ago

is this related to #3735 ?

eisenlohr commented 1 year ago

is this related to #3735 ?

Yes, seems to be the same issue. What is missing is a simple way to have the color scale be equidistant on a log (in contrast to linear) scale.

Let's say the color range is between values A and B. Linear example: value (A+B)/2 is colored using the midpoint of the color scale. Log example: value sqrt(A*B) is colored using the midpoint of the color scale