minimal working version
This commit is contained in:
parent
297ab3ef7e
commit
820858576a
@ -978,14 +978,21 @@ function _before_layout_calcs(plt::Plot{PyPlotBackend})
|
||||
cb."formatter".set_powerlimits((-Inf, Inf))
|
||||
cb."update_ticks"()
|
||||
|
||||
env = "\\mathregular" # matches the outer fonts https://matplotlib.org/tutorials/text/mathtext.html
|
||||
ticks = get_colorbar_ticks(sp)
|
||||
|
||||
if sp[:colorbar] in (:top, :bottom)
|
||||
axis = sp[:xaxis] # colorbar inherits from x axis
|
||||
cbar_axis = cb."ax"."xaxis"
|
||||
ticks_letter=:x
|
||||
else
|
||||
axis = sp[:yaxis] # colorbar inherits from y axis
|
||||
cbar_axis = cb."ax"."yaxis"
|
||||
ticks_letter=:y
|
||||
end
|
||||
|
||||
sp[:colorbar_ticks] == :native ? nothing : py_set_ticks(cb.ax, ticks, ticks_letter, env)
|
||||
|
||||
for lab in cbar_axis."get_ticklabels"()
|
||||
lab."set_fontsize"(py_thickness_scale(plt, axis[:tickfontsize]))
|
||||
lab."set_family"(axis[:tickfontfamily])
|
||||
|
||||
@ -130,7 +130,7 @@ function optimal_colorbar_ticks_and_labels(sp::Subplot, ticks = nothing)
|
||||
unscaled_ticks = map(RecipesPipeline.inverse_scale_func(scale), scaled_ticks)
|
||||
|
||||
labels = if any(isfinite, unscaled_ticks)
|
||||
formatter = ap[:colorbar_formatter]
|
||||
formatter = sp[:colorbar_formatter]
|
||||
if formatter in (:auto, :plain, :scientific, :engineering)
|
||||
map(labelfunc(scale, backend()), Showoff.showoff(scaled_ticks, formatter))
|
||||
elseif formatter == :latex
|
||||
@ -205,5 +205,5 @@ _transform_ticks(ticks::AbstractArray{T}) where T <: Dates.TimeType = Dates.valu
|
||||
_transform_ticks(ticks::NTuple{2, Any}) = (_transform_ticks(ticks[1]), ticks[2])
|
||||
|
||||
function _update_subplot_colorbars(sp::Subplot)
|
||||
|
||||
# Dynamic callback from the pipeline if needed
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user