René's URL Explorer Experiment


Title: Unnecessarily large date range created when plotting a single point using a Datetime object · Issue #5963 · matplotlib/matplotlib · GitHub

Open Graph Title: Unnecessarily large date range created when plotting a single point using a Datetime object · Issue #5963 · matplotlib/matplotlib

X Title: Unnecessarily large date range created when plotting a single point using a Datetime object · Issue #5963 · matplotlib/matplotlib

Description: As explained in my original StackOverflow question, I've found some unexpected behavior when plotting single points in matplotlib.pyplot with Datetime objects. Plotting multiple points (>1) gives the range of dates with some buffer on ei...

Open Graph Description: As explained in my original StackOverflow question, I've found some unexpected behavior when plotting single points in matplotlib.pyplot with Datetime objects. Plotting multiple points (>1) gives t...

X Description: As explained in my original StackOverflow question, I've found some unexpected behavior when plotting single points in matplotlib.pyplot with Datetime objects. Plotting multiple points (>1) ...

Opengraph URL: https://github.com/matplotlib/matplotlib/issues/5963

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unnecessarily large date range created when plotting a single point using a Datetime object","articleBody":"As explained in my original StackOverflow [question](http://stackoverflow.com/q/35163031/4739755), I've found some unexpected behavior when plotting single points in matplotlib.pyplot with Datetime objects. Plotting multiple points (\u003e1) gives the range of dates with some buffer on either side. Plotting a single point causes the range to span multiple years (2014 - 2018 using Feb 03, 2016).\n\nWhen using the AutoDateLocator(), the (assumed) issue isn't as noticeable since the generated ticks are fairly conservative, but using a WeekdayLocator() instead results in a dense mess of ticks. The application I'm using this for deals with time spans of _at most_ a few months, so suddenly getting a range of multiple _years_ is quite jarring.\n\nBelow is some code that generates 6 matplotlib.pyplot plot images to demonstrate a few example cases and the output from running the script with the --verbose-debug flag\n\n```\nimport matplotlib.pyplot as plt\nimport matplotlib.dates as md\nfrom datetime import datetime\n\n# Create figures\nfig0 = plt.figure(0)\nfig1 = plt.figure(1)\nfig2 = plt.figure(2)\nfig3 = plt.figure(3)\nfig4 = plt.figure(4)\nfig5 = plt.figure(5)\nfig6 = plt.figure(6)\n# Add some subplots\nsub3 = fig3.add_subplot(111)\nsub4 = fig4.add_subplot(111)\nsub5 = fig5.add_subplot(111)\nsub6 = fig6.add_subplot(111)\n\n# Creating a regular plot directly with a single point\nplt.figure(0)\nplt.plot((2,), (3,), marker='o')\nplt.title('Regular plot, single point')\n\n# Doing the same, but with a subplot\nsub3.plot((2,), (3,), marker='o')\nsub3.set_title('Subplot, single point')\n\n# Creating a regular plot using a Datetime object with multiple points\n# Using the AutoDateLocator()\ntest_date_one = datetime.strptime('2016-02-03', '%Y-%m-%d')\ntest_date_two = datetime.strptime('2016-03-03', '%Y-%m-%d')\n\nplt.figure(1)\nplt.plot((test_date_one, test_date_two), (2, 3), marker='o')\nfig1.autofmt_xdate()\nplt.title('Regular plot, multiple Datetime points')\n\n# Now with a single point\nplt.figure(2)\nplt.plot(test_date_one, 2, marker='o')\nfig2.autofmt_xdate()\nplt.title('Regular plot, single Datetime point')\n\n# Doing the same, but with a subplot\n# Multiple points\nsub4.plot((test_date_one, test_date_two), (2, 3), marker='o')\nfig4.autofmt_xdate()\nsub4.set_title('Subplot, multiple Datetime points')\n\n# Single point\nsub5.plot(test_date_one, 2, marker='o')\nfig5.autofmt_xdate()\nsub5.set_title('Subplot, single Datetime point')\n\n# Finally, single Datetime point with WeekdayLocator()\nsub6.plot(test_date_two, 3, marker='o')\nsub6.xaxis.set_major_locator(md.WeekdayLocator())\nfig6.autofmt_xdate()\nsub6.set_title('Subplot, single Datetime point, WeekdayLocator()')\n\nplt.show()\n```\n\n**Debug Output**\n$HOME=C:\\Users******\\\nmatplotlib data path C:\\Python27\\lib\\site-packages\\matplotlib\\mpl-data\n\n---\n\nYou have the following UNSUPPORTED LaTeX preamble customizations:\n\nPlease do not ask for support with these customizations active.\n\n---\n\nloaded rc file C:\\Python27\\lib\\site-packages\\matplotlib\\mpl-data\\matplotlibrc\nmatplotlib version 1.5.1\nverbose.level debug\ninteractive is False\nplatform is win32\nloaded modules: \u003cdictionary-keyiterator object at 0x04E08810\u003e\nCACHEDIR=C:\\Users\\******\\.matplotlib\nUsing fontManager instance from C:\\Users\\******\\.matplotlib\\fontList.cache\nbackend TkAgg version 8.5\nCould not load matplotlib icon: can't use \"pyimage10\" as iconphoto: not a photo image\nCould not load matplotlib icon: can't use \"pyimage19\" as iconphoto: not a photo image\nCould not load matplotlib icon: can't use \"pyimage28\" as iconphoto: not a photo image\nCould not load matplotlib icon: can't use \"pyimage37\" as iconphoto: not a photo image\nCould not load matplotlib icon: can't use \"pyimage46\" as iconphoto: not a photo image\nCould not load matplotlib icon: can't use \"pyimage55\" as iconphoto: not a photo image\nfindfont: Matching :family=sans-serif:style=normal:variant=normal:weight=400:stretch=normal:size=medium to Bitstream Vera Sans (u'c:\\python27\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf') with score of 0.000000\nfindfont: Matching :family=sans-serif:style=normal:variant=normal:weight=400:stretch=normal:size=large to Bitstream Vera Sans (u'c:\\python27\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf') with score of 0.000000\n","author":{"url":"https://github.com/bcoov","@type":"Person","name":"bcoov"},"datePublished":"2016-02-03T17:12:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":15},"url":"https://github.com/5963/matplotlib/issues/5963"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:418ac876-1318-c936-7cc2-b5274f291618
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id81A6:108FC:F0DCB7:14382DF:6A532F02
html-safe-nonce5af2ad288d4f2478a5bb91ab470a5898f005bc0f6e99ab17763420fbd817ad13
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MUE2OjEwOEZDOkYwRENCNzoxNDM4MkRGOjZBNTMyRjAyIiwidmlzaXRvcl9pZCI6Ijg1MzYwOTgxNDUwOTYxMTgwMTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacfba0b37fb1b7b305a1f63254996a3b9bc034e490b20864fc696a95a6b860b288
hovercard-subject-tagissue:131091461
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/5963/issue_layout
twitter:imagehttps://opengraph.githubassets.com/e2e356588d20dbcfed4f0f01209fa0da3dcd012ef8423f2fc7841d9067fd7a14/matplotlib/matplotlib/issues/5963
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/e2e356588d20dbcfed4f0f01209fa0da3dcd012ef8423f2fc7841d9067fd7a14/matplotlib/matplotlib/issues/5963
og:image:altAs explained in my original StackOverflow question, I've found some unexpected behavior when plotting single points in matplotlib.pyplot with Datetime objects. Plotting multiple points (>1) gives t...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamebcoov
hostnamegithub.com
expected-hostnamegithub.com
Noneb9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb
turbo-cache-controlno-preview
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
disable-turbofalse
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/issues/5963#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F5963
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%2Fissues%2F5963
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%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=matplotlib%2Fmatplotlib
Reloadhttps://github.com/matplotlib/matplotlib/issues/5963
Reloadhttps://github.com/matplotlib/matplotlib/issues/5963
Reloadhttps://github.com/matplotlib/matplotlib/issues/5963
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/5963
matplotlib https://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/5963
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
Unnecessarily large date range created when plotting a single point using a Datetime objecthttps://github.com/matplotlib/matplotlib/issues/5963#top
status: confirmed bughttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22status%3A%20confirmed%20bug%22
status: inactiveMarked by the “Stale” Github Actionhttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22status%3A%20inactive%22
topic: date handlinghttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22topic%3A%20date%20handling%22
future releaseshttps://github.com/matplotlib/matplotlib/milestone/25
https://github.com/bcoov
bcoovhttps://github.com/bcoov
on Feb 3, 2016https://github.com/matplotlib/matplotlib/issues/5963#issue-131091461
questionhttp://stackoverflow.com/q/35163031/4739755
status: confirmed bughttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22status%3A%20confirmed%20bug%22
status: inactiveMarked by the “Stale” Github Actionhttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22status%3A%20inactive%22
topic: date handlinghttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22topic%3A%20date%20handling%22
future releasesNo due datehttps://github.com/matplotlib/matplotlib/milestone/25
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.