def graphOneSeries(self, configFiles, xVar, yVar, outputName): grapher = Grapher() fig, axes = grapher.simple2D(configFiles, "config", xVar, "state", yVar) grapher.setAxisLabels(axes, xVar, yVar) figurePath = os.path.join(self.path, outputName) grapher.saveFigure(fig, figurePath) return fig, axes
def graphOneSeries(self, configFiles, xVar, yVar, outputName): grapher = Grapher() fig, axes = grapher.simple2D(configFiles, "config", xVar, "state", yVar) grapher.setAxisLabels(axes, xVar, yVar) figurePath = os.path.join(self.path, outputName) grapher.saveFigure(fig, figurePath) return fig, axes
# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. import sys, os from Grapher import Grapher if len(sys.argv) < 2: print "usage: python test_Grapher.py path" sys.exit(1) path = sys.argv[1] configNames = ["test_grapher0", "test_grapher1", "test_grapher2"] fullConfigPaths = [os.path.join(path, config) for config in configNames] grapher = Grapher(fullConfigPaths) outputs = grapher.readOutputs() for dataSet in outputs: print (dataSet.getLatestVar("config", "x") + " : " + dataSet.getLatestVar("test_section", "y")) fig, axes = grapher.simple2D("config", "x", "test_section", "y") grapher.setAxisLabels(axes, "x", "y") figurePath = os.path.join(path, "testFig") grapher.saveFigure(fig, figurePath)
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. import sys, os from Grapher import Grapher if len(sys.argv) < 2: print "usage: python test_Grapher.py path" sys.exit(1) path = sys.argv[1] configNames = ["test_grapher0", "test_grapher1", "test_grapher2"] fullConfigPaths = [os.path.join(path, config) for config in configNames] grapher = Grapher(fullConfigPaths) outputs = grapher.readOutputs() for dataSet in outputs: print( dataSet.getLatestVar("config", "x") + " : " + dataSet.getLatestVar("test_section", "y")) fig, axes = grapher.simple2D("config", "x", "test_section", "y") grapher.setAxisLabels(axes, "x", "y") figurePath = os.path.join(path, "testFig") grapher.saveFigure(fig, figurePath)