Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

indicate_inset transform support#29174

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
QuLogic merged 1 commit intomatplotlib:mainfromrcomer:inset-conn-transform
Dec 20, 2024

Conversation

rcomer
Copy link
Member

@rcomerrcomer commentedNov 22, 2024
edited
Loading

PR summary

  1. Corrected theindicate_inset docstring, as we are definitelydefaulting to transData.
  2. Currently the ends of the connectors that meet the box do not use the passed transform. So againstmain, my new image test gives
    main
  3. Set theaxes property on the rectangle so thatCartopy transforms will work, and we can do things like
importmatplotlib.pyplotaspltimportcartopy.crsasccrsimportcartopy.featureascfeaturemain_map_proj=ccrs.TransverseMercator()pcarree=ccrs.PlateCarree()fig,ax=plt.subplots(subplot_kw={"projection":main_map_proj})ax.set_extent([-50,15,50,70],crs=pcarree)ax.add_feature(cfeature.OCEAN.with_scale('50m'),facecolor="lightsteelblue",zorder=1,edgecolor="k",lw=0.2)inset_ax=ax.inset_axes((0.05,0.05,0.3,0.3),projection=pcarree)inset_extent= [-44,-38,63,66]inset_ax.set_extent(inset_extent,crs=pcarree)inset_ax.add_feature(cfeature.OCEAN,facecolor="lightsteelblue",zorder=1)ax.indicate_inset_zoom(inset_ax,edgecolor="black",transform=pcarree)x= [inset_extent[0],inset_extent[1],inset_extent[1],inset_extent[0]]y= [inset_extent[2],inset_extent[2],inset_extent[3],inset_extent[3]]forainax,inset_ax:a.scatter(x,y,c=range(4),s=150,transform=pcarree)plt.show()

image

PR checklist

@rcomerrcomer marked this pull request as draftNovember 22, 2024 20:12
@rcomerrcomerforce-pushed theinset-conn-transform branch 2 times, most recently fromc8e7643 toba851c1CompareNovember 22, 2024 20:43


@image_comparison(['zoom_inset_transform.png'], remove_text=True, style='mpl20',
tol=0.01)
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

MacOS tests need the 0.01 tolerance.

@rcomerrcomer marked this pull request as ready for reviewNovember 22, 2024 21:14
@rcomerrcomerforce-pushed theinset-conn-transform branch 2 times, most recently from470b488 to0d57221CompareNovember 22, 2024 21:52
# Set axes on the rectangle (required for some external transforms to work) as
# well as the InsetIndicator artist.
self.rectangle.axes = new_axes
artist.Artist.axes.fset(self, new_axes)
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I copied the setter logic here from theartist within artist example. I would not have figured it out by myself - thanks@QuLogic for putting it in the example!

@QuLogicQuLogic merged commita3682f3 intomatplotlib:mainDec 20, 2024
42 of 43 checks passed
@QuLogicQuLogic added this to thev3.11.0 milestoneDec 20, 2024
@rcomerrcomer deleted the inset-conn-transform branchDecember 20, 2024 08:08
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic approved these changes

@greglucasgreglucasgreglucas approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.11.0
Development

Successfully merging this pull request may close these issues.

3 participants
@rcomer@QuLogic@greglucas

[8]ページ先頭

©2009-2025 Movatter.jp