#!/usr/bin/perl
$FILE_NAME = $ARGV[0];
open(h2,">dc.txt");
$i=0; $j=1;
open(SearchFile, "$FILE_NAME");
while(<SearchFile>){
chop $_;
if ($i=="0") {
@x=split(",",$_);
print "first";
}
if($i!="0") {
@y=split(",",$_);
for($j=0; $j<29; $j++) {
print h2 "@x[$j] @y[$j] \n";
}
close (h2);
rename("dc.txt","dc_current_$i");
open(h2,">dc.txt");
}
$i++;
}
close (h2);
############## gnuplot ####################
#!/usr/bin/gnuplot
plot [0.4:0.6] "orig25" using 1:2 with linespoints title "TSMC", "aps" using 1:2 with linespoints title "wo APS", "conservative" using 1:2 with linespoints title "conservative"
pause mouse "click any mouse button on selected data point"
2019年10月27日 星期日
2019年10月23日 星期三
Plot 3d dc_current
#!/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"
$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"
訂閱:
文章 (Atom)
標籤
- 大盤 (6)
- 未分類資料夾 (2)
- 英文 (28)
- 書刊雜誌 (11)
- Perl (25)
- TCL (10)
- Uncategoried (1)
- UNIX Linux (43)