René's URL Explorer Experiment


Title: UnboundLocalError: local variable 'aspect_scale_mode' referenced before assignment · Issue #4900 · matplotlib/matplotlib · GitHub

Open Graph Title: UnboundLocalError: local variable 'aspect_scale_mode' referenced before assignment · Issue #4900 · matplotlib/matplotlib

X Title: UnboundLocalError: local variable 'aspect_scale_mode' referenced before assignment · Issue #4900 · matplotlib/matplotlib

Description: plt.clf() fig, ax = plt.subplots(1,2, sharey=True) plt.setp(ax.flat, aspect=1.0, adjustable='box-forced') #fig.set_size_inches(16,8) sns.despine(fig=fig) #scale = 'logit' scale = None plot.plot_year_dist(df_mesh[(df_mesh['Year'] >= min_y...

Open Graph Description: plt.clf() fig, ax = plt.subplots(1,2, sharey=True) plt.setp(ax.flat, aspect=1.0, adjustable='box-forced') #fig.set_size_inches(16,8) sns.despine(fig=fig) #scale = 'logit' scale = None plot.plot_yea...

X Description: plt.clf() fig, ax = plt.subplots(1,2, sharey=True) plt.setp(ax.flat, aspect=1.0, adjustable='box-forced') #fig.set_size_inches(16,8) sns.despine(fig=fig) #scale = 'logit' scale = No...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"UnboundLocalError: local variable 'aspect_scale_mode' referenced before assignment","articleBody":"``` python\nplt.clf()\nfig, ax = plt.subplots(1,2, sharey=True)\nplt.setp(ax.flat, aspect=1.0, adjustable='box-forced')\n#fig.set_size_inches(16,8)\nsns.despine(fig=fig)\n#scale = 'logit'\nscale = None\nplot.plot_year_dist(df_mesh[(df_mesh['Year'] \u003e= min_y) \u0026 (df_mesh['Year'] \u003c= 2009)],col='min_VolFirstP',col_label=\"Year\",thresh=10,file_prefix='individual_', ax=ax[0],color=sns.xkcd_rgb['black'],label='Individual Volume [%s-2009]' % min_y,marker=\"o\", scale = scale)\nplot.plot_year_dist(df[(df['Year'] \u003e= min_y) \u0026 (df['Year'] \u003c= 2009)],col='min_VolFirstP',col_label=\"Year\",thresh=10,file_prefix='pair_', ax=ax[0],color=sns.xkcd_rgb['red'],label='Pair Volume [%s-2009]' % min_y, marker=\"s\", scale = scale)\n\n\nplot.plot_year_dist(df_mesh[(df_mesh['Year'] \u003e= min_y) \u0026 (df_mesh['Year'] \u003c= 2009)],col='min_TFirstP',col_label=\"Years\",thresh=3,file_prefix='individual_', ax=ax[1],color=sns.xkcd_rgb['black'],label='Individual Time [%s-2009]' % min_y,marker=\"o\", scale = scale)\nplot.plot_year_dist(df[(df['Year'] \u003e= min_y) \u0026 (df['Year'] \u003c= 2009)],col='min_TFirstP',col_label=\"Years\",thresh=3,file_prefix='pair_', ax=ax[1],color=sns.xkcd_rgb['red'],label='Pair Time [%s-2009]' % min_y,marker=\"s\", scale = scale)\n\nfor i in range(2):\n    ax[i].set_yscale(\"logit\", p_min=1e-4)\n    ax[i].legend(bbox_to_anchor=(0., 1.02, 1., .102), borderaxespad=0., frameon=True, fancybox=True)\n\nplt.savefig(\"temp.pdf\",bbox_inches='tight')\n```\n\nWhen running the above code I am getting the following error:\n\n```\n---------------------------------------------------------------------------\nUnboundLocalError                         Traceback (most recent call last)\n\u003cipython-input-75-76bd951dfd46\u003e in \u003cmodule\u003e()\n     19 \n     20 \n---\u003e 21 plt.savefig(\"Novelty_year_dist_logit.pdf\",bbox_inches='tight')\n     22 plt.savefig(\"Novelty_year_dist_logit.eps\",bbox_inches='tight')\n\n/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.pyc in savefig(*args, **kwargs)\n    575 def savefig(*args, **kwargs):\n    576     fig = gcf()\n--\u003e 577     res = fig.savefig(*args, **kwargs)\n    578     draw()   # need this if 'transparent=True' to reset colors\n    579     return res\n\n/usr/local/lib/python2.7/dist-packages/matplotlib/figure.pyc in savefig(self, *args, **kwargs)\n   1474             self.set_frameon(frameon)\n   1475 \n-\u003e 1476         self.canvas.print_figure(*args, **kwargs)\n   1477 \n   1478         if frameon:\n\n/usr/local/lib/python2.7/dist-packages/matplotlib/backend_bases.pyc in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, **kwargs)\n   2156                     orientation=orientation,\n   2157                     dryrun=True,\n-\u003e 2158                     **kwargs)\n   2159                 renderer = self.figure._cachedRenderer\n   2160                 bbox_inches = self.figure.get_tightbbox(renderer)\n\n/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_pdf.pyc in print_pdf(self, filename, **kwargs)\n   2483                 RendererPdf(file, image_dpi),\n   2484                 bbox_inches_restore=_bbox_inches_restore)\n-\u003e 2485             self.figure.draw(renderer)\n   2486             renderer.finalize()\n   2487         finally:\n\n/usr/local/lib/python2.7/dist-packages/matplotlib/artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs)\n     57     def draw_wrapper(artist, renderer, *args, **kwargs):\n     58         before(artist, renderer)\n---\u003e 59         draw(artist, renderer, *args, **kwargs)\n     60         after(artist, renderer)\n     61 \n\n/usr/local/lib/python2.7/dist-packages/matplotlib/figure.pyc in draw(self, renderer)\n   1083         dsu.sort(key=itemgetter(0))\n   1084         for zorder, a, func, args in dsu:\n-\u003e 1085             func(*args)\n   1086 \n   1087         renderer.close_group('figure')\n\n/usr/local/lib/python2.7/dist-packages/matplotlib/artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs)\n     57     def draw_wrapper(artist, renderer, *args, **kwargs):\n     58         before(artist, renderer)\n---\u003e 59         draw(artist, renderer, *args, **kwargs)\n     60         after(artist, renderer)\n     61 \n\n/usr/local/lib/python2.7/dist-packages/matplotlib/axes/_base.pyc in draw(self, renderer, inframe)\n   2004             self.apply_aspect(pos)\n   2005         else:\n-\u003e 2006             self.apply_aspect()\n   2007 \n   2008         artists = []\n\n/usr/local/lib/python2.7/dist-packages/matplotlib/axes/_base.pyc in apply_aspect(self, position)\n   1191         fig_aspect = figH / figW\n   1192         if self._adjustable in ['box', 'box-forced']:\n-\u003e 1193             if aspect_scale_mode == \"log\":\n   1194                 box_aspect = A * self.get_data_ratio_log()\n   1195             else:\n\nUnboundLocalError: local variable 'aspect_scale_mode' referenced before assignment\n```\n\nHowever, running the example explained in http://stackoverflow.com/a/13663328/1650159 doesn't give this error. \n\nAdditional Info:\n\n``` python\ndef plot_year_dist(df,col='',col_label=\"\",thresh=0,file_prefix='',outFolder=DEFAULT_OUTPUT,\\\n    ax=None,color=sns.xkcd_rgb['black'],label='',scale=None,**kwargs):\n  saveFig = False\n  if ax is None:\n    plt.clf()\n    ax = plt.gca()\n    saveFig = True\n  filename = file_prefix+col+\"_year_dist.png\"\n  df_g = df[[col,'Year']].groupby('Year').count()\n  df_g[\"filtered\"] = df[[col,\"Year\"]][df[col] \u003c= thresh].groupby(\"Year\").count()\n  df_g[\"prop\"] = df_g[\"filtered\"]/df_g[col]\n  #print df_g.index\n  #print df_g\n  x = df_g.index.values\n  y = df_g[\"prop\"].values\n  if scale == 'logit':\n    y = np.log10(y/(1.0-y))\n\n  ax.plot(x,y, linestyle='-',markersize=3.0,color=color,label=label,**kwargs)\n\n  print \"Finished generating histogram\"\n  ax.set_xlabel(col_label)\n  ax.set_ylabel(\"Proportion (\u003c= %s)\" % thresh)\n  if scale == 'logit':\n    ax.set_ylabel(\"$log_{10}(p/1-p)$ [$p = P(X\u003c= %s)$]\" % thresh)\n  if saveFig:\n    plt.savefig(outFolder+\"/\"+filename)\n  print \"Plot saved in %s.\" % (filename)\n\n```\n","author":{"url":"https://github.com/napsternxg","@type":"Person","name":"napsternxg"},"datePublished":"2015-08-11T10:31:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":15},"url":"https://github.com/4900/matplotlib/issues/4900"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:7835c0a3-4d5b-e395-e2b1-f2b942455443
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9794:14A013:BCCE7E:FB20A1:6A532116
html-safe-nonceb0ae54e7387b66300dfe87ccbd644254fb9ba1739a0e78271bf84c86b2d83648
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Nzk0OjE0QTAxMzpCQ0NFN0U6RkIyMEExOjZBNTMyMTE2IiwidmlzaXRvcl9pZCI6IjQzNTM0Njg2OTk0MzAyOTc4NzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac070b651bd25ec01d2f59df1aa87f0e2c7abd8478dd689bb62705372fa471193d
hovercard-subject-tagissue:100283033
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/4900/issue_layout
twitter:imagehttps://opengraph.githubassets.com/558284dc1acfcf734e36022c70057c20a458ecdf704e82be8c26c62bb440ca51/matplotlib/matplotlib/issues/4900
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/558284dc1acfcf734e36022c70057c20a458ecdf704e82be8c26c62bb440ca51/matplotlib/matplotlib/issues/4900
og:image:altplt.clf() fig, ax = plt.subplots(1,2, sharey=True) plt.setp(ax.flat, aspect=1.0, adjustable='box-forced') #fig.set_size_inches(16,8) sns.despine(fig=fig) #scale = 'logit' scale = None plot.plot_yea...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamenapsternxg
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/4900#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F4900
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%2F4900
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/4900
Reloadhttps://github.com/matplotlib/matplotlib/issues/4900
Reloadhttps://github.com/matplotlib/matplotlib/issues/4900
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/4900
matplotlib https://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/4900
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
#14727https://github.com/matplotlib/matplotlib/pull/14727
UnboundLocalError: local variable 'aspect_scale_mode' referenced before assignmenthttps://github.com/matplotlib/matplotlib/issues/4900#top
#14727https://github.com/matplotlib/matplotlib/pull/14727
v3.2.0https://github.com/matplotlib/matplotlib/milestone/43
https://github.com/napsternxg
napsternxghttps://github.com/napsternxg
on Aug 11, 2015https://github.com/matplotlib/matplotlib/issues/4900#issue-100283033
http://stackoverflow.com/a/13663328/1650159http://stackoverflow.com/a/13663328/1650159
v3.2.0https://github.com/matplotlib/matplotlib/milestone/43
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.