#!/usr/bin/perl
$FILE_NAME = $ARGV[0];
open(h2,">dc.txt");
$i=0; $j=1; $x_count=0;
open(SearchFile, "$FILE_NAME");
while(<SearchFile>) {
chop $_;
s/"//g;
s/\(//g;
s/\)//g;
s/index_1//g;
s/index_2//g;
s/;//g;
s/, \\//g;
s/\\//g;
if($i=="0"){
@x=split(",",$_);
print "x axis";
}
if($i=="1"){
@y=split(",",$_);
print "y axis";
}
if($i>"1"){
@z=split(",",$_);
for($j=0; $j<29; $j++){
print h2 "@x[$x_count] @y[$j] @z[$j] \n";
}
$x_count++;
}
$i++;
}
close (h2);
rename("dc.txt","3d_dc_current");
system "gnuplot plot3d.gp 3d_dc_current"
####### plot3d.gp #######
set xlabel "index_1"; set ylabel "index_2"; set zlabel "current"
set dgrid3d 29,29
#set hidden3d
set pm3d; set palette
splot '3d_dc_current' u 1:2:3 with line
pause mouse keypress "type"
沒有留言:
張貼留言