version 1.69, 2002/04/25 17:25:36
|
version 1.72, 2002/04/25 20:39:50
|
Line 498 sub end_gnuplot {
|
Line 498 sub end_gnuplot {
|
alt = "$plot{'alttag'}" /> |
alt = "$plot{'alttag'}" /> |
ENDIMAGE |
ENDIMAGE |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
&Apache::lonnet::ssi("/cgi-bin/plot.gif?file=$filename&output=eps"); |
&Apache::lonnet::ssi("/cgi-bin/plot.gif?file=$filename.data&output=eps"); |
$result = '\\\\ \graphicspath{/home/httpd/perl/tmp/}\fbox{\includegraphics[width=9.0 cm]{'.&Apache::lonnet::unescape($filename).'.eps}} \\\\'; |
$result = '\\\\ \graphicspath{/home/httpd/perl/tmp/}\fbox{\includegraphics[width=9.0 cm]{'.&Apache::lonnet::unescape($filename).'.eps}} \\\\'; |
} |
} |
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
Line 1050 sub write_gnuplot_file {
|
Line 1050 sub write_gnuplot_file {
|
$gnuplot_input.= |
$gnuplot_input.= |
$curve->{'function'}.' title "'. |
$curve->{'function'}.' title "'. |
$curve->{'name'}.'" with '. |
$curve->{'name'}.'" with '. |
$curve->{'linestyle'}; |
$curve->{'linestyle'}; |
# |
$gnuplot_input.= ' linewidth 2 ' if ($target eq 'tex'); |
# gnuplot's term=gif driver does not handle linewidths :( |
|
# . ' linewidth '. $curve->{'linewidth'}; |
|
# |
|
if (($curve->{'linestyle'} eq 'points') || |
if (($curve->{'linestyle'} eq 'points') || |
($curve->{'linestyle'} eq 'linespoints') || |
($curve->{'linestyle'} eq 'linespoints') || |
($curve->{'linestyle'} eq 'errorbars') || |
($curve->{'linestyle'} eq 'errorbars') || |
Line 1068 sub write_gnuplot_file {
|
Line 1065 sub write_gnuplot_file {
|
# Store data values in $datatext |
# Store data values in $datatext |
my $datatext = ''; |
my $datatext = ''; |
# get new filename |
# get new filename |
my $datafilename = "$tmpdir/$filename.$i"; |
my $datafilename = "$tmpdir/$filename.data.$i"; |
my $fh=Apache::File->new(">$datafilename"); |
my $fh=Apache::File->new(">$datafilename"); |
# Compile data |
# Compile data |
my @Data = @{$curve->{'data'}}; |
my @Data = @{$curve->{'data'}}; |
Line 1087 sub write_gnuplot_file {
|
Line 1084 sub write_gnuplot_file {
|
$gnuplot_input.= '"'.$datafilename.'" title "'. |
$gnuplot_input.= '"'.$datafilename.'" title "'. |
$curve->{'name'}.'" with '. |
$curve->{'name'}.'" with '. |
$curve->{'linestyle'}; |
$curve->{'linestyle'}; |
|
$gnuplot_input.= ' linewidth 2 ' if ($target eq 'tex'); |
if (($curve->{'linestyle'} eq 'points') || |
if (($curve->{'linestyle'} eq 'points') || |
($curve->{'linestyle'} eq 'linespoints') || |
($curve->{'linestyle'} eq 'linespoints') || |
($curve->{'linestyle'} eq 'errorbars') || |
($curve->{'linestyle'} eq 'errorbars') || |
Line 1099 sub write_gnuplot_file {
|
Line 1097 sub write_gnuplot_file {
|
} |
} |
} |
} |
# Write the output to a file. |
# Write the output to a file. |
my $fh=Apache::File->new(">$tmpdir$filename"); |
my $fh=Apache::File->new(">$tmpdir$filename.data"); |
print $fh $gnuplot_input; |
print $fh $gnuplot_input; |
close($fh); |
close($fh); |
# That's all folks. |
# That's all folks. |