René's URL Explorer Experiment


Title: Add "properties" to all matplotlib artists by lukelbd · Pull Request #168 · proplot-dev/proplot · GitHub

Open Graph Title: Add "properties" to all matplotlib artists by lukelbd · Pull Request #168 · proplot-dev/proplot

X Title: Add "properties" to all matplotlib artists by lukelbd · Pull Request #168 · proplot-dev/proplot

Description: This PR is related to #89 and adds @property setters and getters to every single Artist subclass. The core logic for this turns out to be surprisingly simple: https://github.com/lukelbd/proplot/blob/5d29f3148975e898452c4101dab6338e2908c50f/proplot/artist.py#L14-L50 After this PR is merged proplot users will be able to use the much cleaner, more object-oriented "dot" syntax for changing matplotlib artist attributes: # Original API fig, ax = pyplot.subplots() ax.set_title('Title') ax.set_xlabel('xlabel') ax.set_xticks([1, 2, 3]) h, = ax.plot(...) h.set_color('red') h.set_linewidth(1) # ProPlot API if this is merged fig, ax = proplot.subplots() ax.format(title='Title', xlabel='xlabel', xticks=[1, 2, 3]) # with bulk setter ax.title = 'Title' # with individual setters ax.xlabel = 'xlabel' ax.xticks = [1, 2, 3] h, = ax.plot(...) h.color = 'red' h.linewidth = 1 I am not sure about the side-effects of this -- the problem is this breaks classes that use instance-level attributes with the same names as the setters and getters (e.g. if an artist subclass both the getter get_linewidth() and the literal attribute linewidth), and the only way to address this is to go through the source code class-by-class and make explicit exceptions (which is quite fragile, since the attributes may change from version-to-version). Monkey patching is not possible because you cannot add properties as instance-level attributes. This is a really neat PR, but it will require a lot of testing and it's not as high priority as some other PRs. So it may be quite a while before this is merged.

Open Graph Description: This PR is related to #89 and adds @property setters and getters to every single Artist subclass. The core logic for this turns out to be surprisingly simple: https://github.com/lukelbd/proplot/bl...

X Description: This PR is related to #89 and adds @property setters and getters to every single Artist subclass. The core logic for this turns out to be surprisingly simple: https://github.com/lukelbd/proplot/bl...

Opengraph URL: https://github.com/proplot-dev/proplot/pull/168

X: @github

direct link

