Title: connectionstyle arc3 with high rad value pushes up data interval of x-axis and y-axis. · Issue #19174 · matplotlib/matplotlib · GitHub
Open Graph Title: connectionstyle arc3 with high rad value pushes up data interval of x-axis and y-axis. · Issue #19174 · matplotlib/matplotlib
X Title: connectionstyle arc3 with high rad value pushes up data interval of x-axis and y-axis. · Issue #19174 · matplotlib/matplotlib
Description: I am a hobbyist learning what python can do (and I am enjoying how much python can do!). When drawing a circular networkx graph, that has arc3 connectionstyle edges, I noticed that the graph "shrank" when I set a high value for rad. Look...
Open Graph Description: I am a hobbyist learning what python can do (and I am enjoying how much python can do!). When drawing a circular networkx graph, that has arc3 connectionstyle edges, I noticed that the graph "shran...
X Description: I am a hobbyist learning what python can do (and I am enjoying how much python can do!). When drawing a circular networkx graph, that has arc3 connectionstyle edges, I noticed that the graph "...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/19174
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"connectionstyle arc3 with high rad value pushes up data interval of x-axis and y-axis.","articleBody":"I am a hobbyist learning what python can do (and I am enjoying how much python can do!).\r\n\r\nWhen drawing a circular `networkx` graph, that has arc3 `connectionstyle` edges, I noticed that the graph \"shrank\" when I set a high value for _rad_. Looking deeper, the graph had not shrunk. The x-axis and y-axis had lengthened.\r\n\r\nPlease refer to the graphs plotted by the code below.\r\n\r\nI started with the top-left graph ('low-rad' of 0.5 and not having to set_ylim).\r\n\r\nThe top-right graph is the graph that 'shrank' when _rad_ was set 'high' (rad=1).\r\n\r\nNext, I manually set_ylim for the bottom two graphs.\r\n\r\nThe bottom-left graph looks like the top-left graph (I estimated the values for the _ylim_ so that they look similar).\r\n\r\nThe bottom-right graph shows the intended 'high-rad' graph (the edges are high-arched).\r\n\r\nNotice the axis ticks of each graph and compare the graphs' x-axis and y-axis data intervals. This suggests that matplotlib treats the 'high-rad' graphs as bigger than how human sees it. If the ticks were not there, I would not have known that the axis had lengthened (`networkx` switches off the ticks for x-axis and y-axis).\r\n\r\nThe expected outcome is the graph in the bottom right, **without** having to set (y-)axis limit (and without axis ticks).\r\n\r\nI am using python 3.7.7 and matpotlib 3.2.2.\r\n\r\nThank you.\r\n\r\n```\r\nimport networkx as nx\r\nimport matplotlib.pyplot as plt\r\n\r\nshop_journey = [(1,2,3,4,5,6,7,8,9,10,11,12),(1,7),(7,1)]\r\n\r\nG = nx.MultiDiGraph()\r\nfor journey in shop_journey:\r\n if len(journey) \u003e 1:\r\n nx.add_path(G,journey)\r\n\r\ndef circle_pattern(ax,connectionstyle,bottom,top):\r\n pos=nx.circular_layout(G)\r\n nx.draw_networkx(\r\n G,\r\n pos=pos,\r\n connectionstyle=connectionstyle,\r\n ax=ax\r\n )\r\n ax.axis('equal')\r\n y1,y2 = tuple(ax.yaxis.get_data_interval())\r\n x1,x2 = tuple(ax.xaxis.get_data_interval())\r\n title='{}\\nX-axis data interval: {},{}\\nY-axis data interval: {},{}\\nY-limits: {},{}'.format(\r\n connectionstyle,\r\n round(x1,1),round(x2,1),\r\n round(y1,1),round(y2,1),\r\n bottom,top\r\n )\r\n ax.set_title(label=title)\r\n ax.set_ylim(bottom,top)\r\n ax.tick_params(left=True,bottom=True,labelleft=True,labelbottom=True)\r\n\r\nfig,axs = plt.subplots(2,2,figsize=(9,9))\r\ncircle_pattern(axs[0,0],\"arc3,rad=0.5\",None,None)\r\ncircle_pattern(axs[0,1],\"arc3,rad=1\",None,None)\r\ncircle_pattern(axs[1,0],\"arc3,rad=0.5\",-1.5,1.5)\r\ncircle_pattern(axs[1,1],\"arc3,rad=1\",-1.5,1.5)\r\nplt.subplots_adjust(hspace=0.9)\r\nplt.show()\r\n```","author":{"url":"https://github.com/rchee2018","@type":"Person","name":"rchee2018"},"datePublished":"2020-12-26T12:48:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/19174/matplotlib/issues/19174"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d1618551-6aeb-1bd3-e5a2-b89c34a739e1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D02E:9C6CC:306E82B:44A6F94:6A512364 |
| html-safe-nonce | 48e45786691080fb01bcb4d83f4be8e7e584421c4831635f399cdbea68c5e71b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMDJFOjlDNkNDOjMwNkU4MkI6NDRBNkY5NDo2QTUxMjM2NCIsInZpc2l0b3JfaWQiOiI0MjczMTQ5MzgzNjExMDY1MTg4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 969f6791366e43d88c122906a24afd9191e08fafb075755e6e1aeb16c8f3a702 |
| hovercard-subject-tag | issue:774869912 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/19174/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9e18e5a578aea994c3085f23b65f9fc0e55f10b0434fc56857c4b261dae4059a/matplotlib/matplotlib/issues/19174 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9e18e5a578aea994c3085f23b65f9fc0e55f10b0434fc56857c4b261dae4059a/matplotlib/matplotlib/issues/19174 |
| og:image:alt | I am a hobbyist learning what python can do (and I am enjoying how much python can do!). When drawing a circular networkx graph, that has arc3 connectionstyle edges, I noticed that the graph "shran... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rchee2018 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 689b683944b0d7f015d0e776452c970832fa81b82dc15284469b556ecced715b |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 942b51ed3bd5feee3d5e2719f890a5fe286edbbb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width