Skip to content

Commit

Permalink
updat use_pch_style
Browse files Browse the repository at this point in the history
DingWB committed Sep 16, 2024
1 parent 4ca08c0 commit 2458f71
Showing 8 changed files with 20 additions and 15 deletions.
13 changes: 8 additions & 5 deletions PyComplexHeatmap/__init__.py
Original file line number Diff line number Diff line change
@@ -4,11 +4,14 @@
from .clustermap import (heatmap, ClusterMapPlotter, composite,
DendrogramPlotter)
from .oncoPrint import oncoprint, oncoPrintPlotter
from .annotations import *
from .dotHeatmap import *
from .colors import *
from .utils import set_default_style
import fire
from .annotations import (
HeatmapAnnotation,anno_lineplot,anno_img,
anno_scatterplot,anno_barplot,anno_boxplot,
anno_label,anno_simple,AnnotationBase
)
from .dotHeatmap import DotClustermapPlotter,dotHeatmap2d
from .colors import define_cmap
from .utils import use_pch_style
# __all__=['*']
from ._version import version as __version__
# __version__ = "1.6.5"
5 changes: 1 addition & 4 deletions PyComplexHeatmap/clustermap.py
Original file line number Diff line number Diff line change
@@ -5,12 +5,9 @@
import matplotlib
import matplotlib.pylab as plt
from scipy.cluster import hierarchy
import collections
import warnings
import copy
from .utils import mm2inch

from .utils import (
mm2inch,
_check_mask,
_calculate_luminance,
despine,
6 changes: 3 additions & 3 deletions PyComplexHeatmap/utils.py
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@


# =============================================================================
def set_default_style():
def use_pch_style():
from matplotlib import rcParams

D = {
@@ -26,7 +26,7 @@ def set_default_style():
"legend.frameon": True,
"legend.fontsize": 10,
# Savefig
"figure.dpi": 100,
# "figure.dpi": 100,
"savefig.bbox": "tight",
"savefig.dpi": 300,
"savefig.pad_inches": 0.05,
@@ -954,4 +954,4 @@ def plot_legend_list(


# =============================================================================
# set_default_style()
# use_pch_style()
1 change: 1 addition & 0 deletions notebooks/advanced_usage.ipynb
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@
"import PyComplexHeatmap\n",
"# print(PyComplexHeatmap.__version__)\n",
"from PyComplexHeatmap import *\n",
"use_pch_style() # or plt.style.use('default') to restore default style\n",
"# import matplotlib; print(matplotlib.__version__)"
]
},
3 changes: 2 additions & 1 deletion notebooks/dotHeatmap.ipynb
Original file line number Diff line number Diff line change
@@ -18,7 +18,8 @@
"plt.rcParams['pdf.fonttype']=42\n",
"sys.path.append(os.path.expanduser(\"~/Projects/Github/PyComplexHeatmap/\"))\n",
"import PyComplexHeatmap\n",
"from PyComplexHeatmap import *"
"from PyComplexHeatmap import *\n",
"use_pch_style() # or plt.style.use('default') to restore default style"
]
},
{
5 changes: 3 additions & 2 deletions notebooks/oncoPrint.ipynb
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@
"outputs": [],
"source": [
"import os,sys\n",
"import pandas as pd\n",
"%matplotlib inline\n",
"import matplotlib.pylab as plt\n",
"import pickle\n",
@@ -25,8 +26,8 @@
"plt.rcParams['font.sans-serif']='Arial'\n",
"plt.rcParams['pdf.fonttype']=42\n",
"# sys.path.append(os.path.expanduser(\"~/Projects/Github/PyComplexHeatmap/\"))\n",
"import PyComplexHeatmap\n",
"from PyComplexHeatmap import *"
"from PyComplexHeatmap import *\n",
"use_pch_style() # or plt.style.use('default') to restore default style"
]
},
{
1 change: 1 addition & 0 deletions notebooks/oncoPrint2.ipynb
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@
"import os,sys\n",
"# sys.path.append(os.path.expanduser(\"~/Projects/Github/PyComplexHeatmap/\"))\n",
"from PyComplexHeatmap import *\n",
"use_pch_style() # or plt.style.use('default') to restore default style\n",
"import pandas as pd\n",
"import random"
]
1 change: 1 addition & 0 deletions notebooks/single_cell_methylation.ipynb
Original file line number Diff line number Diff line change
@@ -34,6 +34,7 @@
"plt.rcParams['pdf.fonttype']=42\n",
"# sys.path.append(os.path.expanduser(\"~/Projects/Github/PyComplexHeatmap/\"))\n",
"import PyComplexHeatmap as pch\n",
"pch.use_pch_style() # or plt.style.use('default') to restore default style\n",
"print(pch.__version__)"
]
},

0 comments on commit 2458f71

Please sign in to comment.