Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def plot(self, *args, **kwargs):
"""Call Function.plot1D if Function is 1-Dimensional or call
Function.plot2D if Function is 2-Dimensional and forward arguments
and key-word arguments."""
if isinstance(self, list):
# Compare multiple plots
Function.comparePlots(self)
else:
if self.__domDim__ == 1:
self.plot1D(*args, **kwargs)
elif self.__domDim__ == 2:
self.plot2D(*args, **kwargs)
else:
print("Error: Only functions with 1D or 2D domains are plottable!")