Skip to content

Commit

Permalink
good_looking_plots_in_grass.qmd: corrections/update (#8)
Browse files Browse the repository at this point in the history
- Correction of few small errors
- Follow changes in parameter names in v.boxplot and r.boxplot addons (see [#1271](OSGeo/grass-addons#1271))
  • Loading branch information
ecodiv authored Dec 30, 2024
1 parent 390baa0 commit c3a91a5
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ with the colors of the zonal map classes:
# Bash
```{bash}
g.extension extension=r.boxplot
r.boxplot -oc input=elevation zones=landclass96 output=r.boxplot.png
r.boxplot -oc map=elevation zones=landclass96 output=r.boxplot.png
```

# Python
```{python}
gs.run_command("g.extension", extension="r.boxplot")
gs.run_command("r.boxplot",
input="elevation",
map="elevation",
zones="landclass96",
raster_statistics="median,IQR",
output="r.boxplot.png",
Expand All @@ -78,6 +78,8 @@ gs.run_command("r.boxplot",

![](images/r.boxplot.png)

For more examples of the different options available in this addon, see [this tutorial](https://ecodiv.earth/post/drawing-boxplots-of-raster-values/#r.boxplot).

### [r.series.boxplot](https://grass.osgeo.org/grass-stable/manuals/addons/r.series.boxplot.html)

`r.series.boxplot` draws boxplots of a series of input raster maps that might
Expand Down Expand Up @@ -155,24 +157,24 @@ also provides an option to group by categories in a second attribute column.
# Bash

```{bash}
g.extension extension=v.histogram
g.extension extension=v.boxplot
v.boxplot -o -r map=bridges column=WIDTH group_by=YEAR_BUILT where="YEAR_BUILT < '1920'" order=ascending plot_output=boxplot_bridges_width_per_year.png
v.boxplot -r map=bridges column=WIDTH group_by=YEAR_BUILT where="YEAR_BUILT < '1920'" order=ascending output=boxplot_bridges_width_per_year.png
```

# Python

```{python}
gs.run_command("g.extension", extension="v.histogram")
gs.run_command("g.extension", extension="v.boxplot")
gs.run_command("v.boxplot",
map="bridges",
column="WIDTH",
group_by="YEAR_BUILT",
where="YEAR_BUILT < '1920'",
order="ascending",
plot_output="boxplot_bridges_width_per_year.png",
flags="or")
output="boxplot_bridges_width_per_year.png",
flags="r")
```
:::

Expand Down

0 comments on commit c3a91a5

Please sign in to comment.