René's URL Explorer Experiment


Title: ENH add an inset_axes to the axes class by jklymak · Pull Request #11026 · matplotlib/matplotlib · GitHub

Open Graph Title: ENH add an inset_axes to the axes class by jklymak · Pull Request #11026 · matplotlib/matplotlib

X Title: ENH add an inset_axes to the axes class by jklymak · Pull Request #11026 · matplotlib/matplotlib

Description: PR Summary and we are back to inset_axes.... @efiring suggested just going back to inset_axes. Since that was what we started with, I didn't object. The original argument for the longer name was if the API was to include a loc='SW' API, instead of the bounds API I've used here. Thats still possible by type-checking the bounds argument. EDIT: Name bikeshedding: Proposal after comments below: Axes.inset_axes_from_bounds Axes.indicate_inset_bounds Axes.indicate_inset_zoom rect was too ambiguous, lbwh too obscure, bounds is already used for bboxes (as is extents for lbrt)... Comments on names still welcome... Old PR descr Adds ax.inset_axes_from_rect. Pretty straight forward, but note that the transData one moves under zoom and pan. Note that I chose not to go with the bbox_to_anchor, and loc approach. I understand that stuff, but it seems needlessly complicated. Maybe as a refinement. import matplotlib.pyplot as plt fig, ax = plt.subplots() ax.plot(range(10)) axin1 = ax.inset_axes_from_rect([0.8, 0.1, 0.15, 0.15]) axin2 = ax.inset_axes_from_rect([5, 7, 2.3, 2.3], transform=ax.transData) plt.show() Getting closer: This is a duplication of https://matplotlib.org/gallery/axes_grid1/inset_locator_demo2.html#sphx-glr-gallery-axes-grid1-inset-locator-demo2-py import matplotlib.pyplot as plt import numpy as np def get_demo_image(): from matplotlib.cbook import get_sample_data import numpy as np f = get_sample_data("axes_grid/bivariate_normal.npy", asfileobj=False) z = np.load(f) # z is a numpy array of 15x15 return z, (-3, 4, -4, 3) fig, ax = plt.subplots(figsize=[5, 4], constrained_layout=True) Z, extent = get_demo_image() Z2 = np.zeros([150, 150], dtype="d") ny, nx = Z.shape Z2[30:30 + ny, 30:30 + nx] = Z # extent = [-3, 4, -4, 3] ax.imshow(Z2, extent=extent, interpolation="nearest", origin="lower") axins = ax.inset_axes_from_rect([0.5, 0.5, 0.47, 0.47]) axins.imshow(Z2, extent=extent, interpolation="nearest", origin="lower") # sub region of the original image x1, x2, y1, y2 = -1.5, -0.9, -2.5, -1.9 axins.set_xlim(x1, x2) axins.set_ylim(y1, y2) axins.set_xticklabels('') axins.set_yticklabels('') ax.zoom_inset_indicator(axins) fig.canvas.draw() plt.show() EDIT: methods renamed inset_axes_rect to allow other APIs in the future. PR Checklist Has Pytest style unit tests Code is PEP 8 compliant New features are documented, with examples if plot related Documentation is sphinx and numpydoc compliant Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there) Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

Open Graph Description: PR Summary and we are back to inset_axes.... @efiring suggested just going back to inset_axes. Since that was what we started with, I didn't object. The original argument for the longer name w...

X Description: PR Summary and we are back to inset_axes.... @efiring suggested just going back to inset_axes. Since that was what we started with, I didn't object. The original argument for the longer na...

