Skip to content

Symlog scale leads to weird results #3788

@aplavin

Description

@aplavin

UPD: use MakieExtra.jl SymLog() for the same behavior as in matplotlib.


I’m trying to plot a 2d array with both positive an negative values, using a “symlog” colorscale in Makie.

This is what I get, looks weird – I cannot make any sense out of colorbar labels:

And this is what I expected it to be – result from matplotlib for the same array for comparison:

My issue here is with the colorscale specifically, not any other visual difference between Makie and matplotlib.

Full code for both:

# Makie:
let
	fig, ax, plt = image(A, colorscale=Makie.Symlog10(0.1), interpolate=false, colormap=:viridis)
	Colorbar(fig[1,2], plt)
	fig
end

# PyPlot:
let
	plt.figure()
	plt.imshow(A, norm=matplotlib.colors.SymLogNorm(0.1))
	plt.colorbar()
	plt.gcf()
end
  • are you running newest version (version from docs) ? – yes
  • can you reproduce the bug with a fresh environment ? (]activate --temp; add Makie) – yes
  • What platform + GPU are you on? – Any backend, same result.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions