Home » U++ Library support » ScatterDraw & ScatterCtrl » Entirely Null series is drawn as a random constant line
Re: Entirely Null series is drawn as a random constant line [message #56140 is a reply to message #56135] |
Sun, 31 January 2021 14:37 |
Maginor
Messages: 44 Registered: May 2019
|
Member |
|
|
If you don't settle on having gaps in the line as a default, it would be very good to have it as an option. As I said, I rely on that in my application.
I have attached the data as a csv. Note that it is around 10'000 lines, and only the last 2/3 of the indexes have y-data in them. The ones that don't have any y-data should be given a y value of Null when you parse them.
You can parse it using something like the below (Sorry for not being upp idiomatic)
std::vector<double> xs, ys;
std::ifstream infile("data.csv");
std::string line;
std::getline(infile, line); //ignore first line
while (std::getline(infile, line))
{
std::istringstream iss(line);
double x, y;
char c;
if (iss >> x)
{ xs.push_back(x); }
else break;
iss >> c; //eat the semicolon
if(iss >> y)
{ ys.push_back(y); }
else ys.push_back(Null);
}
infile.close();
Plot.AddSeries(xs.data(), ys.data(), xs.size());
-
Attachment: data.csv
(Size: 205.04KB, Downloaded 132 times)
|
|
|
|
|
Entirely Null series is drawn as a random constant line
By: Maginor on Wed, 27 January 2021 14:12
|
|
|
Re: Entirely Null series is drawn as a random constant line
By: koldo on Thu, 28 January 2021 09:23
|
|
|
Re: Entirely Null series is drawn as a random constant line
By: Maginor on Fri, 29 January 2021 13:53
|
|
|
Re: Entirely Null series is drawn as a random constant line
By: koldo on Sun, 31 January 2021 09:52
|
|
|
Re: Entirely Null series is drawn as a random constant line
By: Maginor on Sun, 31 January 2021 14:37
|
|
|
Re: Entirely Null series is drawn as a random constant line
By: koldo on Mon, 01 February 2021 11:21
|
|
|
Re: Entirely Null series is drawn as a random constant line
By: Maginor on Tue, 02 February 2021 10:29
|
|
|
Re: Entirely Null series is drawn as a random constant line
By: koldo on Tue, 02 February 2021 18:15
|
|
|
Re: Entirely Null series is drawn as a random constant line
By: koldo on Tue, 02 February 2021 19:12
|
|
|
Re: Entirely Null series is drawn as a random constant line
By: Maginor on Wed, 03 February 2021 11:02
|
|
|
Re: Entirely Null series is drawn as a random constant line
By: koldo on Wed, 03 February 2021 12:41
|
|
|
Re: Entirely Null series is drawn as a random constant line
By: Maginor on Mon, 15 February 2021 10:10
|
|
|
Re: Entirely Null series is drawn as a random constant line
By: koldo on Mon, 15 February 2021 18:04
|
Goto Forum:
Current Time: Fri Apr 26 07:00:38 CEST 2024
Total time taken to generate the page: 0.03737 seconds
|