tadd plot style parameter - sphere - GPU-based 3D discrete element method algor… | |
git clone git://src.adamsgaard.dk/sphere | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 100a2ecc575361494f17b4b1ad76ffc9c44e30f5 | |
parent c68bfc0b3496e60ec7ce3a399f621986cf425098 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Tue, 20 Jan 2015 11:51:10 +0100 | |
add plot style parameter | |
Diffstat: | |
M python/sphere.py | 9 +++++++-- | |
1 file changed, 7 insertions(+), 2 deletions(-) | |
--- | |
diff --git a/python/sphere.py b/python/sphere.py | |
t@@ -5179,6 +5179,7 @@ class sim: | |
def plotSinFunction(self, | |
baseval, A, f, phi = 0.0, | |
xlabel = '$t$ [s]', ylabel = '$y$', | |
+ plotstyle = '.', | |
outformat = 'png'): | |
''' | |
Plot the values of a sinusoidal modulated base value. Saves the output | |
t@@ -5197,13 +5198,17 @@ class sim: | |
:type xlabel: str | |
:param ylabel: The label for the y axis | |
:type ylabel: str | |
+ :param plotstyle: Matplotlib-string for specifying plotting style | |
+ :type plotstyle: str | |
:param outformat: File format of the output plot | |
:type outformat: str | |
''' | |
fig = plt.figure(figsize=[8,6]) | |
- t = numpy.linspace(self.time_current[0], self.time_total[0]) | |
+ steps_left = (self.time_total[0] - self.time_current[0]) \ | |
+ /self.time_file_dt[0] | |
+ t = numpy.linspace(self.time_current[0], self.time_total[0], steps_lef… | |
f = A*numpy.sin(2.0*numpy.pi*f*t + phi) | |
- plt.plot(t, f) | |
+ plt.plot(t, f, plotstyle) | |
plt.xlabel(xlabel) | |
plt.ylabel(ylabel) | |
filename = self.sid + '-sin.' + outformat |