cont.plotCurveFromTable(t, y_col_index=2, append=True)
self.assertTrue(self.areScreenshotEqual(tw))
+ @runOnly
def testSettingsCurveColor(self):
tw = self.showTabWidget()
x, y = self.generateSine()
self.assertEqual(psID0, psID2)
l, _ = PlotController.GetAllPlotSets()
self.assertEqual(1, len(l))
-
+
+ def testAddBarplot(self):
+ import numpy as np
+ tw = self.showTabWidget()
+ barplotTicks = np.array([0., 1, 2, 4, 8, 9, 11, 14, 14.6])
+ barplotHeight = np.array([3, 2, 1.2, 7, 4, 3, 1, 4.3])
+ PlotController.AddBarPlot(barplotTicks, barplotHeight,
+ x_label="Energï", y_label="Intënsîty", append=False)
+ self.assertTrue(self.areScreenshotEqual(tw))
+
+ def testAddStemplot(self):
+ x, y = self.generateSine()
+ tw = self.showTabWidget()
+ PlotController.AddStemPlot(x, y, curve_label="My stem",
+ x_label="Lèés X (unicode!)", y_label="Et des ŷ", append=False)
+ self.assertTrue(self.areScreenshotEqual(tw))
+
+ def testSelectedBarplot(self):
+ import numpy as np
+ tw = self.showTabWidget()
+ barplotTicks = np.array([0., 10, 20, 40, 80, 90, 110, 140, 146])
+ barplotHeight = np.array([3, 2, 1.2, 7, 4, 3, 1, 4.3])
+ crvId, psId = PlotController.AddBarPlot(barplotTicks, barplotHeight,
+ x_label="Energï", y_label="Intënsîty", append=False)
+ x, y = self.generateSine()
+ PlotController.AddStemPlot(x, y, curve_label="My stem",
+ x_label="Lèés X (unicode!)", y_label="Et des ŷ", append=True)
+
+ PlotController.SetCurrentCurve(crvId)
+ self.assertTrue(self.areScreenshotEqual(tw))
+
+ def testShowOnlySelected(self):
+ import numpy as np
+ tw = self.showTabWidget()
+ barplotTicks = np.array([0., 10, 20, 40, 80, 90, 110, 140, 146])
+ barplotHeight = np.array([3, 2, 1.2, 7, 4, 3, 1, 4.3])
+ PlotController.AddBarPlot(barplotTicks, barplotHeight,
+ x_label="Energï", y_label="Intënsîty", append=False)
+ x, y = self.generateSine()
+ crvId, psId = PlotController.AddStemPlot(x, y, curve_label="My stem",
+ x_label="Lèés X (unicode!)", y_label="Et des ŷ", append=True)
+
+ PlotController.SetCurrentCurve(crvId)
+ PlotController.ShowOnlySelected(psId)
+ self.assertTrue(self.areScreenshotEqual(tw))
+
+ def testShowAll(self):
+ import numpy as np
+ tw = self.showTabWidget()
+ barplotTicks = np.array([0., 10, 20, 40, 80, 90, 110, 140, 146])
+ barplotHeight = np.array([3, 2, 1.2, 7, 4, 3, 1, 4.3])
+ PlotController.AddBarPlot(barplotTicks, barplotHeight,
+ x_label="Energï", y_label="Intënsîty", append=False)
+ x, y = self.generateSine()
+ crvId, psId = PlotController.AddStemPlot(x, y, curve_label="My stem",
+ x_label="Lèés X (unicode!)", y_label="Et des ŷ", append=True)
+
+ PlotController.SetCurrentCurve(crvId)
+ PlotController.ShowAll(psId)
+ self.assertTrue(self.areScreenshotEqual(tw))
+
# Even if not in main:
processDecorator(__name__)