question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem using FacetGrid title templates

See original GitHub issue

I tried to format the row and column title labels only with their names like so:

g.set_titles( row_template="{row_name}", col_template="{col_name}",size = 15 )

It works for the columns but not for the column labels (on the right), both my template and the original row_var=row_name is shown overlayed.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
yoavramcommented, Oct 18, 2016

Revised hack from #706:

tips = sns.load_dataset("tips")
g = sns.FacetGrid(tips, col="sex", row="smoker", margin_titles=True)
g.map(sns.plt.scatter, "total_bill", "tip")
for ax in g.axes.flat:
    plt.setp(ax.texts, text="")
g.set_titles(row_template="{row_name}", col_template="{col_name}")
2reactions
mwaskomcommented, Feb 6, 2015

Oops yep, sorry about that.

For reference, I just double checked that this works:

tips = sns.load_dataset("tips")
g = sns.FacetGrid(tips, col="sex", row="smoker", margin_titles=True)
g.map(sns.plt.scatter, "total_bill", "tip")
plt.setp(g.fig.texts, text="")
g.set_titles(row_template="{row_name}", col_template="{col_name}")
Read more comments on GitHub >

github_iconTop Results From Across the Web

Seaborn anonying facet title · Douglas C. Wu
This jupyter notbook intends to record how the facet title from seaborn FacetGrid can be aligned as ggplot2 in R (Because I always...
Read more >
Customizing annotation with Seaborn's FacetGrid
It provides a way to change how the title is rendered using the column variable name and value: template : string Template for...
Read more >
Use Seaborn FacetGrid to Quickly Create Figures With Subplots
To split the plot up into multiple subplots (facets) we add a col argument to the FacetGrid() and pass in the name of...
Read more >
Seaborn FacetGrid | How to make Small Multiples with Python ...
This Seaborn FacetGrid tutorial shows you how to make and style a FacetGrid using Python Seaborn. I first introduce you to the concept...
Read more >
Python Seaborn - 22|What is a FacetGrid Plot and ... - YouTube
Python Seaborn - 22|What is a FacetGrid Plot and How to Create this Using Seaborn in Python|Customize Axis Lables and Titles |Creating ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found