Skip to content

Commit

Permalink
fix axis naming
Browse files Browse the repository at this point in the history
  • Loading branch information
VLucet committed May 3, 2024
1 parent bf80370 commit c1883b1
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ <h2 class="anchored" data-anchor-id="results">Results</h2>
<span id="cb9-7"><a href="#cb9-7" aria-hidden="true" tabindex="-1"></a> <span class="at">position =</span> <span class="st">"dodge"</span>) <span class="sc">+</span></span>
<span id="cb9-8"><a href="#cb9-8" aria-hidden="true" tabindex="-1"></a> <span class="fu">theme_bw</span>() <span class="sc">+</span></span>
<span id="cb9-9"><a href="#cb9-9" aria-hidden="true" tabindex="-1"></a> <span class="fu">theme</span>(<span class="at">axis.text.x =</span> <span class="fu">element_text</span>(<span class="at">angle =</span> <span class="dv">20</span>, <span class="at">vjust =</span> <span class="dv">1</span>, <span class="at">hjust =</span> <span class="dv">1</span>)) <span class="sc">+</span></span>
<span id="cb9-10"><a href="#cb9-10" aria-hidden="true" tabindex="-1"></a> <span class="fu">labs</span>(<span class="at">x =</span> <span class="st">"Land Use Class"</span>, <span class="at">y =</span> <span class="st">"Sum of Proportions"</span>,</span>
<span id="cb9-10"><a href="#cb9-10" aria-hidden="true" tabindex="-1"></a> <span class="fu">labs</span>(<span class="at">x =</span> <span class="st">"Land Use Class"</span>, <span class="at">y =</span> <span class="st">"Proportion"</span>,</span>
<span id="cb9-11"><a href="#cb9-11" aria-hidden="true" tabindex="-1"></a> <span class="at">fill =</span> <span class="st">"Scale"</span>, <span class="at">colour =</span> <span class="st">"Scale"</span>) <span class="sc">+</span></span>
<span id="cb9-12"><a href="#cb9-12" aria-hidden="true" tabindex="-1"></a> <span class="fu">scale_fill_manual</span>(<span class="at">values =</span> my_pal) <span class="sc">+</span></span>
<span id="cb9-13"><a href="#cb9-13" aria-hidden="true" tabindex="-1"></a> <span class="fu">scale_color_manual</span>(<span class="at">values =</span> my_pal)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
Expand Down
Binary file modified docs/index_files/figure-html/unnamed-chunk-14-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/search.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"href": "index.html#results",
"title": "Land Cover Analysis",
"section": "Results",
"text": "Results\nWe can plot the results with “dodged” ggplot2 barplots.\n\nmy_pal &lt;- c('#c7e9b4','#7fcdbb','#41b6c4','#1d91c0','#225ea8','#0c2c84')\n\nggplot(res) +\n geom_bar(aes(x = label, y = prop, fill = scale, colour = scale), \n alpha = 0.8,\n stat = \"identity\",\n position = \"dodge\") +\n theme_bw() +\n theme(axis.text.x = element_text(angle = 20, vjust = 1, hjust = 1)) +\n labs(x = \"Land Use Class\", y = \"Sum of Proportions\",\n fill = \"Scale\", colour = \"Scale\") +\n scale_fill_manual(values = my_pal) +\n scale_color_manual(values = my_pal)\n\n\n\n\n\n\n\n\nRemoving the land use classes than are not present around sites, we get a slightly easier graph to read.\n\nonly_at_sites &lt;- res |&gt; \n dplyr::filter(prop &gt; 0) |&gt; \n dplyr::filter(scale != \"Ecodistrict\") |&gt; \n dplyr::pull(label)\n\nres_filt &lt;- res |&gt; \n dplyr::filter(label %in% only_at_sites)\n\nggplot(res_filt) +\n geom_bar(aes(x = label, y = prop, fill = scale, colour = scale), \n alpha = 0.8,\n stat = \"identity\",\n position = \"dodge\") +\n theme_bw() +\n theme(axis.text.x = element_text(angle = 20, vjust = 1, hjust = 1)) +\n labs(x = \"Land Use Class\", y = \"Proportion\",\n fill = \"Scale\", colour = \"Scale\") +\n scale_fill_manual(values = my_pal) +\n scale_color_manual(values = my_pal)",
"text": "Results\nWe can plot the results with “dodged” ggplot2 barplots.\n\nmy_pal &lt;- c('#c7e9b4','#7fcdbb','#41b6c4','#1d91c0','#225ea8','#0c2c84')\n\nggplot(res) +\n geom_bar(aes(x = label, y = prop, fill = scale, colour = scale), \n alpha = 0.8,\n stat = \"identity\",\n position = \"dodge\") +\n theme_bw() +\n theme(axis.text.x = element_text(angle = 20, vjust = 1, hjust = 1)) +\n labs(x = \"Land Use Class\", y = \"Proportion\",\n fill = \"Scale\", colour = \"Scale\") +\n scale_fill_manual(values = my_pal) +\n scale_color_manual(values = my_pal)\n\n\n\n\n\n\n\n\nRemoving the land use classes than are not present around sites, we get a slightly easier graph to read.\n\nonly_at_sites &lt;- res |&gt; \n dplyr::filter(prop &gt; 0) |&gt; \n dplyr::filter(scale != \"Ecodistrict\") |&gt; \n dplyr::pull(label)\n\nres_filt &lt;- res |&gt; \n dplyr::filter(label %in% only_at_sites)\n\nggplot(res_filt) +\n geom_bar(aes(x = label, y = prop, fill = scale, colour = scale), \n alpha = 0.8,\n stat = \"identity\",\n position = \"dodge\") +\n theme_bw() +\n theme(axis.text.x = element_text(angle = 20, vjust = 1, hjust = 1)) +\n labs(x = \"Land Use Class\", y = \"Proportion\",\n fill = \"Scale\", colour = \"Scale\") +\n scale_fill_manual(values = my_pal) +\n scale_color_manual(values = my_pal)",
"crumbs": [
"Site Analysis",
"Land Cover Analysis"
Expand Down
2 changes: 1 addition & 1 deletion index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ ggplot(res) +
position = "dodge") +
theme_bw() +
theme(axis.text.x = element_text(angle = 20, vjust = 1, hjust = 1)) +
labs(x = "Land Use Class", y = "Sum of Proportions",
labs(x = "Land Use Class", y = "Proportion",
fill = "Scale", colour = "Scale") +
scale_fill_manual(values = my_pal) +
scale_color_manual(values = my_pal)
Expand Down

0 comments on commit c1883b1

Please sign in to comment.