Dr. Arne JachensDr. Arne Jachens

php Library

plotResult

Keine Erläuterungen gefunden.

<?
function plotResult($path,$file,$Xmin,$Xmax,$Ymin,$Ymax,$Xlabel,$Ylabel){

  $SHfile=$file.".sh";
  $PDFfile=$file.".pdf";
  $PLOTfile=$file.".plot";
  $DATAfile=$file.".dat";

  $color[0]='green';
  $color[1]='green';
  $color[2]='blue';
  $color[3]='blue';
  $color[4]='dark-violet';
  $color[5]='dark-violet';
  $color[6]='grey';
  $color[7]='grey';
  $color[8]='red';
  $color[9]='red';
  $color[10]='dark-green';
  $color[11]='dark-green';
  $color[12]='cyan';
  $color[13]='cyan';
  $color[14]='orange';
  $color[15]='orange';
  $symbol[0]=7;   /*circle filled */
  $symbol[1]=6;   /*circle open */
  $symbol[2]=5;   /*square filled */
  $symbol[3]=4;   /*square open */
  $symbol[4]=13;  /*diamond filled */
  $symbol[5]=12;  /*diamond open */
  $symbol[6]=9;   /*triangle up filled */
  $symbol[7]=8;   /*triangle up open */
  $symbol[8]=3;   /*star */
  $symbol[9]=1;   /*plus */
  $symbol[10]=11; /*triangle down filled */
  $symbol[11]=10; /*triangle down open */
  $name[0]="SD";
  $name[1]="";
  $name[2]="MD";
  $name[3]="";
  $name[4]="ED";
  $name[5]="";
  $name[6]="FD";
  $name[7]="";
  $name[8]="MDh";
  $name[9]="";
  $name[10]="FDh";
  $name[11]="";

  printf("\nGnuPlot Help:\nhttp://t16web.lanl.gov/Kawano/gnuplot/index-e.html\n\n");

  $file=$path.$PLOTfile;
  $fid = fopen($file, "w");
  $GNUPLOTheader="set xlabel \"".$Xlabel."\"\n";
  $GNUPLOTheader.="set ylabel \"".$Ylabel."\"\n";
  $GNUPLOTheader.="set xrange [".$Xmin.":".$Xmax."]\n";
  $GNUPLOTheader.="set yrange [".$Ymin.":".$Ymax."]\n";
  $GNUPLOTheader.="set key left top\n";
  $GNUPLOTheader.="set term pdf\n";
  $GNUPLOTheader.="set output \"".$PDFfile."\"\n";
  fputs($fid,$GNUPLOTheader);

  for($n=0;$n<12;$n++){
    $string=sprintf("set style line %d lt 1 lc rgb %s lw 1 pt %d ps 1\n",$n+1,$color[$n],$symbol[$n]);
    fputs($fid,$string);
  } #n
  $string=sprintf("plot \"%s\" u 1:2  ti \"%s\" w lp linestyle 1",$DATAfile,$name[0]);
  fputs($fid,$string);
  for($n=1;$n<12;$n++){
    $string=sprintf(", \\\n \"%s\" u 1:%d  ti \"%s\" w lp linestyle %d",$DATAfile,$n+2,$name[$n],$n+1);
    fputs($fid,$string);
  } #n

  fclose($fid);




  $string="cd ".$path." && gnuplot ".$PLOTfile." && xpdf -z 200 ".$PDFfile."&";
  echo $string."\n";
  system($string);
}
?>

Index of Library

1globals.php
2readData.php
3XML_readFile.php
4fraktal.php
5fileGrep.php
6XML_extractTag.php
7writeNamedData.php
8readXmlFile.php
9readNamedData.php
10XML_findAllElements.php
11readFromStdIn.php
12plotResult.php
13dtaus.php
14pdf.php
15fitData.php
16XML_extractElement.php
17readFilenames.php
18writeData.php
19genDTAUS.php
20closeFigures.php
21XML_extractAttribute.php
22enumerateFiles.php
23db.php
24polynominalFit.php
25LaTeXbrief.php
26hex2dec.php

Der gesamte Sourcecode darf gemäß GNU General Public License weiterverbreitet werden.