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

Text at edges of plots lost #13

Open
musoke opened this issue May 6, 2024 · 2 comments
Open

Text at edges of plots lost #13

musoke opened this issue May 6, 2024 · 2 comments

Comments

@musoke
Copy link
Contributor

musoke commented May 6, 2024

I have created a fresh environment

using Pkg
Pkg.activate(temp=true)
Pkg.add(["AlgebraOfGraphics", "CairoMakie", "MakiePublication"])
Pkg.status()
  [cbdf2221] AlgebraOfGraphics v0.6.18
  [13f3f980] CairoMakie v0.11.10
  [dde8697e] MakiePublication v0.3.5

and generated simple plot

using AlgebraOfGraphics
using CairoMakie
using MakiePublication

df = (x = [1, 2, 3, 4, 5], y = [1, 2, 3, 4, 5], c=[1, 2, 3, 1, 4])
layers = data(df) * mapping(:x, :y, color=:c => "bpqj") * visual(Scatter)

Rendering it with the default theme results in

draw(layers)

image

However, MakiePublication's theme_acs_2col results in the following figure:

with_theme(theme_acs_2col()) do    
    draw(layers)
end

image

This has two issues:

  • Text in colorbar labels is cut off. In particular, descenders on letters such as j, p, and q are not shown.
  • The "4" at the top of the colorbar is cutoff.

This behaviour is consistent in other MakiePublication themes I have tried.

@liuyxpp
Copy link
Owner

liuyxpp commented May 9, 2024

I can reproduce this. The cutting seems caused by the following line in the acs theme

theme_args = (figure_padding=0,

Change figure_padding to 4, the cutting is gone.

The purpose of this line is to produce a tight layout. However, it seems with colorbars, the Makie padding algo fails.

I am not familiar with AlgebraOfGraphics, but with normal Makie code, figure_padding can be reset when creating the figure object. Or, we can add a new keyword argument tight=true. When tight=false, set figure_padding=4.

@musoke
Copy link
Contributor Author

musoke commented May 9, 2024 via email

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

No branches or pull requests

2 participants