GeoMakie meshimage colormap not applying and ticks overlapping

Hi, this is a continuation of a previous question I’ve had on here.

At the moment I have some code like this to produce a mollweide projection image of the whole sky:

using Healpix
using GeoMakie

function main()
    f = Figure()
    ax = GeoAxis(f[1, 1]; dest="+proj=moll", yticklabelpad=100.0)
    ax.xticksvisible = true
    nside = 8
    m = HealpixMap{Float64,RingOrder}(nside)
    m.pixels[:] = 1:length(m.pixels)
    rectimg = equirectangular(m)

    meshimage!(ax, -180 .. 180, -90 .. 90, reverse(rectimg[1]; dims=1); color=:jet, colormap=:jet, npoints=1000)



which nets this:

The default colormap is viridis, as stated in the Makie mesh documentation.


I would like to plot with a different colormap if possible, as seen in the example code, I’ve tried passing in colormap and color kwargs (both seperately and together) and it seems like they are ignored. Is there another method for setting the colormap?


I would also like the latitude ticks to not overlap with the image if possible, I’ve tried setting yticklabelpad=100.0 which seems to be ignored, same with trying to make the longitude ticks visible with xticksvisible=true and xticklabelsvisible=true.


This looks like an error with meshimage, which I should be able to correct in GeoMakie.

That being said, you can get around for this by now using something like:

    mi = meshimage!(ax, -180 .. 180, -90 .. 90, reverse(rectimg[1]; dims=1);  npoints=1000)
    mi.plots[1].colormap = :jet

which works for me.

Also, you might use a perceptually smoother colormap like :turbo instead of jet, which is known to be misleading (see e.g. this article) :slight_smile:

About your second question: a Mollweide projection can’t actually have longitude ticks, since the longitude lines end in a singularity at the top and bottom of the projection. The latitude lines are an issue that I’ll look into, though!

1 Like

Thank you, looks much better with :turbo, and I didn’t know there were some problems with jet before, interesting!