Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/makieorg/makiethemes.jl
Themes for Makie
https://github.com/makieorg/makiethemes.jl
Last synced: about 1 month ago
JSON representation
Themes for Makie
- Host: GitHub
- URL: https://github.com/makieorg/makiethemes.jl
- Owner: MakieOrg
- License: other
- Created: 2018-11-13T21:54:45.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-05-13T02:14:43.000Z (7 months ago)
- Last Synced: 2024-07-09T15:57:15.574Z (6 months ago)
- Language: Julia
- Size: 51.4 MB
- Stars: 26
- Watchers: 4
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# MakieThemes
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://makieorg.github.io/MakieThemes.jl/stable/)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://makieorg.github.io/MakieThemes.jl/dev/)
[![Build Status](https://github.com/MakieOrg/MakieThemes.jl/actions/workflows/CI.yml/badge.svg?branch=master)](https://github.com/MakieOrg/MakieThemes.jl/actions/workflows/CI.yml?query=branch%3Amaster)The idea of this package is to create a collection of themes for Makie to customize
the size and look of plot elements and colors. It will initially focus on porting
themes from existing plotting packages.Currently, we provide the following libraries:
- `GGThemr` - inspired by [ggthemr](https://github.com/cttobin/ggthemr), a R library for ggplot themes.
- `BBC` - emulating the BBC's plot style, found in [bbplot](https://github.com/bbc/bbplot).We do plan to add more themes, and PRs are welcome!
Here's the current default look of Makie:
```julia
using Makie, MakieThemes
Makie.demoscatter()
```Using the `:fresh` theme from `GGThemr`;
```julia
using MakieThemes
MakieThemes.demoscatter(theme_ggthemr(:fresh))
```Here's an expanded visualization based on the examples in the source theme:
Code
```julia
using CSV, DataFrames, MakieThemes, Makie, AlgebraOfGraphics
for dataset ∈ (:www, :drivers, :mtcars, :diamonds)
@eval $(dataset) = CSV.read(dirname(pathof(MakieThemes))*"/../data/"*$(string(dataset))*".tsv", delim = '\t', DataFrame)
endMakie.set_theme!(ggthemr(:fresh))
fig = Figure()
www_plot = data(www) * mapping(:Minute, :Users, color = :Measure) * (visual(Lines) + visual(Scatter) * mapping(marker = :Measure))
www_grid = draw!(fig[1, 1], www_plot)
legend!(fig[1, 1, Top()], www_grid; orientation = :horizontal, titleposition = :left)mtcars_plot = data(mtcars) * mapping(:mpg, color = :cyl => nonnumeric) * AlgebraOfGraphics.density()
mtcars_grid = draw!(fig[1, 2], mtcars_plot)
legend!(fig[1, 2, Top()], mtcars_grid; orientation = :horizontal, titleposition = :left)diamonds_plot = data(diamonds) * mapping(:price, color = :cut, stack = :cut) * AlgebraOfGraphics.histogram()
draw!(fig[2, 1], diamonds_plot; axis = (xtickformat = x -> string.(round.(Int, x)),))drivers_plot = data(drivers) * mapping(:Year, :Deaths) * visual(BoxPlot)
draw!(fig[2, 2], drivers_plot)fig
```This is the target theme I'm aiming for (image created with R)
## Color v/s style themes
In MakieThemes, we try to maintain a separation between _color_ themes (dark v/s light theme, background colors, palettes, etc) and _style_ themes (fonts, grid styles, title alignments, etc). This provides a lot of flexibility - you might
#### Current issues:
- [ ] axis line thickness
- [ ] the period of the dashed line