我在我的大學裏爲gnuplot編寫了一個腳本,並將數據帶到了我家裏的電腦中。 下面是相關代碼:Gnuplot gprintf()在新電腦上不工作
set terminal postscript eps enhanced color font 'Helvetica,20';
set encoding utf8;
do for[i=2:12] for[j in "3 4 6"]{
set autoscale x;
set xr[-3:3];
set autoscale y;
set key right bottom;
set terminal postscript eps color ;
set termoption dash;
set xlabel "bla";
set ylabel "bla";
set output 'home/Plots/test-'.i.'-'.j.'.eps';
plot 'home/Daten/test-'.i.'-'.j.'.dat' with lines lw 4 title gprintf("homogen q=%.3f",(1/(j-1)-1/(10*(j-1)))/2); }
的gprintf()犯規work..it只給了我0.00,但在我的UNI計算機它是正確的...幫助任何人:(
編輯: 我發現gnuplot的輪......當我在
gprintf("homogen q=%.3f",j)
鍵入它給了我q=3
爲J = 3.00
如果我使用:
gprintf("homogen q=%.3f",j/5)
它給了我q=0.00
它必須與gnuplot..because一個問題,正如我所說的,在其他計算機上,它的工作:/
你可能有整數除法,使用'1.0'等進行計算 – Christoph
感謝前面回答:)我很新的GNUPLOT ...你是什麼意思與「使用1.0等等。' ? – Martin
你是對的...如果我鍵入2/4它是零..如果我鍵入2.0/4它是0.5 ...但問題是,我不能這樣做爲j作爲一個變量...可以我改變它在gnuplotsettings本身? – Martin