Skip to content

fix BboxConnectorPatch does not show facecolor #10686

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

Merged
merged 2 commits into from
Mar 21, 2018

Conversation

zhoubecky
Copy link
Contributor

PR Summary

fix BboxConnectorPatch does not show facecolor #8059 based on old fixes in #8075
will add command and unit tests later

@jklymak jklymak changed the title fix BboxConnectorPatch does not show facecolor #8059 fix BboxConnectorPatch does not show facecolor Mar 5, 2018
@tacaswell tacaswell added this to the v3.0 milestone Mar 8, 2018
@tacaswell
Copy link
Member

Thanks for working on this @zhoubecky !

Are we sure that this does not re-break any of the examples from #5757 ?

Would you mind squashing this down to 1 commit? (http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html + git push --force). If you are not comfortable doing that we can squash-merge it on our side.

@jklymak
Copy link
Member

jklymak commented Mar 8, 2018

...also, I don't really understand the test plot.

@zhoubecky
Copy link
Contributor Author

@tacaswell I have reverted a merge commit and squashing all my commits to 1 commit.
I think my changes won't break the original functionalities that shown in #5757, the color will be filled only when the "color" or "facecolor" field is set.

@zhoubecky
Copy link
Contributor Author

@jklymak fields/parameters "color", "facecolor" and "fc" in BboxConnectorPatch and mark_inset didn't work before, what I am doing is to create a simple example using both BboxConnectorPatch and mark_inset, and test if those fields are working now. I test each field separately(so you can see three colorful bboxes and marked area), and I also test the "fill=False" scenario to see if color would be disable in this case.

@jklymak
Copy link
Member

jklymak commented Mar 8, 2018

@zhoubecky unfortunately you also merged in a bunch of other changes that have been merged into master since then. Note your file count went way up. The trick is to squash your changes first and then rebase onto master (or re-order the commits when you rebase -i.)

WRT to the test, there is an extra colored box outside the axis. It all just looks strange. But if thats how its supposed to look, I guess its OK for a test.

@zhoubecky
Copy link
Contributor Author

@jklymak are you talking about the two commits about style fixes? Should I revert those two commits now and only leave my commit in this branch?

@jklymak
Copy link
Member

jklymak commented Mar 8, 2018

Yes, you should not have other commits from master in the PR.

@jklymak
Copy link
Member

jklymak commented Mar 15, 2018

@zhoubecky is a new contributor, so lets get this reviewed soonish so they don't have to rebase again!

Copy link
Contributor

@dopplershift dopplershift left a comment

Choose a reason for hiding this comment

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

Looks good. Too late, though, to avoid another rebase.

@zhoubecky
Copy link
Contributor Author

@jklymak, the test_axes_grid1.py was not conflict yesterday, should I resolve the conflict in this branch or you will do the rebase?

@tacaswell
Copy link
Member

@zhoubecky can you do the rebase?

@jklymak
Copy link
Member

jklymak commented Mar 18, 2018

@zhoubecky much easier for you to do it. If you haven't done a rebase before, make sure you make a backup branch so you can revert if you make a mistake. There are instructions in the developers guide.

Copy link
Member

@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

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

Two questions about simplifying the tests.

def test_fill_facecolor():
fig, ax = plt.subplots(1, 5)
fig.set_size_inches(5, 5)
trans1 = blended_transform_factory(ax[0].transData, ax[0].transData)
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand this; blended_transform_factory is for separate x and y transforms, but you are using the same transform for both, so why not use ax[0].transData instead of trans1 (and the same for the rest)?

axins = zoomed_inset_axes(ax[0], 1, loc=1)
axins.set_xlim(0, 0.2)
axins.set_ylim(0, 0.2)
plt.gca().axes.get_xaxis().set_ticks([])
Copy link
Member

Choose a reason for hiding this comment

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

Why do you need to do plt.gca()? Don't you have all the Axes objects already?

@zhoubecky
Copy link
Contributor Author

Thank you @QuLogic , I have updated the test, is there anything I should do to make it better?

@jklymak jklymak merged commit f8f14d7 into matplotlib:master Mar 21, 2018
@jklymak
Copy link
Member

jklymak commented Mar 21, 2018

Thanks a lot @zhoubecky !

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 this pull request may close these issues.

5 participants