Suppress warning (and legend) if legend is required but no labels are
given. Also start to implement a basic one-liner plot function, API still in WIP.
This commit is contained in:
parent
81bb851e10
commit
d67d185f86
1587
Examples.ipynb
1587
Examples.ipynb
File diff suppressed because one or more lines are too long
13
replot.py
13
replot.py
@ -129,5 +129,18 @@ class Figure():
|
|||||||
# Create aliases for "upper" / "top" and "lower" / "bottom"
|
# Create aliases for "upper" / "top" and "lower" / "bottom"
|
||||||
location.replace("top ", "upper ")
|
location.replace("top ", "upper ")
|
||||||
location.replace("bottom ", "lower ")
|
location.replace("bottom ", "lower ")
|
||||||
|
# Avoid warning if no labels were given for plots
|
||||||
|
nb_labelled_plots = sum(["label" in plt[1] for plt in self.plots])
|
||||||
|
if nb_labelled_plots > 0:
|
||||||
# Add legend
|
# Add legend
|
||||||
axes.legend(loc=location)
|
axes.legend(loc=location)
|
||||||
|
|
||||||
|
|
||||||
|
def plot(data, **kwargs):
|
||||||
|
"""
|
||||||
|
"""
|
||||||
|
figure = Figure(**kwargs)
|
||||||
|
# TODO: Fix API, support every plot type
|
||||||
|
for plt in data:
|
||||||
|
figure.plot(plt)
|
||||||
|
return figure
|
||||||
|
Loading…
Reference in New Issue
Block a user