I'm having an issue that I can't figure out. I wrote a script to parse out several text files and print 3D plots. It works perfectly if I only print one plot. However, when I step up the number of files up to two, it seems to print the same plot twice. When I step up the number of files to 5 or 6. It prints a few correctly, and a few incorrectly. I'm thinking that maybe there is some error in how Perl is opening GNUPlot. Please help!
Below is a my pseudo-code.
$Num_of_Files = 2; #Number of Files being read $Label[0] = "ABC"; $Label[1] = "DEF"; # Files to be read $file[0] = '/u/ABC.asc'; $file[1] = '/u/DEF.asc'; ## Read Files and Create Data for Plotting ## for ($i=0; $i<$Num_of_Files; $i++) { # Jump through each file open(Read, $file[$i]); @Read = <Read>; @Write3D = ""; foreach $part (@Read) { # Visit each text line in turn if ($part =~ /DATA/) { # Lines with Information to include $part =~ s/ /:/g; @Row = split(/:+/, $part); push(@Write3D, "$Row[1]\t"); push(@Write3D, "$Row[2]\t"); push(@Write3D, "$Row[3]\n"); } } writeFile_ref ("Data.txt", \@Write3D); # Creates data file close(Read); ## Opens GNUPlot and Creates Plots ## open(G, "|/usr/local/bin/gnuplot") or die "/usr/local/bin/gnuplot"; print G <<ENDOFHERE set term x11 set title '$Label[$i]' # Title for Graphs set nokey set output '$Label[$i] - PowerUp Seq 3D.png' splot 'Data.txt' using 1:2:3 with lines lw 2 ## 3D Plot ## unset logscale; ENDOFHERE }
Thanks in Advance!
In reply to Printing Multiple Plots by BoulderBuff64
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |