Hi!
Can you tell me, how to pass a reference to the column in 2d vector to function with following declaration: void SetData( const std::vector<float> &xs,const std::vector<float> &ys);
This function is from wxMathPlot.
My vector's declaration looks like this:
vector<vector <double> > sekce(8);
vector<vector<time_t> > cas_t_all(8);
I would like to do something like this(doesn't work): plot->SetData( &(float)cas_t_all[1], &sekce[5]);
= pass second column of vector cas_t_all and fifth column of vector sekce to funkcion SetData(...). Issue here is also type casting - this I can avoid by my working code - see lower.
Current situation is that I have to copy whole column from vector cas_t_all to new vector xs and column from vector sekce to new vector ys:
std::vector<float> xs,ys;
for ( int i = 0; i < sekce[0].size(); i++ )
xs.push_back(cas_t_all[0][i]);
ys.assign(sekce[0].begin(),sekce[0].end());
plot->SetData( xs, ys);
Thanks in advance.
J.