Skip to content

Explain how to craft good plot titles and why they are important (R & Py) #179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
joelostblom opened this issue Jul 14, 2023 · 1 comment · Fixed by #285
Closed

Explain how to craft good plot titles and why they are important (R & Py) #179

joelostblom opened this issue Jul 14, 2023 · 1 comment · Fixed by #285

Comments

@joelostblom
Copy link
Contributor

joelostblom commented Jul 14, 2023

From #160 (comment). I think titles is an important part of storytelling and should be explained to students. Some more details here https://clauswilke.com/dataviz/figure-titles-captions.html

To add some finishing touches to the chart
we will add a title to the chart by specifying `title` argument inside `alt.Chart`.
A good plot title should usually contain the take home message that you want readers of the chart to focus on,
e.g. "The Earth's seven largest landmasses are all continents",
but it could sometimes be more general, e.g. "The twelve largest landmasses on Earth".
Note that plot titles are not always required; e.g. if plots appear as part
of other media (e.g., in a slide presentation, on a poster, in a paper) where
the title may be redundant with the surrounding context.
For categorical encodings,
such as the color and y channels in our chart,
it is often not necessary to include the axis title
as the labels of the categories are enough by themselves.
Particularly in this case where the title clearly states
that we are landmasses,
the titles are redundant and we can remove them.

```{code-cell} ipython3
islands_plot_titled = alt.Chart(
    islands_top12,
    title="The Earth's seven largest landmasses are all continents"
).mark_bar().encode(
    x=alt.X("size",title="Size (1000 square mi)"),
    y=alt.Y("landmass", title="", sort="x"),
    color=alt.Color("landmass_type", title="")
)
```

```{code-cell} ipython3
:tags: ["remove-cell"]
glue('islands_plot_titled', islands_plot_titled, display=True)
```

:::{glue:figure} islands_plot_titled
:figwidth: 700px
:name: islands_plot_titled

Bar plot of size for Earth's largest 12 landmasses with a title.
:::
@joelostblom
Copy link
Contributor Author

joelostblom commented Aug 6, 2023

Another good reason to include a section on effective titles is that tutorial 4 asks students to set the title on many of the visualizations, not sure if that should be removed now that we removed this from the textbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant