Skip to content

Commit

Permalink
add ylim control in figure.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Rasic2 committed Sep 30, 2022
1 parent e982238 commit ec84637
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gvasp/common/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def wrapper(self, *args, **kargs):
except:
pass
plt.xlim() if self.xlim is None else plt.xlim(self.xlim)
plt.ylim() if self.ylim is None else plt.ylim(self.ylim)
plt.xticks(ticks=None if self.xticks is None else range(1, 2 * len(self.xticks), 2), labels=self.xticks,
fontsize=self.fontsize)
plt.yticks(fontsize=self.fontsize)
Expand All @@ -46,7 +47,7 @@ def __new__(cls, *args, **kwargs):
raise TypeError(f"<{cls.__name__} class> may not be instantiated")
return super(Figure, cls).__new__(cls)

def __init__(self, width=8, height=6, family='Arial', weight='regular', fontsize=20, title='', xlim=None,
def __init__(self, width=8, height=6, family='Arial', weight='regular', fontsize=20, title='', xlim=None, ylim=None,
xticks=None, xlabel=None, ylabel=None, bwidth=1, **kargs):
self.width = width
self.height = height
Expand All @@ -57,6 +58,7 @@ def __init__(self, width=8, height=6, family='Arial', weight='regular', fontsize
self.fontsize = fontsize
self.title = title
self.xlim = xlim
self.ylim = ylim
self.xticks = xticks
self.xlabel = xlabel
self.ylabel = ylabel
Expand Down

0 comments on commit ec84637

Please sign in to comment.