# Monochrome theme

**URL:** https://discourse.julialang.org/t/monochrome-theme/45617
**Category:** Visualization
**Created:** [August 27, 2020, 9:07am UTC](https://discourse.julialang.org/t/monochrome-theme/45617 "2020-08-27T09:07:38Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![yordiak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yordiak/32/12584_2.png) [@yordiak](https://discourse.julialang.org/u/yordiak)
#### Post date: [August 27, 2020, 9:07am UTC](https://discourse.julialang.org/t/monochrome-theme/45617/1 "2020-08-27T09:07:38Z")

</div>

For publication purposes, I am interested to create a `monochrome` plots. In particular, how could I implement a monochrome theme in `Plots` (or in any other package) , similar to the `Monochrome` theme of `Mathematica`?

---

<div class="post-metadata">

### Author: ![anon37204545](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@anon37204545](https://discourse.julialang.org/u/anon37204545)
#### Post date: [August 27, 2020, 9:10am UTC](https://discourse.julialang.org/t/monochrome-theme/45617/2 "2020-08-27T09:10:05Z")

</div>

Use one of the monochromatic palettes as described on [ColorSchemes · Plots](https://docs.juliaplots.org/latest/generated/colorschemes/).

For example:

```julia
julia> function f(x, y)
           r = sqrt(x^2 + y^2)
           return r
       end
f (generic function with 1 method)

julia> x = range(-10, 10, length = 30)
-10.0:0.6896551724137931:10.0

julia> heatmap(x, x, f, c = :grays)

```

![heat](https://global.discourse-cdn.com/julialang/original/3X/8/0/801379d7480a38460f5e21ab9e459e58f24ad0cd.png)

---

<div class="post-metadata">

### Author: ![yordiak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yordiak/32/12584_2.png) [@yordiak](https://discourse.julialang.org/u/yordiak)
#### Post date: [August 27, 2020, 9:40am UTC](https://discourse.julialang.org/t/monochrome-theme/45617/3 "2020-08-27T09:40:34Z")

</div>

Thanks for your recommendation.

However, this solution does not fit into my needs. I am plotting two linear functions. When I use one of the `gray` palettes you mention the result is that either the color of one function is white, or both two functions have quite the same color.

Also, Mathematica’s `monochrome` theme is different. The first line is straight, the second is dashed, the third is dotted, and so on…

---

<div class="post-metadata">

### Author: ![casparvitch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/casparvitch/32/14100_2.png) [@casparvitch](https://discourse.julialang.org/u/casparvitch)
#### Post date: [August 27, 2020, 11:20am UTC](https://discourse.julialang.org/t/monochrome-theme/45617/4 "2020-08-27T11:20:12Z")

</div>

For a specific subset of (for example) the grays gradient, see the colorpalette section of the page linked above, or define your own palette with a vector of colors.

I would imagine you can then edit the style of each series with :linestyle as [seen here](https://docs.juliaplots.org/latest/generated/attributes_series/). I’m not entirely sure how to do that for a set of series, but it’s probably just a vector of symbols.

If you wanted to collect all of that together into a theme you could use on multiple plots, you could define your own theme, as seen [here](https://docs.juliaplots.org/latest/generated/plotthemes/). I don’t think that would take much effort, the framework there is really quite nice! I think a PR for that theme if you put some work into it would be appreciated by the Plots.jl team too.

---

<div class="post-metadata">

### Author: ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)
#### Post date: [August 27, 2020, 11:41am UTC](https://discourse.julialang.org/t/monochrome-theme/45617/5 "2020-08-27T11:41:57Z")

</div>

This theme is definitely something that would be nice to have. I can see you’ve opened an issue on PlotThemes that unfortunately received no traffic.  
Just for what you are doing there, how does `linecolor = :black, linestyle = :auto` work?

---

<div class="post-metadata">

### Author: ![yordiak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yordiak/32/12584_2.png) [@yordiak](https://discourse.julialang.org/u/yordiak)
#### Post date: [August 27, 2020, 12:00pm UTC](https://discourse.julialang.org/t/monochrome-theme/45617/6 "2020-08-27T12:00:53Z")

</div>

thanks, i will give it a try asap
