##// END OF EJS Templates
Implemented MultiComponent TS initial plot auto-scale...
jeandet -
r1436:0e6970dac555
parent child
Show More
@@ -269,14 +269,11 struct PlottablesUpdater<T,
269 double minValue = 0., maxValue = 0.;
269 double minValue = 0., maxValue = 0.;
270 if (auto serie = dynamic_cast<MultiComponentTimeSerie*>(&dataSeries))
270 if (auto serie = dynamic_cast<MultiComponentTimeSerie*>(&dataSeries))
271 {
271 {
272 // TODO
272 std::for_each(
273 // std::for_each(
273 std::begin(*serie), std::end(*serie), [&minValue, &maxValue](const auto& v) {
274 // std::begin(*serie), std::end(*serie), [&minValue, &maxValue](const
274 minValue = std::min( minValue, std::min_element(v.begin(), v.end())->v() );
275 // auto& v) {
275 maxValue = std::max( maxValue, std::max_element(v.begin(), v.end())->v() );
276 // minValue = std::min({ minValue,
276 });
277 // std::min_element(v.begin(),v.end()) }); maxValue = std::max({
278 // maxValue, std::max_element(v.begin(),v.end()) });
279 // });
280 }
277 }
281
278
282 plot.yAxis->setRange(QCPRange { minValue, maxValue });
279 plot.yAxis->setRange(QCPRange { minValue, maxValue });
@@ -12,16 +12,16 def make_scalar(x):
12 return pysciqlopcore.ScalarTimeSerie(x,y)
12 return pysciqlopcore.ScalarTimeSerie(x,y)
13
13
14 def make_vector(x):
14 def make_vector(x):
15 v=np.ones((3,len(x)))
15 v=np.ones((len(x),3))
16 for i in range(3):
16 for i in range(3):
17 v[:][i] = np.cos(x/10. + float(i))
17 v.transpose()[:][i] = np.cos(x/10. + float(i))
18 return pysciqlopcore.VectorTimeSerie(x,v)
18 return pysciqlopcore.VectorTimeSerie(x,v)
19
19
20
20
21 def make_multicomponent(x):
21 def make_multicomponent(x):
22 v=np.ones((4,len(x)))
22 v=np.ones((len(x),4))
23 for i in range(4):
23 for i in range(4):
24 v[:][i] = float(i+1) * np.cos(x/10. + float(i))
24 v.transpose()[:][i] = float(i+1) * np.cos(x/10. + float(i))
25 return pysciqlopcore.MultiComponentTimeSerie(x,v)
25 return pysciqlopcore.MultiComponentTimeSerie(x,v)
26
26
27
27
General Comments 0
You need to be logged in to leave comments. Login now