Let's Cope with Axes
Setting label names:
To set label names, we need to set a plot variable and use:
python
X(y)ticks rotation:
To rotate labels, we need to use:
python
Taak
Swipe to start coding
- Import
seaborn
withsns
alias. - Import
matplotlib.pyplot
withplt
alias. - Import
pandas
withpd
alias. - Set label names
'Population'
(Oy axis) &'Years(2012-2022)'
(Ox axis). - Rotate labels along the Ox axis by 45 degrees.
- Show the plot.
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 3. Hoofdstuk 3