Hello I wrote my plot file, named sftest.plt, as below (Gnuplot version: 5.2.4):
set grid
set autoscale
set datafile separator ','
set title 'My title'
set xlabel 'Index'
set ylabel 'Units (see labels box)'
set style data steps
set pointsize 0.2
unset logscale
set yrange [0:100]
set xrange [*:*]
set term push
plot\
'sftest.csv' u ($1 - 0):($2) title 'data1' with steps,\
'sftest.csv' u ($1 - 0):($3/10) title 'data2' with steps,\
'sftest.csv' u ($1 - 0):(($4)<<2) title 'data3' with steps
set term pop
pause -1
when I run as "gnuplot sftest.plt".
It prompted " bit shift applied to non-INT"
but if I changed the line below:
'sftest.csv' u ($1 - 0):(($4)<<2) title 'data3' with steps
to :
'sftest.csv' u ($1 - 0):(($4)*2) title 'data3' with steps
It workls well.
Does someone know if the bitwise( &, |, >>, << ) can be used with "using" keyword?
If the bitwise cannot be used, I have to preprocess my data file.
gnuplot reads data files strictly as floating-point data. That's why you can't apply integer-only operators to it. But you don't have to modify the data, either. << can always be replaced by multiplication (by 1 << operand, if you must), or you can change the data type using the int() funcction.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you Hans, but I really want to get some defined bit. and I do not want to use multipication or division method to replance the bit shift.
and I triedint() function. It still does not work.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The remaining problem now is the first line of your data file. Suffice it to say thatint(data3) << 4 does not make much sense, does it?
You may want to consult 'help data skip' and/or 'help key autotitle' about what to do with that line, other than just comment it out or not generate it in the first place.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello Hans:
Thank you so much. Yes, you are right. the issue casued by the first line. But I don't know why other oprands( such as +, - ,* , /) work well for the first line except bitwise( shift, and, or ) .
Now the question comes to 'help data skip' and/or 'help key autotitle' about what to do with that line, other than just comment it out or not generate it in the first place.
I will try to resolve this problem by myself at first. If I am blocked with this, I will come here again.
Thank you again!
Last edit: Zhang Kuang 2018-08-24
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello I wrote my plot file, named sftest.plt, as below (Gnuplot version: 5.2.4):
when I run as "gnuplot sftest.plt".
It prompted " bit shift applied to non-INT"
but if I changed the line below:
'sftest.csv' u ($1 - 0):(($4)<<2) title 'data3' with steps
to :
'sftest.csv' u ($1 - 0):(($4)*2) title 'data3' with steps
It workls well.
Does someone know if the bitwise( &, |, >>, << ) can be used with "using" keyword?
If the bitwise cannot be used, I have to preprocess my data file.
part of my data file "sftest.csv"
[edited for readability-- HBB]
Last edit: Hans-Bernhard Broeker 2018-08-22
gnuplot reads data files strictly as floating-point data. That's why you can't apply integer-only operators to it. But you don't have to modify the data, either.
<<
can always be replaced by multiplication (by1 << operand
, if you must), or you can change the data type using theint()
funcction.Thank you Hans, but I really want to get some defined bit. and I do not want to use multipication or division method to replance the bit shift.
and I tried
int()
function. It still does not work.Hello again :)
I attached my test files. Could you please try it?
My Gnuplot version is 5.2.4 on Windows 7
The remaining problem now is the first line of your data file. Suffice it to say that
int(data3) << 4
does not make much sense, does it?You may want to consult 'help data skip' and/or 'help key autotitle' about what to do with that line, other than just comment it out or not generate it in the first place.
Hello Hans:
Thank you so much. Yes, you are right. the issue casued by the first line. But I don't know why other oprands( such as
+, - ,* , /
) work well for the first line except bitwise( shift, and, or ) .Now the question comes to 'help data skip' and/or 'help key autotitle' about what to do with that line, other than just comment it out or not generate it in the first place.
I will try to resolve this problem by myself at first. If I am blocked with this, I will come here again.
Thank you again!
Last edit: Zhang Kuang 2018-08-24