-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
30 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,21 @@ | ||
from deephaven.plugin import Registration | ||
from importlib import resources | ||
import matplotlib.pyplot as plt | ||
|
||
__version__ = "0.0.1.dev5" | ||
__version__ = "0.0.1.dev6" | ||
|
||
def init_theme(): | ||
# Set the Deephaven style globally. | ||
# We use the savefig function to export the Figure, and that uses the Figure's properties for colours rather than temporary styling. | ||
# The Figure's properties are set on creation time of the Figure, rather than when the Figure is exported | ||
# We do not have hooks into when a user creates a new Figure, so we set the theme globally ahead of time | ||
# https://github.com/matplotlib/matplotlib/issues/6592/ | ||
with resources.path(__package__, 'deephaven.mplstyle') as p: | ||
plt.style.use(['dark_background',p]) | ||
|
||
class MatplotlibRegistration(Registration): | ||
@classmethod | ||
def register_into(cls, callback: Registration.Callback) -> None: | ||
init_theme() | ||
from . import figure_type | ||
callback.register(figure_type.FigureType) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
axes.prop_cycle: cycler('color', ['76d9e4', '9edc6f', 'fcd65b', 'aa9af4', 'f37e3f', 'f95d84', 'f0f0ee']) | ||
axes.facecolor: 2d2a2e | ||
axes.edgecolor: f0f0ee | ||
axes.labelcolor: f0f0ee | ||
xtick.color: f0f0ee | ||
ytick.color: f0f0ee | ||
grid.color: f0f0ee | ||
savefig.facecolor: 2d2a2e | ||
text.color: f0f0ee | ||
lines.color: f0f0ee |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters