Use seaborn.apionly instead of seaborn
This commit is contained in:
parent
d67d185f86
commit
8feef79004
File diff suppressed because one or more lines are too long
13
replot.py
13
replot.py
@ -5,12 +5,7 @@ it, then we write a buffer on top of matplotlib API.
|
|||||||
"""
|
"""
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import seaborn
|
import seaborn.apionly as sns
|
||||||
|
|
||||||
|
|
||||||
# Cancel seaborn modifications of matplotlib, we do not want to interfere in
|
|
||||||
# any ways with matplotlib
|
|
||||||
seaborn.reset_orig()
|
|
||||||
|
|
||||||
|
|
||||||
# TODO: Remove it, this is interfering with matplotlib
|
# TODO: Remove it, this is interfering with matplotlib
|
||||||
@ -47,9 +42,9 @@ class Figure():
|
|||||||
Actually render and show the figure.
|
Actually render and show the figure.
|
||||||
"""
|
"""
|
||||||
# Tweak matplotlib to use seaborn
|
# Tweak matplotlib to use seaborn
|
||||||
seaborn.set()
|
sns.set()
|
||||||
# Plot using specified color palette
|
# Plot using specified color palette
|
||||||
with seaborn.color_palette(self.palette, self.max_colors):
|
with sns.color_palette(self.palette, self.max_colors):
|
||||||
# Create figure
|
# Create figure
|
||||||
figure, axes = plt.subplots()
|
figure, axes = plt.subplots()
|
||||||
# Add plots
|
# Add plots
|
||||||
@ -65,7 +60,7 @@ class Figure():
|
|||||||
figure.show()
|
figure.show()
|
||||||
# Do not forget to restore matplotlib state, in order not to interfere
|
# Do not forget to restore matplotlib state, in order not to interfere
|
||||||
# with it.
|
# with it.
|
||||||
seaborn.reset_orig()
|
sns.reset_orig()
|
||||||
|
|
||||||
|
|
||||||
#def palette(self, palette):
|
#def palette(self, palette):
|
||||||
|
Loading…
Reference in New Issue
Block a user