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

Fix 3D heatmaps in CairoMakie #2959

Merged
merged 5 commits into from
Jul 18, 2023
Merged

Fix 3D heatmaps in CairoMakie #2959

merged 5 commits into from
Jul 18, 2023

Conversation

ffreyer
Copy link
Collaborator

@ffreyer ffreyer commented May 16, 2023

Description

Fixes #2889, though the heatmap tiles aren't exactly aligned and image still doesn't work

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • Added an entry in NEWS.md (for new features and breaking changes)
  • Added or changed relevant sections in the documentation
  • Added unit tests for new algorithms, conversion methods, etc.
  • Added reference image tests for new plotting functions, recipes, visual options, etc.

@ffreyer ffreyer changed the title use rect heatmap for 3D Fix 3D heatmaps in CairoMakie May 16, 2023
@ffreyer ffreyer added the CairoMakie This relates to CairoMakie, the vector backend for Makie based on Cairo. label May 16, 2023
@MakieBot
Copy link
Collaborator

MakieBot commented May 16, 2023

Compile Times benchmark

Note, that these numbers may fluctuate on the CI servers, so take them with a grain of salt. All benchmark results are based on the mean time and negative percent mean faster than the base branch. Note, that GLMakie + WGLMakie run on an emulated GPU, so the runtime benchmark is much slower. Results are from running:

using_time = @ctime using Backend
# Compile time
create_time = @ctime fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @ctime Makie.colorbuffer(display(fig))
# Runtime
create_time = @benchmark fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @benchmark Makie.colorbuffer(display(fig))
using create display create display
GLMakie 14.63s (13.75, 15.30) 0.58+- 1.43s (1.30, 1.52) 0.07+- 1.04s (0.98, 1.18) 0.07+- 16.84ms (16.37, 17.37) 0.34+- 124.85ms (121.63, 127.04) 1.82+-
master 14.58s (13.92, 15.32) 0.43+- 1.34s (1.27, 1.45) 0.06+- 986.10ms (947.44, 1036.17) 26.74+- 16.59ms (16.10, 16.88) 0.26+- 123.65ms (121.12, 127.14) 2.16+-
evaluation +0.32%, 0.05s invariant (0.09d, 0.87p, 0.50std) +6.59%, 0.09s slower❌ (1.44d, 0.02p, 0.07std) +5.11%, 0.05s noisy🤷‍♀️ (1.00d, 0.10p, 0.05std) +1.47%, 0.25ms invariant (0.81d, 0.16p, 0.30std) +0.96%, 1.2ms invariant (0.60d, 0.28p, 1.99std)
CairoMakie 12.31s (12.15, 12.47) 0.11+- 1.42s (1.38, 1.44) 0.02+- 272.69ms (268.13, 279.02) 4.23+- 12.53ms (12.31, 12.81) 0.19+- 7.16ms (7.06, 7.29) 0.07+-
master 12.31s (12.19, 12.49) 0.09+- 1.41s (1.40, 1.43) 0.01+- 271.63ms (266.35, 275.52) 3.72+- 12.72ms (12.51, 12.92) 0.15+- 7.20ms (7.08, 7.33) 0.10+-
evaluation -0.03%, -0.0s invariant (-0.04d, 0.95p, 0.10std) +0.12%, 0.0s invariant (0.10d, 0.85p, 0.02std) +0.39%, 1.06ms invariant (0.27d, 0.63p, 3.98std) -1.57%, -0.2ms invariant (-1.15d, 0.05p, 0.17std) -0.52%, -0.04ms invariant (-0.43d, 0.44p, 0.09std)
WGLMakie 15.91s (15.78, 16.07) 0.10+- 1.67s (1.54, 1.93) 0.12+- 14.36s (14.10, 14.79) 0.27+- 19.38ms (17.87, 23.56) 2.01+- 1.45s (1.35, 1.58) 0.07+-
master 15.93s (15.30, 16.55) 0.51+- 1.68s (1.57, 1.89) 0.11+- 14.50s (13.67, 15.03) 0.56+- 18.05ms (16.45, 19.46) 1.01+- 1.43s (1.35, 1.51) 0.05+-
evaluation -0.08%, -0.01s invariant (-0.03d, 0.95p, 0.31std) -0.34%, -0.01s invariant (-0.05d, 0.93p, 0.12std) -0.98%, -0.14s invariant (-0.32d, 0.56p, 0.41std) +6.85%, 1.33ms noisy🤷‍♀️ (0.84d, 0.15p, 1.51std) +1.41%, 0.02s invariant (0.33d, 0.54p, 0.06std)

@SimonDanisch
Copy link
Member

I think this is ready, no? :)

@ffreyer
Copy link
Collaborator Author

ffreyer commented Jul 14, 2023

It fixes the heatmap issue but the same issue still exists for image. I'm not sure what problems I ran into trying to fix it. I think I had issue getting the image to transform like the rect it's drawn on?

@ffreyer
Copy link
Collaborator Author

ffreyer commented Jul 14, 2023

I tried used a poylgon defined with line_to + image surface transformed by a matrix. That doesn't work because of perspective projection:
Screenshot from 2023-07-14 15-55-00

@ffreyer ffreyer marked this pull request as ready for review July 14, 2023 16:25
@ffreyer
Copy link
Collaborator Author

ffreyer commented Jul 14, 2023

I added the example from the issue as a refimg test. Maybe we should also add one for image and disable it in CairoMakie for now?

@github-actions
Copy link
Contributor

Missing reference images

Found 1 new images without existing references.
Upload new reference images before merging this PR.

@SimonDanisch SimonDanisch reopened this Jul 17, 2023
@MakieOrg MakieOrg deleted a comment from github-actions bot Jul 17, 2023
@SimonDanisch SimonDanisch merged commit 767756f into master Jul 18, 2023
27 checks passed
@SimonDanisch SimonDanisch deleted the ff/heatmap3D branch July 18, 2023 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CairoMakie This relates to CairoMakie, the vector backend for Makie based on Cairo.
Projects
Status: Ready, but unreviewed
Development

Successfully merging this pull request may close these issues.

CairoMakie plots heatmaps incorrectly in 3D
3 participants