Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

heatmap ticks are "off" #661

Closed
piever opened this issue Jul 24, 2020 · 4 comments
Closed

heatmap ticks are "off" #661

piever opened this issue Jul 24, 2020 · 4 comments
Labels
bug Makie Backend independent issues (Makie core)

Comments

@piever
Copy link
Contributor

piever commented Jul 24, 2020

Sorry for the uninformative title! I find that the x and y values should be at the center of the bins.

For example, for heatmap(1:3, 1:4, rand(3, 4)) Makie gives (note the ticks placement)

makie_heatmap

But I believe that the correct x, y values are those given by Plots (with the same command):

plots_heatmap

@piever piever added Makie Backend independent issues (Makie core) bug labels Jul 24, 2020
@piever piever changed the title heatmap ticks are a "off" heatmap ticks are "off" Jul 24, 2020
@kool7d
Copy link

kool7d commented Sep 5, 2020

Shifting the indices like this works for me. Maybe there could be a kwarg for centering ticks in general, since I also do something like this for my stuff.

heatmap(1:3, 1:4, rand(3, 4))

indexshift(idxs,shift=1.0) = try
	float.(idxs).+=shift .|> Int
catch
	float.(idxs).+=shift
end

xs = 1:3; ys = 1:4; data = rand(3, 4)
xs = indexshift([xs...,xs[end]+1], -0.5)
ys = indexshift([ys...,ys[end]+1], -0.5)

heatmap(xs, ys, data)

@mschauer
Copy link
Contributor

mschauer commented Sep 6, 2020

I could see that the makie default would be the one you want when putting a heat map as background of a figure.

@lazarusA
Copy link
Contributor

It seems that this is still an issue even in the latest release. It would be good to have this working properly, this is something a lot of would use in a daily basis. Cheers!

@piever
Copy link
Contributor Author

piever commented May 7, 2021

Fixed on master by JuliaPlots/AbstractPlotting.jl#727

@piever piever closed this as completed May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Makie Backend independent issues (Makie core)
Projects
None yet
Development

No branches or pull requests

4 participants