Skip to content

Improve CairoMakie 3D plots - #139

Open
mariekeosw wants to merge 1 commit into
mainfrom
mo/fix/CairoMakie-3D
Open

Improve CairoMakie 3D plots#139
mariekeosw wants to merge 1 commit into
mainfrom
mo/fix/CairoMakie-3D

Conversation

@mariekeosw

Copy link
Copy Markdown
Collaborator

This PR addresses a few issues I ran into with 3D Makie plots:

  • adds colorscale = :log for 3D scalar plots while keeping :linear as the default,
  • applies the scaling consistently to the mesh and colorbar,
  • improves the font sizes of axis labels, ticks, and colorbars.

Below is an example using electron-density data from my master's thesis.

Linear scale:
image

Logarithmic scale:
image

Feedback is very welcome, especially on whether this is the right way to handle the logarithmic scaling!

@mariekeosw

Copy link
Copy Markdown
Collaborator Author

The failed checks might be related to the issue discussed in #137. The failing runs for this PR also use matplotlib 3.11.1. Has there been any update on this issue?

@pjaap pjaap left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks for addressing this issue. It should definitely be resolved.
I have some comments below, which should be considered.

colorbar_ticks = if islog
(
log10.(tickvalues),
["10^$(round(Int, log10(t)))" for t in tickvalues],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not like the hardcoded String ticks here. Is there no legend mechnism in Makie?

If not: Can you use LaTeXStrings, such that 10^x is rendered as LaTeX?

Comment thread src/dispatch.jl
:viridis,
"2D/3D contour plot color map (any from [ColorSchemes.jl](https://juliagraphics.github.io/ColorSchemes.jl/stable/basics/#Pre-defined-schemes))"
),
:colorscale => Pair(:linear, "Color scale for scalar plots (:linear or :log; :log requires positive color limits and ticks)"),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about log10 and log2 ? I can image that both may be relevant. If the same mechanism can be re-used, than I suggest to allow for both bases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants