Skip to content
New issue

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

Plotting module - Backend support (1.7 branch) #20463

Merged
merged 1 commit into from Nov 21, 2020

Conversation

oscarbenjamin
Copy link
Contributor

References to other Issues or PRs

Same as #20373 but for the 1.7 branch.

Brief description of what is fixed or changed

Other comments

Release Notes

  • plotting
    • capability to subclass Basebackend and specify it to the plotting functions, thus creating plots with other plotting libraries

@sympy-bot
Copy link

sympy-bot commented Nov 20, 2020

Hi, I am the SymPy bot (v161). I'm here to help you write a release notes entry. Please read the guide on how to write release notes.

Your release notes are in good order.

Here is what the release notes will look like:

  • plotting
    • capability to subclass Basebackend and specify it to the plotting functions, thus creating plots with other plotting libraries (#20463 by @oscarbenjamin)

This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.7.

Click here to see the pull request description that was parsed.
<!-- Your title above should be a short description of what
was changed. Do not include the issue number in the title. -->

#### References to other Issues or PRs
<!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact
format, e.g. "Fixes #1234" (see
https://tinyurl.com/auto-closing for more information). Also, please
write a comment on that issue linking back to this pull request once it is
open. -->

Same as #20373 but for the 1.7 branch.

#### Brief description of what is fixed or changed


#### Other comments


#### Release Notes

<!-- Write the release notes for this release below. See
https://github.com/sympy/sympy/wiki/Writing-Release-Notes for more information
on how to write release notes. The bot will check your release notes
automatically to see if they are formatted correctly. -->

<!-- BEGIN RELEASE NOTES -->
* plotting
  * capability to subclass Basebackend and specify it to the plotting functions, thus creating plots with other plotting libraries
<!-- END RELEASE NOTES -->

Update

The release notes on the wiki have been updated.

1. Previously, the keyword `backend` accepted only a string value. Now, it
accepts also a subclass of BaseBackend. This allows users to define their
custom backends (for example, creating a backend for Plotly, Bokeh, ...).
Without this edit, the user would be forced to subclass Plot, PlotGrid,
Basebackedn as well as re-creating a function similar to plot.

Example:
class DummyBackend(BaseBackend):
    def show(self):
        pass
x = symbols("x")
plot(sin(x), backend=DummyBackend)

2. Added the keyword argument `size` to Plot, PlotGrid and plot functions.
The user can now specify the figure size. This is useful for generating
plots that are ready to be exported and later included in documents.
Obviously, this only works with `MatplotlibBackend`.

Example:
x = symbols("x")
plot(sin(x), size=(8, 4))

Co-authored-by: Davide_sd <sandona.davide@gmail.com>
@codecov
Copy link

codecov bot commented Nov 21, 2020

Codecov Report

Merging #20463 (3a52f80) into 1.7 (eed50f3) will decrease coverage by 0.007%.
The diff coverage is 48.148%.

@@              Coverage Diff              @@
##               1.7    #20463       +/-   ##
=============================================
- Coverage   75.718%   75.710%   -0.008%     
=============================================
  Files          674       674               
  Lines       174175    174185       +10     
  Branches     41103     41102        -1     
=============================================
- Hits        131882    131876        -6     
- Misses       36550     36564       +14     
- Partials      5743      5745        +2     

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants