最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Is there a way to obtain GPVAL_DATA_X_MIN, X_MAX, Y_MIN & Y_MAX from a plot, ignoring NaN values in gnuplot? - Stack Ove

programmeradmin5浏览0评论

I've got a datafile with NaNs. The plot is ok, but when I try to get GPVAL_DATA_Y_MIN I obtain 0.0 while the minimum value is in fact 420.0; when I substitute the NaNs by random numbers, then I get the right minimum, namely 420.0; so all I need is to enforce gnuplot to ignore NaNs when evaluating GPVAL_DATA_Y_MIN... is it possible ?

1.3    455.2
1.7    645.6
2.0    420.0
2.2    NaN
2.8    498.5

I've got a datafile with NaNs. The plot is ok, but when I try to get GPVAL_DATA_Y_MIN I obtain 0.0 while the minimum value is in fact 420.0; when I substitute the NaNs by random numbers, then I get the right minimum, namely 420.0; so all I need is to enforce gnuplot to ignore NaNs when evaluating GPVAL_DATA_Y_MIN... is it possible ?

1.3    455.2
1.7    645.6
2.0    420.0
2.2    NaN
2.8    498.5
Share Improve this question asked Mar 23 at 2:22 ifffamifffam 1879 bronze badges 3
  • What is your gnuplot version? Please post the complete (minimized) script to reproduce this issue. So far, I couldn't reproduce it with gnuplot>=5.0 – theozh Commented Mar 23 at 8:47
  • With a extremely minimized version, the NaN value is in fact ignored and I retrieve the right y min value... odd... with my full version I get the right y min value only if I replace NaN by a number... otherwise I get zero... I'll have to check out both my script and my datafile and... waste time :( – ifffam Commented Mar 23 at 16:34
  • so, I assume you must have some other settings in your extended script, which might make GPVAL_DATA_Y_MIN=0.0. Without having your script it's difficult to make any tests and conclusions. – theozh Commented Mar 24 at 8:50
Add a comment  | 

1 Answer 1

Reset to default 0

Just add

set datafile missing NaN

at the beginning of the script and fet about everything :)

Granted, you'll not get into the deepness of the mystery, but life moves on, time is money and much more :)

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论