Skip to content

Commit 137575d

Browse files
committed
Définir le titre de la légende
1 parent 55301ef commit 137575d

5 files changed

Lines changed: 38 additions & 52 deletions

File tree

en/05-altair.ipynb

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,13 @@
4949
"source": [
5050
"## Why `altair`? Why not `matplotlib`?\n",
5151
"\n",
52-
"While `matplotlib` is a widely used and\n",
53-
"quite flexible visualization library, the plots\n",
54-
"programming does not follow a specific *grammar*.\n",
55-
"\n",
56-
"In this chapter, we have decided to present the `altair` library which\n",
57-
"[facilitates the creation of highly informative charts](https://altair-viz.github.io/index.html)\n",
52+
"While `matplotlib` is a widely used and quite flexible\n",
53+
"visualization library, the plots programming is not\n",
54+
"as intuitive as with `altair`. Moreover, the `altair`\n",
55+
"[library](https://altair-viz.github.io/index.html)\n",
56+
"facilitates the creation of highly informative\n",
57+
"[interactive graphics](https://vega.github.io/vega-lite/)\n",
5858
"from data stored in Pandas objects.\n",
59-
"It is based on the grammar of interactive graphics of\n",
60-
"[Vega-Lite](https://vega.github.io/vega-lite/),\n",
61-
"which makes the programming both elegant and powerful.\n",
6259
"\n",
6360
"We will see different visualization concepts that can\n",
6461
"be reproduced more or less easily with other libraries\n",
@@ -468,7 +465,7 @@
468465
"lang": "en"
469466
},
470467
"source": [
471-
"* The title and axis labels can be set:"
468+
"* The titles and the axis labels can be set:"
472469
]
473470
},
474471
{
@@ -483,7 +480,7 @@
483480
"alt.Chart(surveys_complete).mark_point().encode(\n",
484481
" x=alt.X('hindfoot_length').title('Hindfoot length (mm)'),\n",
485482
" y=alt.Y('weight').scale(type='log', base=2).title('Weight (g)'),\n",
486-
" color=alt.Color('species_id'),\n",
483+
" color=alt.Color('species_id').title('Species ID'),\n",
487484
" tooltip=['species_id'],\n",
488485
").configure_mark(\n",
489486
" opacity=0.05,\n",
@@ -916,7 +913,7 @@
916913
"source": [
917914
"`2`. Create the boxplot:\n",
918915
"* The full species names on the X axis, with the label \"Species\"\n",
919-
"* The noisy weights on the Y axis, with a logarithmic\n",
916+
"* The weights on the Y axis, with a logarithmic\n",
920917
" scale in base 2 and with the label \"Weight (g)\"\n",
921918
"* One color for each species identifier\n",
922919
"* A title for the chart\n",

fr/05-altair.ipynb

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,11 @@
5151
"\n",
5252
"Bien que `matplotlib` soit une bibliothèque de visualisation\n",
5353
"largement répandue et relativement flexible, la programmation\n",
54-
"des graphiques ne suit pas une *grammaire* spécifique.\n",
55-
"\n",
56-
"Ainsi, pour ce chapitre, nous avons fait le choix\n",
57-
"de vous présenter la bibliothèque `altair` qui\n",
58-
"[facilite la création de graphiques hautement informatifs](https://altair-viz.github.io/index.html)\n",
59-
"tout en s'intégrant bien avec Pandas. Le fonctionnement de\n",
60-
"`altair` se base sur la grammaire des graphiques interactifs\n",
61-
"de [Vega-Lite](https://vega.github.io/vega-lite/),\n",
62-
"ce qui rend la programmation à la fois élégante et puissante.\n",
54+
"des graphiques n'est pas aussi intuitive qu'avec `altair`.\n",
55+
"De plus, [la bibliothèque](https://altair-viz.github.io/index.html)\n",
56+
"`altair` permet de créer facilement des \n",
57+
"[graphiques interactifs](https://vega.github.io/vega-lite/) et\n",
58+
"hautement informatifs tout en s'intégrant bien avec Pandas.\n",
6359
"\n",
6460
"Nous verrons différents concepts de visualisation qui peuvent être\n",
6561
"reproduits plus ou moins facilement avec d'autres bibliothèques\n",
@@ -466,7 +462,7 @@
466462
"lang": "fr"
467463
},
468464
"source": [
469-
"* Modifier le nom des axes :"
465+
"* Définir les titres et le nom des axes :"
470466
]
471467
},
472468
{
@@ -481,7 +477,7 @@
481477
"alt.Chart(surveys_complet).mark_point().encode(\n",
482478
" x=alt.X('hindfoot_length').title('Longueur arrière-pied (mm)'),\n",
483479
" y=alt.Y('weight').scale(type='log', base=2).title('Poids (g)'),\n",
484-
" color=alt.Color('species_id'),\n",
480+
" color=alt.Color('species_id').title(\"Code d'espèce\"),\n",
485481
" tooltip=['species_id'],\n",
486482
").configure_mark(\n",
487483
" opacity=0.05,\n",
@@ -914,7 +910,7 @@
914910
"source": [
915911
"`2`. Créez le box-plot:\n",
916912
"* Le nom des espèces sur l'axe horizontal, avec l'étiquette \"Espèce\"\n",
917-
"* Le poids bruité dans l'axe vertical, selon une échelle logarithmique\n",
913+
"* Le poids dans l'axe vertical, selon une échelle logarithmique\n",
918914
" en base 2 et avec l'étiquette \"Poids (g)\"\n",
919915
"* Une couleur selon l'identifiant d'espèce\n",
920916
"* Un titre pour le graphique\n",

solution-en/05-altair.ipynb

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,13 @@
4949
"source": [
5050
"## Why `altair`? Why not `matplotlib`?\n",
5151
"\n",
52-
"While `matplotlib` is a widely used and\n",
53-
"quite flexible visualization library, the plots\n",
54-
"programming does not follow a specific *grammar*.\n",
55-
"\n",
56-
"In this chapter, we have decided to present the `altair` library which\n",
57-
"[facilitates the creation of highly informative charts](https://altair-viz.github.io/index.html)\n",
52+
"While `matplotlib` is a widely used and quite flexible\n",
53+
"visualization library, the plots programming is not\n",
54+
"as intuitive as with `altair`. Moreover, the `altair`\n",
55+
"[library](https://altair-viz.github.io/index.html)\n",
56+
"facilitates the creation of highly informative\n",
57+
"[interactive graphics](https://vega.github.io/vega-lite/)\n",
5858
"from data stored in Pandas objects.\n",
59-
"It is based on the grammar of interactive graphics of\n",
60-
"[Vega-Lite](https://vega.github.io/vega-lite/),\n",
61-
"which makes the programming both elegant and powerful.\n",
6259
"\n",
6360
"We will see different visualization concepts that can\n",
6461
"be reproduced more or less easily with other libraries\n",
@@ -468,7 +465,7 @@
468465
"lang": "en"
469466
},
470467
"source": [
471-
"* The title and axis labels can be set:"
468+
"* The titles and the axis labels can be set:"
472469
]
473470
},
474471
{
@@ -483,7 +480,7 @@
483480
"alt.Chart(surveys_complete).mark_point().encode(\n",
484481
" x=alt.X('hindfoot_length').title('Hindfoot length (mm)'),\n",
485482
" y=alt.Y('weight').scale(type='log', base=2).title('Weight (g)'),\n",
486-
" color=alt.Color('species_id'),\n",
483+
" color=alt.Color('species_id').title('Species ID'),\n",
487484
" tooltip=['species_id'],\n",
488485
").configure_mark(\n",
489486
" opacity=0.05,\n",
@@ -916,7 +913,7 @@
916913
"source": [
917914
"`2`. Create the boxplot:\n",
918915
"* The full species names on the X axis, with the label \"Species\"\n",
919-
"* The noisy weights on the Y axis, with a logarithmic\n",
916+
"* The weights on the Y axis, with a logarithmic\n",
920917
" scale in base 2 and with the label \"Weight (g)\"\n",
921918
"* One color for each species identifier\n",
922919
"* A title for the chart\n",

solution-fr/05-altair.ipynb

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,11 @@
5151
"\n",
5252
"Bien que `matplotlib` soit une bibliothèque de visualisation\n",
5353
"largement répandue et relativement flexible, la programmation\n",
54-
"des graphiques ne suit pas une *grammaire* spécifique.\n",
55-
"\n",
56-
"Ainsi, pour ce chapitre, nous avons fait le choix\n",
57-
"de vous présenter la bibliothèque `altair` qui\n",
58-
"[facilite la création de graphiques hautement informatifs](https://altair-viz.github.io/index.html)\n",
59-
"tout en s'intégrant bien avec Pandas. Le fonctionnement de\n",
60-
"`altair` se base sur la grammaire des graphiques interactifs\n",
61-
"de [Vega-Lite](https://vega.github.io/vega-lite/),\n",
62-
"ce qui rend la programmation à la fois élégante et puissante.\n",
54+
"des graphiques n'est pas aussi intuitive qu'avec `altair`.\n",
55+
"De plus, [la bibliothèque](https://altair-viz.github.io/index.html)\n",
56+
"`altair` permet de créer facilement des \n",
57+
"[graphiques interactifs](https://vega.github.io/vega-lite/) et\n",
58+
"hautement informatifs tout en s'intégrant bien avec Pandas.\n",
6359
"\n",
6460
"Nous verrons différents concepts de visualisation qui peuvent être\n",
6561
"reproduits plus ou moins facilement avec d'autres bibliothèques\n",
@@ -466,7 +462,7 @@
466462
"lang": "fr"
467463
},
468464
"source": [
469-
"* Modifier le nom des axes :"
465+
"* Définir les titres et le nom des axes :"
470466
]
471467
},
472468
{
@@ -481,7 +477,7 @@
481477
"alt.Chart(surveys_complet).mark_point().encode(\n",
482478
" x=alt.X('hindfoot_length').title('Longueur arrière-pied (mm)'),\n",
483479
" y=alt.Y('weight').scale(type='log', base=2).title('Poids (g)'),\n",
484-
" color=alt.Color('species_id'),\n",
480+
" color=alt.Color('species_id').title(\"Code d'espèce\"),\n",
485481
" tooltip=['species_id'],\n",
486482
").configure_mark(\n",
487483
" opacity=0.05,\n",
@@ -914,7 +910,7 @@
914910
"source": [
915911
"`2`. Créez le box-plot:\n",
916912
"* Le nom des espèces sur l'axe horizontal, avec l'étiquette \"Espèce\"\n",
917-
"* Le poids bruité dans l'axe vertical, selon une échelle logarithmique\n",
913+
"* Le poids dans l'axe vertical, selon une échelle logarithmique\n",
918914
" en base 2 et avec l'étiquette \"Poids (g)\"\n",
919915
"* Une couleur selon l'identifiant d'espèce\n",
920916
"* Un titre pour le graphique\n",

src/05-altair.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@
934934
"lang": "fr"
935935
},
936936
"source": [
937-
"* Modifier le nom des axes :"
937+
"* Définir les titres et le nom des axes :"
938938
]
939939
},
940940
{
@@ -944,7 +944,7 @@
944944
"lang": "en"
945945
},
946946
"source": [
947-
"* The title and axis labels can be set:"
947+
"* The titles and the axis labels can be set:"
948948
]
949949
},
950950
{
@@ -959,7 +959,7 @@
959959
"alt.Chart(surveys_complet).mark_point().encode(\n",
960960
" x=alt.X('hindfoot_length').title('Longueur arrière-pied (mm)'),\n",
961961
" y=alt.Y('weight').scale(type='log', base=2).title('Poids (g)'),\n",
962-
" color=alt.Color('species_id'),\n",
962+
" color=alt.Color('species_id').title(\"Code d'espèce\"),\n",
963963
" tooltip=['species_id'],\n",
964964
").configure_mark(\n",
965965
" opacity=0.05,\n",
@@ -981,7 +981,7 @@
981981
"alt.Chart(surveys_complete).mark_point().encode(\n",
982982
" x=alt.X('hindfoot_length').title('Hindfoot length (mm)'),\n",
983983
" y=alt.Y('weight').scale(type='log', base=2).title('Weight (g)'),\n",
984-
" color=alt.Color('species_id'),\n",
984+
" color=alt.Color('species_id').title('Species ID'),\n",
985985
" tooltip=['species_id'],\n",
986986
").configure_mark(\n",
987987
" opacity=0.05,\n",

0 commit comments

Comments
 (0)