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

theme_minimal mistitled #135

Open
JosiahParry opened this issue Jan 8, 2025 · 4 comments
Open

theme_minimal mistitled #135

JosiahParry opened this issue Jan 8, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@JosiahParry
Copy link

Describe the bug

TidierPlots.jl provides the function theme_minimal() which is supposed to correspond to ggplot2::theme_minimal() however the theme that is provided by TidierPlots.jl is akshually the ggplot2::theme_classic() function.

To Reproduce

using Tidier
using DataFrames
using PalmerPenguins

penguins = dropmissing(DataFrame(PalmerPenguins.load()));

ggplot(penguins, @aes(x = bill_length_mm, y = bill_depth_mm, color = species)) +
    geom_point() +
    theme_minimal()
image

Expected behavior

theme_minimal() looks like:

library(palmerpenguins)
library(ggplot2)

ggplot(penguins, aes(bill_length_mm, bill_depth_mm, color = species)) +
  geom_point() +
  theme_minimal()
#> Warning: Removed 2 rows containing missing values or values outside the scale range
#> (`geom_point()`).

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context

`~/.julia/environments/v1.11/Project.toml`
  [a93c6f00] DataFrames v1.7.0
  [7073ff75] IJulia v1.26.0
  [8b842266] PalmerPenguins v0.1.4
  [f0413319] Tidier v1.4.0
@JosiahParry JosiahParry added the bug Something isn't working label Jan 8, 2025
@kdpsingh
Copy link
Member

kdpsingh commented Jan 9, 2025

I love the eagle eye.

We actually re-export themes directly from the Makie package, so the question here is really whether we should rebuild the theme in TidierPlots to match ggplot2. It's not technically a bug in Makie (since the purpose of Makie isn't to match ggplot2), so it makes sense to address here rather than in the Makie repo.

Might be a good first-time PR for someone to tackle as building themes isn't all that difficult. Will let @rdboyes weigh in with additional thoughts.

@JosiahParry
Copy link
Author

It looks like Makie's theme_light is the same as ggplot2 theme_minimal and their theme_minimal is theme_classic in ggplot2 and Makie's theme_latexfonts being quite similar to theme_linedraw and

@kdpsingh
Copy link
Member

kdpsingh commented Jan 9, 2025

That's great to know. One slight shift in our philosophy (from our earlier philosophy of making things exactly match tidyverse) is that we want to play nice with Julia packages that we wrap for folks who are native Julia users (who may have never used R).

Since we directly export these functions from Makie, my suggestion here would be for us to mention this in the docs and not to necessarily remap the functions to match ggplot2.

@rdboyes
Copy link
Member

rdboyes commented Jan 9, 2025

I think we should document the built-in themes from Makie and include some instructions on customizing the theme, but not change the names of them to match the ggplot ones, unless we give them different names. To easy to have conflicts based on whether or not Makie is loaded, etc. For example ggplot2_minimal(), ggplot2_classic(), etc could be themes that are meant to match the R themes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants