Skip to content

Commit

Permalink
Merge pull request #16 from toshiakiasakura/folded_context
Browse files Browse the repository at this point in the history
cplt.Multiple can remove usage of mul from arguments.
  • Loading branch information
toshiakiasakura authored May 4, 2022
2 parents 1c22784 + b1560c5 commit f5bf3ef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion contextplt/__version__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version_info__ = (0,2,8)
__version_info__ = (0,2,9)
__version__ = ".".join(map(str, __version_info__))
11 changes: 9 additions & 2 deletions contextplt/main.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from dataclasses import dataclass, field
from typing import Union, Optional, List, Dict, Tuple, Any
from typing import Union, Optional, List, Dict, Tuple, Any, ClassVar
import copy

import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
import matplotlib.dates as mdates


@dataclass(repr=True)
class Single():
"""Create one figure. Adjust figure with arguments.
Expand Down Expand Up @@ -170,6 +172,9 @@ def __post_init__(self):
self.fig = plt.figure(figsize=self.figsize,dpi=self.dpi)
plt.suptitle(self.suptitle)

self.Single = MulSingle
self.Single.mul = self

def set_ax(self,index,xlim=None, ylim=None,
xlabel="", ylabel="",title="", rotation : int = 0):
"""Return axis object.
Expand Down Expand Up @@ -201,15 +206,17 @@ def __exit__(self,exc_type, exc_value, exc_traceback):
plt.savefig(self.save_path, **self.savefig_kargs) if self.save_path else None
plt.show() if self.show else None

self.Single.mul = None

def option(self):
"""This method is for additional graphic setting.
See DatePlot for example."""
pass

@dataclass(repr=True)
class MulSingle():
mul : Multiple
index : int
mul : ClassVar[Multiple]
sharex : Optional[plt.Axes] = None
sharey : Optional[plt.Axes] = None
xlim : Optional[List[float]] = None
Expand Down

0 comments on commit f5bf3ef

Please sign in to comment.