Limits correction back in place with KSI unit system

This commit is contained in:
Jean-Julien Fleck
2014-08-26 23:42:18 +02:00
parent cc2e9910d0
commit 5d24d83ad6
2 changed files with 5 additions and 3 deletions

View File

@@ -166,8 +166,6 @@ class BasePlot(object):
the keys 'kmax', 'label' and 'opts', those can be used for plotting
as well.
"""
print(self)
print(self.unit_system)
if not kind.upper() in ['T', 'P']:
raise ValueError(''.join(["Invalid input for determining the ",
"saturation lines... Expected either ",
@@ -190,7 +188,6 @@ class BasePlot(object):
kind, sat_mesh)
if self.unit_system == 'KSI':
print("got here")
x_vals *= self.KSI_SCALE_FACTOR[self.graph_type[1]]
y_vals *= self.KSI_SCALE_FACTOR[self.graph_type[0]]

View File

@@ -247,6 +247,11 @@ class IsoLines(BasePlot):
limits[0][1] = min([limits[0][1], max(self.axis.get_xlim())])
limits[1][0] = max([limits[1][0], min(self.axis.get_ylim())])
limits[1][1] = min([limits[1][1], max(self.axis.get_ylim())])
# Limits correction in case of KSI unit_system
if self.unit_system == 'KSI':
limits[0] = [l*self.KSI_SCALE_FACTOR[self.graph_type[1]] for l in limits[0]]
limits[1] = [l*self.KSI_SCALE_FACTOR[self.graph_type[0]] for l in limits[1]]
self.axis.set_xlim(limits[0])
self.axis.set_ylim(limits[1])