|
| 1 | +# WARNING |
| 2 | + |
| 3 | +https://github.com/JuliaPlots/PlotThemes.jl is now integrated into https://github.com/JuliaPlots/Plots.jl for Plots v2, please make corresponding PRs there. |
| 4 | + |
| 5 | +# PlotThemes |
| 6 | + |
| 7 | +[](https://travis-ci.org/JuliaPlots/PlotThemes.jl) |
| 8 | + |
| 9 | +#### Primary author: Patrick Kofod Mogensen (@pkofod) |
| 10 | + |
| 11 | +PlotThemes is a package to spice up the plots made with [Plots.jl](https://github.com/JuliaPlots/Plots.jl). To install: |
| 12 | + |
| 13 | +```julia |
| 14 | +Pkg.add("PlotThemes") |
| 15 | +``` |
| 16 | + |
| 17 | +## Using PlotThemes |
| 18 | + |
| 19 | +Currently the following themes are available: |
| 20 | +- `:default` |
| 21 | +- `:dark` |
| 22 | +- `:ggplot2` |
| 23 | +- `:juno` |
| 24 | +- `:lime` |
| 25 | +- `:orange` |
| 26 | +- `:sand` |
| 27 | +- `:solarized` |
| 28 | +- `:solarized_light` |
| 29 | +- `:wong` |
| 30 | +- `:wong2` |
| 31 | +- `:boxed` |
| 32 | +- `:gruvbox_dark` |
| 33 | +- `:gruvbox_light` |
| 34 | +- `:bright` |
| 35 | +- `:vibrant` |
| 36 | +- `:mute` |
| 37 | +- `:dao` |
| 38 | +- `:dracula` |
| 39 | +- `:rose_pine` |
| 40 | +- `:rose_pine_dawn` |
| 41 | + |
| 42 | + |
| 43 | +When using Plots, a theme can be set using the `theme` function: |
| 44 | +```julia |
| 45 | +using Plots |
| 46 | +theme(thm::Symbol; kwargs...) |
| 47 | +``` |
| 48 | +`theme` accepts any Plots [attribute](https://docs.juliaplots.org/stable/attributes/) as keyword argument and sets its value as default for subsequent plots. |
| 49 | + |
| 50 | +Themes can be previewed using `Plots.showtheme(thm::Symbol)`: |
| 51 | + |
| 52 | +### `:default` |
| 53 | + |
| 54 | + |
| 55 | +### `:dark` |
| 56 | + |
| 57 | + |
| 58 | +### `:ggplot2` |
| 59 | + |
| 60 | + |
| 61 | +### `:juno` |
| 62 | + |
| 63 | + |
| 64 | +### `:lime` |
| 65 | + |
| 66 | + |
| 67 | +### `:orange` |
| 68 | + |
| 69 | + |
| 70 | +### `:sand` |
| 71 | + |
| 72 | + |
| 73 | +### `:solarized` |
| 74 | + |
| 75 | + |
| 76 | +### `:solarized_light` |
| 77 | + |
| 78 | + |
| 79 | +### `:wong` |
| 80 | + |
| 81 | + |
| 82 | +### `:wong2` |
| 83 | + |
| 84 | + |
| 85 | +### `:boxed` |
| 86 | + |
| 87 | + |
| 88 | +### `:gruvbox_dark` |
| 89 | + |
| 90 | + |
| 91 | +### `:gruvbox_light` |
| 92 | + |
| 93 | + |
| 94 | +### `:bright` |
| 95 | + |
| 96 | + |
| 97 | +### `:vibrant` |
| 98 | + |
| 99 | + |
| 100 | +### `:mute` |
| 101 | + |
| 102 | + |
| 103 | +### `:dao` |
| 104 | + |
| 105 | + |
| 106 | +### `:dracula` |
| 107 | + |
| 108 | + |
| 109 | +### `:rose_pine` |
| 110 | + |
| 111 | + |
| 112 | +### `:rose_pine_dawn` |
| 113 | + |
| 114 | + |
| 115 | +## Contributing |
| 116 | +A theme specifies default values for different Plots [attributes](https://docs.juliaplots.org/stable/attributes/). |
| 117 | +At the moment these are typically colors, palettes and colorgradients, but any Plots attribute can be controlled by a theme in general. |
| 118 | +PRs for new themes very welcome! Adding a new theme (e.g. `mytheme`) is as easy as adding a new file (mytheme.jl) that contains at least the following line: |
| 119 | +```julia |
| 120 | +_themes[:mytheme] = PlotTheme(; kwargs...) |
| 121 | +``` |
| 122 | +The keyword arguments can be any collection of Plots attributes plus a colorgradient keyword argument. |
| 123 | +For adding the `showtheme` figure to `README.md`, use |
| 124 | +```julia |
| 125 | +Plots.showtheme(:your_theme) |
| 126 | +plot!(dpi=400) |
| 127 | +savefig("your_theme.png") |
| 128 | +``` |
| 129 | +The image can be uploaded to the `README.md` file by pulling it in with the file-editing web interface. |
0 commit comments