Opengraph URL: https://github.com/matplotlib/matplotlib/pull/11026

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:c4789238-4d84-a9be-c37e-e9e71ba8c2da
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB3EE:367C3D:467DDF:5F1FD2:6A52F2F0
html-safe-nonce448e432f0a7071788e44c9ccb6908fe51e3c71ed8340db8a49c36d9d47c07703
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCM0VFOjM2N0MzRDo0NjdEREY6NUYxRkQyOjZBNTJGMkYwIiwidmlzaXRvcl9pZCI6Ijg4Njg4NDYzNDI2MDIxNTg4MzIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacb8fee307eb1e52f3f329dd0bbea855bc75c0029a3122a170e450cd6c4009194d
hovercard-subject-tagpull_request:180791803
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/matplotlib/matplotlib/pull/11026/files
twitter:imagehttps://avatars.githubusercontent.com/u/1562854?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1562854?s=400&v=4
og:image:altPR Summary and we are back to inset_axes.... @efiring suggested just going back to inset_axes. Since that was what we started with, I didn't object. The original argument for the longer name w...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneb9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git
octolytics-dimension-user_id215947
octolytics-dimension-user_loginmatplotlib
octolytics-dimension-repository_id1385122
octolytics-dimension-repository_nwomatplotlib/matplotlib
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1385122
octolytics-dimension-repository_network_root_nwomatplotlib/matplotlib
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release07a982c1d40157c619b364352b704c3ce66bb332
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/matplotlib/matplotlib/pull/11026/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fpull%2F11026%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fpull%2F11026%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=matplotlib%2Fmatplotlib
Reloadhttps://github.com/matplotlib/matplotlib/pull/11026/files
Reloadhttps://github.com/matplotlib/matplotlib/pull/11026/files
Reloadhttps://github.com/matplotlib/matplotlib/pull/11026/files
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/11026/files
matplotlib https://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/11026/files
Notifications https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Fork 8.4k https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Star 23k https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Code https://github.com/matplotlib/matplotlib
Issues 1.1k https://github.com/matplotlib/matplotlib/issues
Pull requests 408 https://github.com/matplotlib/matplotlib/pulls
Actions https://github.com/matplotlib/matplotlib/actions
Projects https://github.com/matplotlib/matplotlib/projects
Wiki https://github.com/matplotlib/matplotlib/wiki
Security and quality 0 https://github.com/matplotlib/matplotlib/security
Insights https://github.com/matplotlib/matplotlib/pulse
Code https://github.com/matplotlib/matplotlib
Issues https://github.com/matplotlib/matplotlib/issues
Pull requests https://github.com/matplotlib/matplotlib/pulls
Actions https://github.com/matplotlib/matplotlib/actions
Projects https://github.com/matplotlib/matplotlib/projects
Wiki https://github.com/matplotlib/matplotlib/wiki
Security and quality https://github.com/matplotlib/matplotlib/security
Insights https://github.com/matplotlib/matplotlib/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fmatplotlib%2Fmatplotlib%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib%2Fissues%2Fnew%2Fchoose
efiringhttps://github.com/efiring
matplotlib:masterhttps://github.com/matplotlib/matplotlib/tree/master
jklymak:enh-axes-add-axeshttps://github.com/jklymak/matplotlib/tree/enh-axes-add-axes
Conversation 100 https://github.com/matplotlib/matplotlib/pull/11026
Commits 1 https://github.com/matplotlib/matplotlib/pull/11026/commits
Checks 0 https://github.com/matplotlib/matplotlib/pull/11026/checks
Files changed https://github.com/matplotlib/matplotlib/pull/11026/files
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/11026/files
ENH add an inset_axes to the axes class https://github.com/matplotlib/matplotlib/pull/11026/files#top
Show all changes 1 commit https://github.com/matplotlib/matplotlib/pull/11026/files
a5b27e9 ENH: add an inset_axes to the axes class jklymak Jul 20, 2018 https://github.com/matplotlib/matplotlib/pull/11026/commits/a5b27e99f9d5aae47e9b62da4061e33cc93080d9
Clear filters https://github.com/matplotlib/matplotlib/pull/11026/files
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/11026/files
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/11026/files
.flake8 https://github.com/matplotlib/matplotlib/pull/11026/files#diff-6951dbb399883798a226c1fb496fdb4183b1ab48865e75eddecf6ceb6cf46442
axes_api.rst https://github.com/matplotlib/matplotlib/pull/11026/files#diff-a287c3691b3efc4a40b816ce73137371ef6a7d490a648ae792b33197849d5ed9
inset_locator_demo.py https://github.com/matplotlib/matplotlib/pull/11026/files#diff-a366140c4532215d278ec178e1012af449ee84d4fce08a5bb970b4b198be65df
zoom_inset_axes.py https://github.com/matplotlib/matplotlib/pull/11026/files#diff-cb42ed5a2bb779c72250e47a4b28758269b862bc20d423972fb4899aea78d5c8
_axes.py https://github.com/matplotlib/matplotlib/pull/11026/files#diff-608e2a1bf3d32fd631b0763599a3334d59822c11cb4fec1fa7398c9714592900
_base.py https://github.com/matplotlib/matplotlib/pull/11026/files#diff-eab8def55235f317e1ea06840d82467044586af2a7f9ec994356a14f70509b72
test_axes.py https://github.com/matplotlib/matplotlib/pull/11026/files#diff-ef5144bd27a700deb760ef56ccf51dc6fcfe86723f9ffa84df7f024985bf3ee7
.flake8https://github.com/matplotlib/matplotlib/pull/11026/files#diff-6951dbb399883798a226c1fb496fdb4183b1ab48865e75eddecf6ceb6cf46442
View file https://github.com/jklymak/matplotlib/blob/a5b27e99f9d5aae47e9b62da4061e33cc93080d9/.flake8
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/matplotlib/matplotlib/pull/11026/{{ revealButtonHref }}
https://github.com/matplotlib/matplotlib/pull/11026/files#diff-6951dbb399883798a226c1fb496fdb4183b1ab48865e75eddecf6ceb6cf46442
https://github.com/matplotlib/matplotlib/pull/11026/files#diff-6951dbb399883798a226c1fb496fdb4183b1ab48865e75eddecf6ceb6cf46442
doc/api/axes_api.rsthttps://github.com/matplotlib/matplotlib/pull/11026/files#diff-a287c3691b3efc4a40b816ce73137371ef6a7d490a648ae792b33197849d5ed9
View file https://github.com/jklymak/matplotlib/blob/a5b27e99f9d5aae47e9b62da4061e33cc93080d9/doc/api/axes_api.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/matplotlib/matplotlib/pull/11026/{{ revealButtonHref }}
https://github.com/matplotlib/matplotlib/pull/11026/files#diff-a287c3691b3efc4a40b816ce73137371ef6a7d490a648ae792b33197849d5ed9
https://github.com/matplotlib/matplotlib/pull/11026/files#diff-a287c3691b3efc4a40b816ce73137371ef6a7d490a648ae792b33197849d5ed9
examples/axes_grid1/inset_locator_demo.pyhttps://github.com/matplotlib/matplotlib/pull/11026/files#diff-a366140c4532215d278ec178e1012af449ee84d4fce08a5bb970b4b198be65df
View file https://github.com/jklymak/matplotlib/blob/a5b27e99f9d5aae47e9b62da4061e33cc93080d9/examples/axes_grid1/inset_locator_demo.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/matplotlib/matplotlib/pull/11026/{{ revealButtonHref }}
https://github.com/matplotlib/matplotlib/pull/11026/files#diff-a366140c4532215d278ec178e1012af449ee84d4fce08a5bb970b4b198be65df
https://github.com/matplotlib/matplotlib/pull/11026/files#diff-a366140c4532215d278ec178e1012af449ee84d4fce08a5bb970b4b198be65df
examples/subplots_axes_and_figures/zoom_inset_axes.pyhttps://github.com/matplotlib/matplotlib/pull/11026/files#diff-cb42ed5a2bb779c72250e47a4b28758269b862bc20d423972fb4899aea78d5c8
View file https://github.com/jklymak/matplotlib/blob/a5b27e99f9d5aae47e9b62da4061e33cc93080d9/examples/subplots_axes_and_figures/zoom_inset_axes.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/matplotlib/matplotlib/pull/11026/{{ revealButtonHref }}
timhoffmhttps://github.com/timhoffm
Jun 13, 2018https://github.com/matplotlib/matplotlib/pull/11026/files#r195256507
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/11026/files
jklymakhttps://github.com/jklymak
Jun 14, 2018https://github.com/matplotlib/matplotlib/pull/11026/files#r195485519
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
@anntzerhttps://github.com/anntzer
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/11026/files
anntzerhttps://github.com/anntzer
Jun 15, 2018https://github.com/matplotlib/matplotlib/pull/11026/files#r195857344
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/11026/files
lib/matplotlib/axes/_axes.pyhttps://github.com/matplotlib/matplotlib/pull/11026/files#diff-608e2a1bf3d32fd631b0763599a3334d59822c11cb4fec1fa7398c9714592900
View file https://github.com/jklymak/matplotlib/blob/a5b27e99f9d5aae47e9b62da4061e33cc93080d9/lib/matplotlib/axes/_axes.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/matplotlib/matplotlib/pull/11026/{{ revealButtonHref }}
https://github.com/matplotlib/matplotlib/pull/11026/files#diff-608e2a1bf3d32fd631b0763599a3334d59822c11cb4fec1fa7398c9714592900
https://github.com/matplotlib/matplotlib/pull/11026/files#diff-608e2a1bf3d32fd631b0763599a3334d59822c11cb4fec1fa7398c9714592900
https://github.com/matplotlib/matplotlib/pull/11026/files#diff-608e2a1bf3d32fd631b0763599a3334d59822c11cb4fec1fa7398c9714592900
anntzerhttps://github.com/anntzer
Apr 19, 2018https://github.com/matplotlib/matplotlib/pull/11026/files#r182890416
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/11026/files
jklymakhttps://github.com/jklymak
May 9, 2018https://github.com/matplotlib/matplotlib/pull/11026/files#r187169927
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/11026/files
https://github.com/matplotlib/matplotlib/pull/11026/files#diff-608e2a1bf3d32fd631b0763599a3334d59822c11cb4fec1fa7398c9714592900
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/11026/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.