Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- main
- fix-nb
- issue-632

jobs:
pages:
Expand Down
1 change: 0 additions & 1 deletion content/visualisation/01_matplotlib/_exo2_solution.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ g = sns.catplot(x='sum_counts', y='nom_compteur', data=df1, kind = "bar", height
g.set_axis_labels(xaxis, yaxis)
plt.title(title)
```
:::

::: {.content-visible when-profile="fr"}
```{python}
Expand Down
6 changes: 4 additions & 2 deletions content/visualisation/01_matplotlib/_exo4_solution.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -193,19 +193,20 @@ Here, there are few parameters to modify since our scales already suit us well (
:::


::: {.content-visible when-profile="en"}
::: {.content-visible when-profile="fr"}
## Les labels et les thèmes

La fin de la déclaration de notre figure se fait à travers les éléments de forme que sont les labels (axes, titres, notes de lecture...) et le thème (préconfiguré à travers la famille `theme_` ou personnalisé avec les paramètres de la fonction `theme`). Avant cela, réduisons la taille de nos labels de $y$
:::

::: {.content-visible when-profile="fr"}
::: {.content-visible when-profile="en"}
## Labels and themes

The final declaration of our figure is done using the formal elements that are labels (axes, titles, reading notes, etc.) and the theme (preconfigured through the `theme_` family or customised with the parameters of the `theme` function). Before that, let's reduce the size of our labels by $y$
:::

```{python}
#| echo: true
import textwrap

def wrap_label(s, width=30):
Expand All @@ -226,6 +227,7 @@ We can now customise our figure:
#| label: fig-gg5-fr-showed
#| output: false
#| echo: true

p = (
ggplot(df1, aes(x="nom_compteur", y="sum_counts")) +
geom_bar(stat="identity", fill="red") +
Expand Down
4 changes: 2 additions & 2 deletions content/visualisation/01_matplotlib/_intro.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ The subsequent step is to advance the work of communication and synthesis throug
::: {.callout-important}
## Utiliser une interface interactive pour visualiser les graphiques

Pour les chapitres de visualisation, il est vivement recommandé d’utiliser `Python` par le biais d'une interface interactive comme un _notebook Jupyter_ (via `VSCode` ou `Jupyter` par exemple, cf. [le chapitre de présentation des notebooks {{< fa arrow-up-right-from-square >}}](/content/getting-started/01_environment.qmd)){target="_blank"}.
Pour les chapitres de visualisation, il est vivement recommandé d’utiliser `Python` par le biais d'une interface interactive comme un _notebook Jupyter_ (via `VSCode` ou `Jupyter` par exemple, cf. [le chapitre de présentation des notebooks {{< fa arrow-up-right-from-square >}}](/content/getting-started/01_environment.qmd){target="_blank"}).

Cela permet de visualiser les graphiques immédiatement sous chaque cellule de code, de les ajuster facilement, et de tester des modifications en temps réel.

Expand All @@ -94,7 +94,7 @@ Cela permet de visualiser les graphiques immédiatement sous chaque cellule de c

## Use an interactive interface to visualize graphics

For visualization chapters, it is highly recommended to use `Python` via an interactive interface such as a _notebook Jupyter_ (via `VSCode` or `Jupyter` for example, see [the notebook presentation chapter {{< fa arrow-up-right-from-square >}}](/content/getting-started/01_environment.qmd)){target="_blank"}.
For visualization chapters, it is highly recommended to use `Python` via an interactive interface such as a _notebook Jupyter_ (via `VSCode` or `Jupyter` for example, see [the notebook presentation chapter {{< fa arrow-up-right-from-square >}}](/content/getting-started/01_environment.qmd){target="_blank"}).

This makes it possible to view the graphics immediately below each code cell, to adjust them easily, and to test modifications in real time.
Conversely, if scripts are run from a conventional console (e.g., by writing to a `.py` file and executing line by line with <kbd>MAJ</kbd>+,<kbd>ENTREE</kbd> in `VSCode`), the graphics will not be displayed in a popup window_ requiring additional commands to save them, before opening the exports manually and being able to correct the code if necessary. This makes for a more laborious learning experience.
Expand Down
3 changes: 2 additions & 1 deletion content/visualisation/01_matplotlib/_plotnine.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ We will need hierarchical data to have bars ordered in a consistent manner:
#| echo: true
df1["nom_compteur"] = pd.Categorical(
df1["nom_compteur"],
categories = df1["nom_compteur"][::-1]
categories = df1["nom_compteur"][::-1],
ordered=True
)
```

Loading
Loading