version 1.73, 2002/04/25 21:33:52
|
version 1.78, 2002/10/11 13:06:46
|
Line 112 my $words_test = sub {$_[0]=~s/\s+/
|
Line 112 my $words_test = sub {$_[0]=~s/\s+/
|
## ## |
## ## |
################################################################### |
################################################################### |
my @gnuplot_edit_order = |
my @gnuplot_edit_order = |
qw/alttag bgcolor fgcolor height width font transparent grid border align/; |
qw/alttag bgcolor fgcolor height width font transparent grid samples border align/; |
|
|
my $gnuplot_help_text = <<"ENDPLOTHELP"; |
my $gnuplot_help_text = <<"ENDPLOTHELP"; |
<p> |
<p> |
Line 208 my %gnuplot_defaults =
|
Line 208 my %gnuplot_defaults =
|
edit_type => 'choice', |
edit_type => 'choice', |
choices => ['small','medium','large'] |
choices => ['small','medium','large'] |
}, |
}, |
|
samples => { |
|
default => '100', |
|
test => $int_test, |
|
description => 'Number of samples for non-data plots', |
|
edit_type => 'choice', |
|
choices => ['100','200','500','1000','2000','5000'] |
|
}, |
align => { |
align => { |
default => 'center', |
default => 'center', |
test => sub {$_[0]=~/^(left|right|center)$/}, |
test => sub {$_[0]=~/^(left|right|center)$/}, |
Line 312 my %axis_defaults =
|
Line 319 my %axis_defaults =
|
color => { |
color => { |
default => 'x000000', |
default => 'x000000', |
test => $color_test, |
test => $color_test, |
description => 'color of axes (x000000)', |
description => 'color of grid lines (x000000)', |
edit_type => 'entry', |
edit_type => 'entry', |
size => '10' |
size => '10' |
}, |
}, |
Line 990 sub write_gnuplot_file {
|
Line 997 sub write_gnuplot_file {
|
# set output |
# set output |
$gnuplot_input .= "set output\n"; |
$gnuplot_input .= "set output\n"; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$gnuplot_input .= "set term postscript eps monochrome\n"; |
$gnuplot_input .= "set term postscript eps monochrome solid\n"; |
$gnuplot_input .= "set output \"/home/httpd/perl/tmp/". |
$gnuplot_input .= "set output \"/home/httpd/perl/tmp/". |
&Apache::lonnet::unescape($filename).".eps\"\n"; |
&Apache::lonnet::unescape($filename).".eps\"\n"; |
} |
} |
Line 1000 sub write_gnuplot_file {
|
Line 1007 sub write_gnuplot_file {
|
$gnuplot_input .= ($plot{'border'} eq 'on'? |
$gnuplot_input .= ($plot{'border'} eq 'on'? |
'set border'.$/ : |
'set border'.$/ : |
'set noborder'.$/ ); |
'set noborder'.$/ ); |
|
# sampling rate for non-data curves |
|
$gnuplot_input .= "set samples $plot{'samples'}\n"; |
# title, xlabel, ylabel |
# title, xlabel, ylabel |
# titles |
# titles |
$gnuplot_input .= "set title \"$title\"\n" if (defined($title)) ; |
$gnuplot_input .= "set title \"$title\"\n" if (defined($title)) ; |
Line 1041 sub write_gnuplot_file {
|
Line 1050 sub write_gnuplot_file {
|
$gnuplot_input .= 'set label "'.$label->{'text'}.'" at '. |
$gnuplot_input .= 'set label "'.$label->{'text'}.'" at '. |
$label->{'xpos'}.','.$label->{'ypos'}.' '.$label->{'justify'}.$/ ; |
$label->{'xpos'}.','.$label->{'ypos'}.' '.$label->{'justify'}.$/ ; |
} |
} |
|
if ($target eq 'tex') { |
|
$gnuplot_input .="set size 1,".$plot{'height'}/$plot{'width'}*1.38; |
|
$gnuplot_input .="\n"; |
|
} |
# curves |
# curves |
$gnuplot_input .= 'plot '; |
$gnuplot_input .= 'plot '; |
for (my $i = 0;$i<=$#curves;$i++) { |
for (my $i = 0;$i<=$#curves;$i++) { |