Domain: patch-diff.githubusercontent.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:688ac134-9de8-f86d-f4be-733e06c84484
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD3F2:239CAA:E9FFF:13A349:697AED1A
html-safe-noncea2912a802e27c86b6137e948b72674ba5681ea9e5f0a5de281509a8b1df9dacb
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEM0YyOjIzOUNBQTpFOUZGRjoxM0EzNDk6Njk3QUVEMUEiLCJ2aXNpdG9yX2lkIjoiMjc0NzgwNjEzNjU2MzA2ODE4NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc1226d87fdf81d7a3449dced690b879ec2d4db6d00d900c8c02a6b0cd68f4ba8
hovercard-subject-tagpull_request:418914017
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/proplot-dev/proplot/pull/168/files
twitter:imagehttps://avatars.githubusercontent.com/u/19657652?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/19657652?s=400&v=4
og:image:altThis PR is related to #89 and adds @property setters and getters to every single Artist subclass. The core logic for this turns out to be surprisingly simple: https://github.com/lukelbd/proplot/bl...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None7ce8ed0a54c4730aeca4e6abacfc6490365fc42e25480b86883054df3f9181c8
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/proplot-dev/proplot git https://github.com/proplot-dev/proplot.git
octolytics-dimension-user_id108025793
octolytics-dimension-user_loginproplot-dev
octolytics-dimension-repository_id113293661
octolytics-dimension-repository_nwoproplot-dev/proplot
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id113293661
octolytics-dimension-repository_network_root_nwoproplot-dev/proplot
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
released7bfc78137af9a4828305e52ab993fce981d7085
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/files#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fproplot-dev%2Fproplot%2Fpull%2F168%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
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
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
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/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://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fproplot-dev%2Fproplot%2Fpull%2F168%2Ffiles
Sign up https://patch-diff.githubusercontent.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=proplot-dev%2Fproplot
Reloadhttps://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/files
Reloadhttps://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/files
Reloadhttps://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/files
proplot-dev https://patch-diff.githubusercontent.com/proplot-dev
proplothttps://patch-diff.githubusercontent.com/proplot-dev/proplot
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fproplot-dev%2Fproplot
Fork 97 https://patch-diff.githubusercontent.com/login?return_to=%2Fproplot-dev%2Fproplot
Star 1.1k https://patch-diff.githubusercontent.com/login?return_to=%2Fproplot-dev%2Fproplot
Code https://patch-diff.githubusercontent.com/proplot-dev/proplot
Issues 88 https://patch-diff.githubusercontent.com/proplot-dev/proplot/issues
Pull requests 7 https://patch-diff.githubusercontent.com/proplot-dev/proplot/pulls
Discussions https://patch-diff.githubusercontent.com/proplot-dev/proplot/discussions
Actions https://patch-diff.githubusercontent.com/proplot-dev/proplot/actions
Projects 0 https://patch-diff.githubusercontent.com/proplot-dev/proplot/projects
Security 0 https://patch-diff.githubusercontent.com/proplot-dev/proplot/security
Insights https://patch-diff.githubusercontent.com/proplot-dev/proplot/pulse
Code https://patch-diff.githubusercontent.com/proplot-dev/proplot
Issues https://patch-diff.githubusercontent.com/proplot-dev/proplot/issues
Pull requests https://patch-diff.githubusercontent.com/proplot-dev/proplot/pulls
Discussions https://patch-diff.githubusercontent.com/proplot-dev/proplot/discussions
Actions https://patch-diff.githubusercontent.com/proplot-dev/proplot/actions
Projects https://patch-diff.githubusercontent.com/proplot-dev/proplot/projects
Security https://patch-diff.githubusercontent.com/proplot-dev/proplot/security
Insights https://patch-diff.githubusercontent.com/proplot-dev/proplot/pulse
Sign up for GitHub https://patch-diff.githubusercontent.com/signup?return_to=%2Fproplot-dev%2Fproplot%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://patch-diff.githubusercontent.com/login?return_to=%2Fproplot-dev%2Fproplot%2Fissues%2Fnew%2Fchoose
lukelbdhttps://patch-diff.githubusercontent.com/lukelbd
masterhttps://patch-diff.githubusercontent.com/proplot-dev/proplot/tree/master
artist-classhttps://patch-diff.githubusercontent.com/proplot-dev/proplot/tree/artist-class
Conversation 0 https://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168
Commits 1 https://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/commits
Checks 0 https://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/checks
Files changed https://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/files
Please reload this pagehttps://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/files
Add "properties" to all matplotlib artists https://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/files#top
Show all changes 1 commit https://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/files
5afabc2 Initial commit lukelbd Dec 11, 2021 https://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/commits/5afabc2be01fb22e2b1d77e09c70c0d92ddc5248
Clear filters https://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/files
Please reload this pagehttps://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/files
Please reload this pagehttps://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/files
api.rst https://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/files#diff-0ee295c29def16f570f86378eff8ba37315e464d415e731d5d8ea2e67ce16f68
__init__.py https://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/files#diff-a10c501aaa6931ac17bfd6c3136341969567e9e02cfe071c33b862ef1449c0ed
artist.py https://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/files#diff-06e9f1bc0f2dae79b9f782d0d3e6e36f71df3fe30281518ec4a47eae16814f16
docs/api.rsthttps://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/files#diff-0ee295c29def16f570f86378eff8ba37315e464d415e731d5d8ea2e67ce16f68
View file https://patch-diff.githubusercontent.com/proplot-dev/proplot/blob/5afabc2be01fb22e2b1d77e09c70c0d92ddc5248/docs/api.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/{{ revealButtonHref }}
https://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/files#diff-0ee295c29def16f570f86378eff8ba37315e464d415e731d5d8ea2e67ce16f68
https://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/files#diff-0ee295c29def16f570f86378eff8ba37315e464d415e731d5d8ea2e67ce16f68
https://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/files#diff-0ee295c29def16f570f86378eff8ba37315e464d415e731d5d8ea2e67ce16f68
https://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/files#diff-0ee295c29def16f570f86378eff8ba37315e464d415e731d5d8ea2e67ce16f68
https://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/files#diff-0ee295c29def16f570f86378eff8ba37315e464d415e731d5d8ea2e67ce16f68
proplot/__init__.pyhttps://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/files#diff-a10c501aaa6931ac17bfd6c3136341969567e9e02cfe071c33b862ef1449c0ed
View file https://patch-diff.githubusercontent.com/proplot-dev/proplot/blob/5afabc2be01fb22e2b1d77e09c70c0d92ddc5248/proplot/__init__.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/{{ revealButtonHref }}
https://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/files#diff-a10c501aaa6931ac17bfd6c3136341969567e9e02cfe071c33b862ef1449c0ed
https://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/files#diff-a10c501aaa6931ac17bfd6c3136341969567e9e02cfe071c33b862ef1449c0ed
proplot/artist.pyhttps://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/files#diff-06e9f1bc0f2dae79b9f782d0d3e6e36f71df3fe30281518ec4a47eae16814f16
View file https://patch-diff.githubusercontent.com/proplot-dev/proplot/blob/5afabc2be01fb22e2b1d77e09c70c0d92ddc5248/proplot/artist.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/proplot-dev/proplot/pull/168/{{ revealButtonHref }}
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.