Importing pybamm affects style of Matplotlib figures
See original GitHub issueDescribe the bug
I prefer to create my own Matplotlib figures without using the sim.plot()
function in PyBaMM. Unfortunately, importing pybamm
will affect the style of the Matplotlib figures even if I don’t use PyBaMM to create the plots.
To Reproduce
In this example, pybamm
is imported. Notice the small font size used for axis labels and the red color applied to the line plot.
import matplotlib.pyplot as plt
import pybamm
_, ax = plt.subplots()
ax.plot([1, 3, 5, 3, 8.4])
ax.set_xlabel('X axis')
ax.set_ylabel('Y axis')
plt.show()
In this example, pybamm
is not imported. Notice the default (larger) font size for axis labels and the blue color for the line plot.
import matplotlib.pyplot as plt
_, ax = plt.subplots()
ax.plot([1, 3, 5, 3, 8.4])
ax.set_xlabel('X axis')
ax.set_ylabel('Y axis')
plt.show()
Expected behaviour I expect the default figure style to be used when creating plots with Matplotlib.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Source code for pybamm.simulation
Simulation class # import pickle import pybamm import numpy as np import copy ... Other type (?) except NameError: return False # Probably...
Read more >Style Plots using Matplotlib - GeeksforGeeks
With matplotlib, we can style the plots like, an HTML webpage is styled by using CSS styles. We just need to import style...
Read more >Python Battery Mathematical Modelling (PyBaMM)
The Python package PyBaMM aims to provide a flexible platform for implementation and comparison of new models and numerical methods.
Read more >PyBaMM/CHANGELOG.md at develop - GitHub
Parameter sets can now more easily be added via python scripts. ... Parameters can now be imported from a directory having "pybamm" in...
Read more >Physics-Based Modelling for SEI and Lithium Plating During ...
Parameters that affect the output from the physics-based model are ... PyBaMM Python Battery Mathematical Modelling. i, ii, 4, 14–16, 18–21, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks! Branch from and PR to
develop
. Typically we would do a branch likeissue-1618-plot-style
Yes, I can work on this. I looked at the contributing guidelines. After I fork the repository, which branch should I work from? Do I create a branch from
main
or fromdevelop
? And from my branch, to which branch do I make the pull request to?