Skip to content
Snippets Groups Projects
Commit d53a5eb9 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

plot curve with nan's

parent 09f40199
No related branches found
No related tags found
No related merge requests found
...@@ -300,7 +300,7 @@ namespace { ...@@ -300,7 +300,7 @@ namespace {
public: public:
double xd; // data point double xd; // data point
double yd; double yd;
int code; // 0=valid, 1=below, 2=above, 3=off_range int code; // -1=nan 0=valid, 1=below, 2=above, 3=off_range
CP2 P; // plot point CP2 P; // plot point
}; };
...@@ -311,7 +311,9 @@ namespace { ...@@ -311,7 +311,9 @@ namespace {
vector<CPt> ret(x.size()); vector<CPt> ret(x.size());
for (size_t i=0; i<x.size(); ++i) { for (size_t i=0; i<x.size(); ++i) {
double xp = plot->X.pc(x[i]); double xp = plot->X.pc(x[i]);
if (y[i]<plot->Y.inf) if (std::isnan(y[i]))
ret[i] = {x[i], y[i], 1, {xp, NAN}};
else if (y[i]<plot->Y.inf)
ret[i] = {x[i], y[i], 1, {xp, NAN}}; ret[i] = {x[i], y[i], 1, {xp, NAN}};
else if (y[i]>plot->Y.sup) else if (y[i]>plot->Y.sup)
ret[i] = {x[i], y[i], 2, {xp, NAN}}; ret[i] = {x[i], y[i], 2, {xp, NAN}};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment