Skip to content

Commit

Permalink
build based on bf7b43b
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed May 12, 2024
1 parent df0a19d commit 9866130
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion dev/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.10.3","generation_timestamp":"2024-05-09T14:24:35","documenter_version":"1.4.1"}}
{"documenter":{"julia_version":"1.10.3","generation_timestamp":"2024-05-12T09:37:12","documenter_version":"1.4.1"}}
6 changes: 3 additions & 3 deletions dev/basics/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@

# Also works with PerceptualColourMaps
using PerceptualColourMaps # warning, installs PyPlot, PyCall, LaTeXStrings
img4 = get(PerceptualColourMaps.cmap(&quot;R1&quot;), rand(10,10))</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaGraphics/ColorSchemes.jl/blob/56a0f69d084a92628a9eaed5cc04e3ebff29bfda/src/ColorSchemes.jl#L249-L282">source</a></section><section><div><pre><code class="language-julia hljs">get(cs::ColorScheme, g::Color{T,1} where T&lt;:Union{Bool, AbstractFloat, FixedPoint})</code></pre><p>Return the color in <code>cs</code> that corresponds to the gray value <code>g</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaGraphics/ColorSchemes.jl/blob/56a0f69d084a92628a9eaed5cc04e3ebff29bfda/src/ColorSchemes.jl#L323-L327">source</a></section></article><h2 id="The-colorschemes-dictionary"><a class="docs-heading-anchor" href="#The-colorschemes-dictionary">The colorschemes dictionary</a><a id="The-colorschemes-dictionary-1"></a><a class="docs-heading-anchor-permalink" href="#The-colorschemes-dictionary" title="Permalink"></a></h2><p>The ColorSchemes module automatically provides a number of predefined schemes. All the colorschemes are stored in an exported dictionary, called <code>colorschemes</code>.</p><pre><code class="language-julia hljs">colorschemes[:summer] |&gt; show
img4 = get(PerceptualColourMaps.cmap(&quot;R1&quot;), rand(10,10))</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaGraphics/ColorSchemes.jl/blob/bf7b43b1659e38081973234069f762f1eabf1629/src/ColorSchemes.jl#L249-L282">source</a></section><section><div><pre><code class="language-julia hljs">get(cs::ColorScheme, g::Color{T,1} where T&lt;:Union{Bool, AbstractFloat, FixedPoint})</code></pre><p>Return the color in <code>cs</code> that corresponds to the gray value <code>g</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaGraphics/ColorSchemes.jl/blob/bf7b43b1659e38081973234069f762f1eabf1629/src/ColorSchemes.jl#L323-L327">source</a></section></article><h2 id="The-colorschemes-dictionary"><a class="docs-heading-anchor" href="#The-colorschemes-dictionary">The colorschemes dictionary</a><a id="The-colorschemes-dictionary-1"></a><a class="docs-heading-anchor-permalink" href="#The-colorschemes-dictionary" title="Permalink"></a></h2><p>The ColorSchemes module automatically provides a number of predefined schemes. All the colorschemes are stored in an exported dictionary, called <code>colorschemes</code>.</p><pre><code class="language-julia hljs">colorschemes[:summer] |&gt; show
ColorScheme(
ColorTypes.RGB{Float64}[
RGB{Float64}(0.0,0.5,0.4),
Expand Down Expand Up @@ -114,7 +114,7 @@
botticelli (notes) palette from artist Sandro Bot...


...found 6 results for &quot;ice&quot;</code></pre><p>To read the notes of a built-in colorscheme <code>cscheme</code>:</p><pre><code class="language-julia hljs">colorschemes[:cscheme].notes</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaGraphics/ColorSchemes.jl/blob/56a0f69d084a92628a9eaed5cc04e3ebff29bfda/src/ColorSchemes.jl#L145-L176">source</a></section></article><p>If you prefer, you can ‘roll your own’ search.</p><pre><code class="language-julia hljs">[k for (k, v) in ColorSchemes.colorschemes if occursin(r&quot;colorbrew&quot;i, v.category)]
...found 6 results for &quot;ice&quot;</code></pre><p>To read the notes of a built-in colorscheme <code>cscheme</code>:</p><pre><code class="language-julia hljs">colorschemes[:cscheme].notes</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaGraphics/ColorSchemes.jl/blob/bf7b43b1659e38081973234069f762f1eabf1629/src/ColorSchemes.jl#L145-L176">source</a></section></article><p>If you prefer, you can ‘roll your own’ search.</p><pre><code class="language-julia hljs">[k for (k, v) in ColorSchemes.colorschemes if occursin(r&quot;colorbrew&quot;i, v.category)]
265-element Array{Symbol,1}:
:BuPu_6
:Spectral_4
Expand Down Expand Up @@ -476,4 +476,4 @@
return ColorScheme([RGBA(get(cscheme, k), alpha) for k in range(0, 1, length=ncolors)])
end

colors = colorscheme_alpha(ColorSchemes.ice, ncolors=12)</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../catalogue/">« Catalogue</a><a class="docs-footer-nextpage" href="../goodpractice/">Good practice »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Thursday 9 May 2024 14:24">Thursday 9 May 2024</span>. Using Julia version 1.10.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
colors = colorscheme_alpha(ColorSchemes.ice, ncolors=12)</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../catalogue/">« Catalogue</a><a class="docs-footer-nextpage" href="../goodpractice/">Good practice »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Sunday 12 May 2024 09:37">Sunday 12 May 2024</span>. Using Julia version 1.10.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/catalogue/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65070,4 +65070,4 @@ <h2 id="Julia-logo-colorschemes"><a class="docs-heading-anchor" href="#Julia-log
</svg>
</div>
</div>
</article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Introduction</a><a class="docs-footer-nextpage" href="../basics/">Basic usage »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Thursday 9 May 2024 14:24">Thursday 9 May 2024</span>. Using Julia version 1.10.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
</article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Introduction</a><a class="docs-footer-nextpage" href="../basics/">Basic usage »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Sunday 12 May 2024 09:37">Sunday 12 May 2024</span>. Using Julia version 1.10.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
9 changes: 5 additions & 4 deletions dev/finding/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
julia&gt; cs = ColorScheme(range(Colors.RGB(0,0,0), stop=Colors.RGB(1,1,1), length=5))

julia&gt; getinverse(cs, cs[3])
0.5</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaGraphics/ColorSchemes.jl/blob/56a0f69d084a92628a9eaed5cc04e3ebff29bfda/src/ColorSchemes.jl#L332-L357">source</a></section></article><h2 id="Example-of-using-getinverse()"><a class="docs-heading-anchor" href="#Example-of-using-getinverse()">Example of using getinverse()</a><a id="Example-of-using-getinverse()-1"></a><a class="docs-heading-anchor-permalink" href="#Example-of-using-getinverse()" title="Permalink"></a></h2><p>One example use for <code>getinverse()</code> is to convert a heatmap image into an Array of continuous values, e.g. temperature.</p><p>In this example, we will convert a heatmap image representing elevation in the United States into an Array of elevation values. The image represents global temperature anomalies averaged from 2008 through 2012, with blue as -2°C and Red as +2°C. Higher than normal temperatures are shown in red (red is +2°C) and lower than normal temperatures are shown in blue (blue is -2°C). The global surface temperature in 2012 was +0.55°C. <a href="https://svs.gsfc.nasa.gov/cgi-bin/details.cgi?aid=4030">source</a>.</p><pre><code class="language-julia hljs">using Images, FileIO
img = download(&quot;https://www.nasa.gov/images/content/719282main_2008_2012_printdata.1462.jpg&quot;) |&gt; load
0.5</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaGraphics/ColorSchemes.jl/blob/bf7b43b1659e38081973234069f762f1eabf1629/src/ColorSchemes.jl#L332-L357">source</a></section></article><h2 id="Example-of-using-getinverse()"><a class="docs-heading-anchor" href="#Example-of-using-getinverse()">Example of using getinverse()</a><a id="Example-of-using-getinverse()-1"></a><a class="docs-heading-anchor-permalink" href="#Example-of-using-getinverse()" title="Permalink"></a></h2><p>One example use for <code>getinverse()</code> is to convert a heatmap image into an Array of continuous values, e.g. temperature.</p><p>In this example, we will convert a heatmap image representing temperature into an array of elevation values. The image represents global temperature anomalies averaged from 2008 through 2012, with blue as -2°C and Red as +2°C. Higher than normal temperatures are shown in red (red is +2°C) and lower than normal temperatures are shown in blue (blue is -2°C). The global surface temperature in 2012 was +0.55°C. </p><p><a href="https://www.giss.nasa.gov/research/news/archive/20130115/">NASA archive source</a>.</p><pre><code class="language-julia hljs">using Images, FileIO, Downloads, ColorSchemes
img = Downloads.download(&quot;https://www.giss.nasa.gov/research/news/archive/20130115/719282main_2008_2012_printdata.1462.jpg&quot;) |&gt; load
img = imresize(img, Tuple(Int(x) for x in size(img) .* 0.2));
display(img)</code></pre><p><img src="../assets/figures/heatmap1.png" alt="&quot;heatmap 1&quot;"/></p><pre><code class="language-julia hljs">temps = [getinverse(ColorSchemes.temperaturemap, pixel) for pixel in img]

Expand All @@ -32,7 +32,8 @@
0.801045 0.802513 0.802513 0.800252 … 0.804418 0.804308 0.801045
0.802037 0.798624 0.798624 0.798624 0.802401 0.800252 0.802848</code></pre><p>The image has been converted from its original colors to an array of continuous values between 0 and 1. This makes it possible to process as data. For example, we can find the places with the greatest anomalies:</p><pre><code class="language-julia hljs">mintemp, maxtemp = argmin(temps), argmax(temps)

(CartesianIndex(397, 127), CartesianIndex(17, 314))</code></pre><p>and these maximum and minimum &#39;coordinates&#39; can be displayed on the image using another package that allows you to mix images and vector graphics easily (such as Luxor.jl, for example).</p><pre><code class="language-julia hljs">save(&quot;/tmp/img.png&quot;, img)
(CartesianIndex(397, 127), CartesianIndex(17, 314))</code></pre><p>and these maximum and minimum &#39;coordinates&#39; can be displayed on the image using another package that allows you to mix images, text, and vector graphics easily (such as Luxor.jl, for example).</p><pre><code class="language-julia hljs">save(&quot;/tmp/img.png&quot;, img)

using Luxor
pngimg = readpng(&quot;/tmp/img.png&quot;)

Expand All @@ -52,4 +53,4 @@
label(&quot;largest positive anomaly&quot;, :E, maxpt, offset=20)
circle(minpt, 5, :fill)
label(&quot;largest negative anomaly&quot;, :E, minpt, offset=20)
end 800 460</code></pre><p><img src="../assets/figures/heatmap4.png" alt="&quot;heatmap min and max&quot;"/></p><p>We can display the array of continuous values as a grayscale image, where black is 0.0 and white is 1.0.</p><pre><code class="language-julia hljs">Gray.(temps)</code></pre><p><img src="../assets/figures/heatmap2.png" alt="&quot;heatmap 2 grey&quot;"/></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../goodpractice/">« Good practice</a><a class="docs-footer-nextpage" href="../plotting/">Plotting »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Thursday 9 May 2024 14:24">Thursday 9 May 2024</span>. Using Julia version 1.10.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
end 800 460</code></pre><p><img src="../assets/figures/heatmap4.png" alt="&quot;heatmap min and max&quot;"/></p><p>We can display the array of continuous values as a grayscale image, where black is 0.0 and white is 1.0.</p><pre><code class="language-julia hljs">Gray.(temps)</code></pre><p><img src="../assets/figures/heatmap2.png" alt="&quot;heatmap 2 grey&quot;"/></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../goodpractice/">« Good practice</a><a class="docs-footer-nextpage" href="../plotting/">Plotting »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Sunday 12 May 2024 09:37">Sunday 12 May 2024</span>. Using Julia version 1.10.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 9866130

Please sign in to comment.