| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| Expand Up | @@ -37,15 +37,15 @@ | |||||
| cells below those that create the plot will change the plot - it is a | ||||||
| live object in memory. | ||||||
|
|
||||||
| This tutorial will use Matplotlib's imperative-style plotting | ||||||
| interface, pyplot. This interface maintains global state, and is very | ||||||
| useful for quickly and easily experimenting with various plot | ||||||
| settings. The alternative is the object-oriented interface, which is also | ||||||
| very powerful, and generally more suitable for large application | ||||||
| development. If you'd like to learn about the object-oriented | ||||||
| interface, a great place to start is our :doc:`Quick start guide | ||||||
| </tutorials/introductory/quick_start>`. For now, let's get on | ||||||
| with the imperative-style approach: | ||||||
| This tutorial will use Matplotlib's implicit plotting interface, pyplot. This | ||||||
| interface maintains global state, and is very useful for quickly and easily | ||||||
| experimenting with various plot settings. The alternative is the explicit, | ||||||
| which is more suitable for large application development. For an explanation | ||||||
|
Comment thread
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
Sorry, something went wrong.
All reactions
|
||||||
| of the tradeoffs between the implicit and explicit interfaces See | ||||||
|
Comment thread
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
Sorry, something went wrong.
All reactions
|
||||||
| :ref:`api_interfaces` and the :doc:`Quick start guide | ||||||
| </tutorials/introductory/quick_start>` to start using the explicit interface. | ||||||
| For now, let's get on with the implicit approach: | ||||||
|
|
||||||
| """ | ||||||
|
|
||||||
| import matplotlib.pyplot as plt | ||||||
| Expand Down | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| Expand Up | @@ -4,19 +4,20 @@ | |||||
| =============== | ||||||
|
|
||||||
| An introduction to the pyplot interface. Please also see | ||||||
| :doc:`/tutorials/introductory/quick_start` for an overview of how Matplotlib works. | ||||||
| :doc:`/tutorials/introductory/quick_start` for an overview of how Matplotlib | ||||||
| works and :ref:`api_interfaces` for an explanation of the trade-offs between the | ||||||
| supported user APIs. | ||||||
|
|
||||||
| """ | ||||||
|
|
||||||
| ############################################################################### | ||||||
| # Intro to pyplot | ||||||
| # =============== | ||||||
| # | ||||||
| # :mod:`matplotlib.pyplot` is a collection of functions | ||||||
| # that make matplotlib work like MATLAB. | ||||||
| # Each ``pyplot`` function makes | ||||||
| # some change to a figure: e.g., creates a figure, creates a plotting area | ||||||
| # in a figure, plots some lines in a plotting area, decorates the plot | ||||||
| # with labels, etc. | ||||||
| # :mod:`matplotlib.pyplot` is a collection of functions that make matplotlib | ||||||
| # work like MATLAB. Each ``pyplot`` function makes some change to a figure: | ||||||
|
Comment thread
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
Sorry, something went wrong.
All reactions
|
||||||
| # e.g., creates a figure, creates a plotting area in a figure, plots some lines | ||||||
| # in a plotting area, decorates the plot with labels, etc. | ||||||
| # | ||||||
| # In :mod:`matplotlib.pyplot` various states are preserved | ||||||
| # across function calls, so that it keeps track of things like | ||||||
| Expand All | @@ -28,10 +29,11 @@ | |||||
| # | ||||||
| # .. note:: | ||||||
| # | ||||||
| # the pyplot API is generally less-flexible than the object-oriented API. | ||||||
| # Most of the function calls you see here can also be called as methods | ||||||
| # from an ``Axes`` object. We recommend browsing the tutorials and | ||||||
| # examples to see how this works. | ||||||
| # the implicit pyplot API is generally less verbose but also not as flexible as the | ||||||
| # explicit API. Most of the function calls you see here can also be called | ||||||
|
Comment thread
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
Sorry, something went wrong.
All reactions
|
||||||
| # as methods from an ``Axes`` object. We recommend browsing the tutorials | ||||||
| # and examples to see how this works. See :ref:`api_interfaces` for an | ||||||
| # explanation of the trade off of the supported user APIs. | ||||||
| # | ||||||
| # Generating visualizations with pyplot is very quick: | ||||||
|
|
||||||
| Expand Down Expand Up | @@ -301,7 +303,7 @@ def f(t): | |||||
| # and the current axes with `~.pyplot.cla`. If you find | ||||||
| # it annoying that states (specifically the current image, figure and axes) | ||||||
| # are being maintained for you behind the scenes, don't despair: this is just a thin | ||||||
| # stateful wrapper around an object oriented API, which you can use | ||||||
| # stateful wrapper around an object-oriented API, which you can use | ||||||
| # instead (see :doc:`/tutorials/intermediate/artists`) | ||||||
| # | ||||||
| # If you are making lots of figures, you need to be aware of one | ||||||
| Expand Down | ||||||
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualitySorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.