diff --git a/Owlcat/Plotting.py b/Owlcat/Plotting.py index b20b824..24d2d71 100644 --- a/Owlcat/Plotting.py +++ b/Owlcat/Plotting.py @@ -202,8 +202,15 @@ def make_figure(self, keylist=None, suptitle=None, save=None, if suptitle: fig.suptitle(suptitle, y=ytitle, size=8) if save: - fig.savefig(save, papertype=papertype, dpi=dpi, - orientation='portrait' if not landscape else 'landscape') + dicokwargs = { + "dpi": dpi + } + # fix for matplotlib becoming stricter on papertype + if matplotlib.get_backend() == "ps": + dicokwargs["papertype"] = papertype + dicokwargs["orientation"] = 'portrait' if not landscape else 'landscape' + + fig.savefig(save, **dicokwargs) print("===> Wrote", save) return fig @@ -494,8 +501,14 @@ def make_figure(self, suptitle=None, save=None, xlabel=None, ylabel=None, if suptitle: fig.suptitle(suptitle, y=ytitle, size=10) if save: - fig.savefig(save, papertype=papertype, dpi=dpi, - orientation='portrait' if not landscape else 'landscape') + dicokwargs = { + "dpi": dpi + } + # fix for matplotlib becoming stricter on papertype + if matplotlib.get_backend() == "ps": + dicokwargs["papertype"] = papertype + dicokwargs["orientation"] = 'portrait' if not landscape else 'landscape' + fig.savefig(save, **dicokwargs) print("===> Wrote", save) return fig @@ -810,8 +823,15 @@ def plot_text(plt, lines): orientation = 'landscape' else: orientation = 'portrait' if figsize[0] < figsize[1] else 'landscape' - fig.savefig(save, papertype=self.options.papertype, dpi=self.options.dpi, - orientation=orientation) + dicokwargs = { + "dpi": self.options.dpi + } + # fix for matplotlib becoming stricter on papertype + if matplotlib.get_backend() == "ps": + dicokwargs["papertype"] = self.options.papertype + dicokwargs["orientation"] = orientation + + fig.savefig(save, **dicokwargs) print("Wrote", save, "in", orientation, "orientation") fig = None pyplot.close("all") @@ -965,8 +985,15 @@ def make_figure(self, ll, mm, orientation = 'landscape' else: orientation = 'portrait' if figsize[0] < figsize[1] else 'landscape' - fig.savefig(save, papertype=self.options.papertype, dpi=self.options.dpi, - orientation=orientation) + dicokwargs = { + "dpi": self.options.dpi + } + # fix for matplotlib becoming stricter on papertype + if matplotlib.get_backend() == "ps": + dicokwargs["papertype"] = self.options.papertype + dicokwargs["orientation"] = orientation + + fig.savefig(save, **dicokwargs) print("Wrote", save, "in", orientation, "orientation") fig = None pyplot.close("all") @@ -1137,8 +1164,15 @@ def utc2lst(utc): orientation = 'landscape' else: orientation = 'portrait' if figsize[0] < figsize[1] else 'landscape' - fig.savefig(save, papertype=self.options.papertype, dpi=self.options.dpi, - orientation=orientation) + dicokwargs = { + "dpi": self.options.dpi + } + # fix for matplotlib becoming stricter on papertype + if matplotlib.get_backend() == "ps": + dicokwargs["papertype"] = self.options.papertype + dicokwargs["orientation"] = orientation + + fig.savefig(save, **dicokwargs) print("Wrote", save, "in", orientation, "orientation") fig = None pyplot.close("all") diff --git a/setup.py b/setup.py index 5af45c7..a32246c 100755 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ ] setup(name='owlcat', - version='1.7.8.3', + version='1.7.8.4', python_requires='>=3.6.0', description='miscellaneous utility scripts for manipulating radio interferometry data', author='Oleg Smirnov',