Plots.jl: add 2d histogram with logarithmic bin colors

I want to use 2d histograms in Plots.jl, especially with the GR backend, that have logarithmic bin colors (log10). This appears not to be possible at the moment (or is it?).

So I’ve started the very short draft PR #2208 that adds a recipe for such histograms. However, there are some aspects that do not work yet and that I need help with:

  • Having a separate histogram2d_log10 recipe seems ugly. It would be nicer to integrate this with histogram2d recipe. But what parameter should be used to control the scale of the colors? scale?
  • The color bar and its ticks to not yet work as they should. It appears to me that I’d have to make a couple of changes to the GR backends code in order to make the color bar behave well in the logarithmic case (see the linked pull request for links to the spots that I think need to be changed). This seems to be a bigger endeavor that needs more experience with Plots.jl development than I have at the moment.

Is there someone with better knowledge on the Plots.jl internals that could give me some hints or guide me on how to achieve these goals?

2 Likes