Open fhagemann opened 3 years ago
Thanks for your thorough research, I think the current behavior --- avoiding exponential offsets, is better as it complies with other backends better. So I would normally suggest this solution
using Plots.PlotMeasures
θ = range(0, 2π, length = 100)
r = range(0, 100, length = 100)
heatmap(θ, r, 1e-100 .* randn(length(r), length(θ)), projection = :polar, size = (400,400),
cbartitle=raw"$\times 10^{-100}$", right_margin = 100px)
But it is doing something I did not expect. Did something happen at https://github.com/JuliaPlots/Plots.jl/pull/3088? A better solution would be to calculate the color bar ticks within Plots (but this is something Plots does not do, am I right @daschw ?)
At this point I can only suggest you to hack the underlying PyObject and adjust things there. You can access it
p1 = heatmap(θ, r, 1e-100*randn(length(r), length(θ)), projection = :polar, size = (400,400))
p1.o # This is an pyobject that contains matplotlib content of the plot where you can tweak it if you know the matplotlib api
Thanks @isentropic for your reply, that will help!!
I was just a bit confused because gr
converts the ticks to the E-notation
When working with very small (e.g. 1e-100) or very big numbers (e.g. 1e100), polar heatmaps with the
pyplot
backend show a weird layout. This is probably due to the format of the colorbar tick labels. Since Plots v1.3.3 (#2722), thepyplot
backend writes the tick labels with all decimal places which seems to mess up the layout of the polar plot.Minimum working example for a polar heatmap with very small numbers (order 1e-100):
Plots v1.3.2 and before:
Plots v1.3.3 until Plots v1.7.1:
With Plots v1.7.2 (#3088), the layout changed, but the plot is still layout is still not recovered. It is also interesting that the right ticks in the polar plot shows 180° rather than 0°.
Plots v1.7.2 and after:
The
gr
backend displays the colorbar tick labels in the E-notation (1E-100), preventing very long numbers.Is there a way of setting the formatting of the colorbar tick labels back to the E-notation from Plots v1.3.2 with a keyword argument or is it possible to implement a default value for which the
pyplot
backend switches back to the E-notation?