Skip to content

Commit

Permalink
Bug fixed and moved to 0.6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Hideto Mori authored and Hideto Mori committed Dec 7, 2023
1 parent 29179c9 commit b6e87cd
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion patchworklib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from .patchworklib import *
__version__ = "0.6.3"
__version__ = "0.6.4"
9 changes: 8 additions & 1 deletion patchworklib/modified_plotnine.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,14 @@ def draw(self, return_ggplot=False, show: bool = False):
self._build()

# setup
figure, axs = self._create_figure()
#figure, axs = self._create_figure()
import matplotlib.pyplot as plt
figure = plt.figure()
axs = self.facet.make_axes(
figure, self.layout.layout, self.coordinates
)
self.figure = figure
self.axs = axs
self._setup_parameters()
self.theme.setup()
self.facet.strips.generate()
Expand Down
13 changes: 6 additions & 7 deletions patchworklib/patchworklib.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#warnings.simplefilter('ignore', SettingWithCopyWarning)
warnings.simplefilter('ignore')

__version__ = "0.6.3"
__version__ = "0.6.4"
_basefigure = plt.figure(figsize=(1,1))
_render = _basefigure.canvas.get_renderer()
_scale = Affine2D().scale(1./_basefigure.dpi)
Expand Down Expand Up @@ -211,7 +211,6 @@ def _reset_ggplot_legend(bricks):
pass

def overwrite_plotnine():
import plotnine
plotnine.ggplot.draw = mp9.draw

def load_ggplot(ggplot=None, figsize=None):
Expand Down Expand Up @@ -453,11 +452,8 @@ def draw_title(bricks, gori, gcp, figsize):
for ax in gori.axs:
gori.theme.themeables['plot_title'].apply(ax)

import plotnine
plotnine_version = plotnine.__version__
if StrictVersion(plotnine_version) >= StrictVersion("0.12"):
overwrite_plotnine()


#save_original_position
global _basefigure
global _axes_dict
Expand Down Expand Up @@ -3512,4 +3508,7 @@ def resize(self, direction):
#bricks2 = (brick2 | (brick5 / brick4)) / (brick1 | brick3)
ax21543 = (ax2 / ax1) | (ax5 / ax4 / ax3)
ax21543.savefig("test2.pdf")


if StrictVersion(plotnine.__version__) >= StrictVersion("0.12"):
overwrite_plotnine()

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
URL = 'https://github.com/ponnhide/patchworklib'
LICENSE = 'GNU General Public License v3.0'
DOWNLOAD_URL = 'https://github.com/ponnhide/patchworklib'
VERSION = '0.6.3'
VERSION = '0.6.4'
PYTHON_REQUIRES = ">=3.7"

INSTALL_REQUIRES = [
Expand Down

0 comments on commit b6e87cd

Please sign in to comment.