Skip to content

Commit

Permalink
how to update themes
Browse files Browse the repository at this point in the history
  • Loading branch information
kimauth committed Sep 20, 2024
1 parent 6c28f75 commit ee33a84
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,19 @@ text!(ax, 3π/4, cos(3π/4); text="cos", align=(:right, :top), cycle, fontsize=1
save("my_12x8cm_figure.png", f; px_per_unit)
```
<img src="assets/my_12x8cm_figure.png" alt="Demofigure for figure and font sizes" width="454"/>
Now the figure will have resolution of 300dpi when displayed at 12cm x 8cm. The font sizes then correspond to 11pt on the diagram axes and 16pt for the text labels in the figure.

# Adapting the theme
The `publication_theme()` can be updated like any other Makie theme. For example changing the color palette that applies to line plots is done as follows:
```julia
using MakiePublicationTheme
using CairoMakie, Random # needed for demofigure

update_theme!(publication_theme();
palette = (color = Makie.to_colormap(:batlowKS),),
)

f = demofigure()
```
![Makie-theme-demofigure for publication theme with updated color palette](/assets/makie_demofigure2.png)

Binary file added assets/makie_demofigure2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ee33a84

Please sign in to comment.