Title: [ENH] : Provide axis('equal') for Axes3D #22570 by patquem · Pull Request #22705 · matplotlib/matplotlib · GitHub
Open Graph Title: [ENH] : Provide axis('equal') for Axes3D #22570 by patquem · Pull Request #22705 · matplotlib/matplotlib
X Title: [ENH] : Provide axis('equal') for Axes3D #22570 by patquem · Pull Request #22705 · matplotlib/matplotlib
Description: PR Summary Closes #22570 Make axis('equal') available (I am new in PR - sorry for not doing things correctly) PR Checklist Tests and Styling Has pytest style unit tests (and pytest passes). Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all). Documentation New features are documented, with examples if plot related. New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there). [N/A] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there). Documentation is sphinx and numpydoc compliant (the docs should build without error). Example import numpy as np import matplotlib.pyplot as plt def plot_hexahedron(ax, x, y, z, *args, **kwargs): def plot_edge(i, j): ax.plot([x[i], x[j]], [y[i], y[j]], [z[i], z[j]], *args, **kwargs) # edges associated to the y=0 face plot_edge(0, 1) plot_edge(1, 3) plot_edge(3, 2) plot_edge(2, 0) # edges associated to the y=1 face plot_edge(4, 5) plot_edge(5, 7) plot_edge(7, 6) plot_edge(6, 4) # missing edges (x=cste) plot_edge(0, 4) plot_edge(1, 5) plot_edge(3, 7) plot_edge(2, 6) def ex_hexahedron(): """ Example of hexahedron representation with Matplotlib """ points = np.array([[0, 0, 0], [1, 0, 0], [0, 1, 0], [1, 1, 0], [0, 0, 3], [1, 0, 3], [0, 1, 3], [1, 1, 3]]) x = np.asarray([coord[0] for coord in points]) y = np.asarray([coord[1] for coord in points]) z = np.asarray([coord[2] for coord in points]) fig, axes = plt.subplots(1, 2, figsize=(12, 5), subplot_kw={'projection': '3d'}) def plot(ax): plot_hexahedron(ax, x, y, z, 'r') ax.set_xlabel("X") ax.set_ylabel("Y") ax.set_zlabel("Z") # standard representation (aspect='auto') plot(axes[0]) axes[0].set_title("Standard representation") # 3d axis equal (aspect='equal') plot(axes[1]) axes[1].set_aspect('equal') axes[1].set_title("set_aspect('equal)") plt.tight_layout() ex_hexahedron() plt.show()
Open Graph Description: PR Summary Closes #22570 Make axis('equal') available (I am new in PR - sorry for not doing things correctly) PR Checklist Tests and Styling Has pytest style unit tests (and pytest passe...
X Description: PR Summary Closes #22570 Make axis('equal') available (I am new in PR - sorry for not doing things correctly) PR Checklist Tests and Styling Has pytest style unit tests (and pyte...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/22705
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:21b85e52-e9cf-eebd-b30f-53c76b077e39 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C97E:497D6:18ADF6D:21A0AC9:6A523C47 |
| html-safe-nonce | 0856ed9e476bd085c48128e439002fcfcc0b193b5f7eeff39c0580498c3d4ff1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTdFOjQ5N0Q2OjE4QURGNkQ6MjFBMEFDOTo2QTUyM0M0NyIsInZpc2l0b3JfaWQiOiIzMzI3NDg4MzcyMDUwNjM5OTQzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 6512f88a0d03094e3c2cb50d38854104680d005b39fd13dcaa720a1e773c562b |
| hovercard-subject-tag | pull_request:889338118 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/matplotlib/matplotlib/pull/22705/files |
| twitter:image | https://avatars.githubusercontent.com/u/16154687?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/16154687?s=400&v=4 |
| og:image:alt | PR Summary Closes #22570 Make axis('equal') available (I am new in PR - sorry for not doing things correctly) PR Checklist Tests and Styling Has pytest style unit tests (and pytest passe... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width