Skip to content
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

Fix FacetGrid.set_titles #6839 #6843

Merged
merged 4 commits into from
Aug 1, 2022
Merged

Fix FacetGrid.set_titles #6839 #6843

merged 4 commits into from
Aug 1, 2022

Conversation

lopezvoliver
Copy link
Contributor

@lopezvoliver lopezvoliver commented Jul 28, 2022

Added handle.update(kwargs) after handle.set_text(title) so that the title properties sent using keyword arguments are also updated.

@dcherian
Copy link
Contributor

Wonderful. Thanks @lopezvoliver !

Can you add a test in a new function around here (some docs here):

def test_default_labels(self):

I think it would look like

  1. Create a facetgrid (see the existing tests for how to do that)
  2. Make the titles bold.
  3. Check that the title for a axis is acutally bold. You can use the axes handles in FacetGrid.axes to do this.

@lopezvoliver
Copy link
Contributor Author

Hi @dcherian , thanks for the feedback.

Other than the test, I also had to add a new function property_in_axes_text that performs the check only on the specified label.

I hope this is what was expected.

Cheers

@@ -112,6 +112,19 @@ def substring_not_in_axes(substring, ax):
return all(check)


def property_in_axes_text(property, property_str, target_txt, ax):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏🏾

Copy link
Contributor

@dcherian dcherian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @lopezvoliver very nice fix. I see this is your first contribution. welcome to xarray!

(this will get merged in a couple of days after others have a chance to take a look if they want)

@dcherian dcherian added the plan to merge Final call for comments label Jul 29, 2022
@dcherian dcherian merged commit c745c2a into pydata:main Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plan to merge Final call for comments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FacetGrid.set_title formatting keyword arguments fail when plot uses col and row
3 participants