version 1.152, 2009/11/14 19:13:36
|
version 1.153, 2011/07/04 09:25:13
|
Line 634 sub end_gnuplot {
|
Line 634 sub end_gnuplot {
|
('title','xlabel','ylabel','key','axis','label','curve')); |
('title','xlabel','ylabel','key','axis','label','curve')); |
my $result = ''; |
my $result = ''; |
my $randnumber; |
my $randnumber; |
|
my $tmpdir =LONCAPA::tempdir(); # Where temporary files live: |
|
|
# need to call rand everytime start_script would evaluate, as the |
# need to call rand everytime start_script would evaluate, as the |
# safe space rand number generator and the global rand generator |
# safe space rand number generator and the global rand generator |
# are not separate |
# are not separate |
Line 645 sub end_gnuplot {
|
Line 647 sub end_gnuplot {
|
&check_inputs(); # Make sure we have all the data we need |
&check_inputs(); # Make sure we have all the data we need |
## |
## |
## Determine filename |
## Determine filename |
my $tmpdir = '/home/httpd/perl/tmp/'; |
|
my $filename = $env{'user.name'}.'_'.$env{'user.domain'}. |
my $filename = $env{'user.name'}.'_'.$env{'user.domain'}. |
'_'.time.'_'.$$.$randnumber.'_plot'; |
'_'.time.'_'.$$.$randnumber.'_plot'; |
## Write the plot description to the file |
## Write the plot description to the file |
Line 666 ENDIMAGE
|
Line 667 ENDIMAGE
|
#might be inside the safe space, register the URL for later |
#might be inside the safe space, register the URL for later |
&Apache::lonxml::register_ssi("/cgi-bin/plot.gif?file=$filename.data&output=eps"); |
&Apache::lonxml::register_ssi("/cgi-bin/plot.gif?file=$filename.data&output=eps"); |
$result = "%DYNAMICIMAGE:$Apache::lonplot::plot{'width'}:$Apache::lonplot::plot{'height'}:$Apache::lonplot::plot{'texwidth'}\n"; |
$result = "%DYNAMICIMAGE:$Apache::lonplot::plot{'width'}:$Apache::lonplot::plot{'height'}:$Apache::lonplot::plot{'texwidth'}\n"; |
$result .= '\graphicspath{{/home/httpd/perl/tmp/}}'."\n"; |
$result .= '\graphicspath{{'.$tmpdir.'}}'."\n"; |
$result .= '\includegraphics[width='.$Apache::lonplot::plot{'texwidth'}.' mm]{'.&unescape($filename).'.eps}'; |
$result .= '\includegraphics[width='.$Apache::lonplot::plot{'texwidth'}.' mm]{'.&unescape($filename).'.eps}'; |
} |
} |
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
Line 1609 sub write_gnuplot_file {
|
Line 1610 sub write_gnuplot_file {
|
} |
} |
$gnuplot_input .= ' "'.$font_properties->{'printname'}.'" '; |
$gnuplot_input .= ' "'.$font_properties->{'printname'}.'" '; |
$gnuplot_input .= $fontsize; |
$gnuplot_input .= $fontsize; |
$gnuplot_input .= "\nset output \"/home/httpd/perl/tmp/". |
$gnuplot_input .= "\nset output \"".$tmpdir. |
&unescape($filename).".eps\"\n"; |
&unescape($filename).".eps\"\n"; |
$gnuplot_input .= "set encoding iso_8859_1\n"; # Get access to extended font. |
$gnuplot_input .= "set encoding iso_8859_1\n"; # Get access to extended font. |
|
|