version 1.121, 2007/08/03 05:56:00
|
version 1.124, 2007/08/03 06:08:06
|
Line 127 my $words_test = sub {$_[0]=~s/\s+/
|
Line 127 my $words_test = sub {$_[0]=~s/\s+/
|
## ## |
## ## |
################################################################### |
################################################################### |
my @gnuplot_edit_order = |
my @gnuplot_edit_order = |
qw/alttag bgcolor fgcolor height width fontface font transparent grid samples |
qw/alttag bgcolor fgcolor height width texwidth fontface font texfont |
border align texwidth texfont plotcolor plottype gridtype lmargin rmargin |
transparent grid samples |
|
border align plotcolor plottype gridtype lmargin rmargin |
tmargin bmargin major_ticscale minor_ticscale boxwidth gridlayer fillstyle |
tmargin bmargin major_ticscale minor_ticscale boxwidth gridlayer fillstyle |
pattern solid/; |
pattern solid/; |
|
|
Line 702 my %font_properties =
|
Line 703 my %font_properties =
|
); |
); |
|
|
sub get_font { |
sub get_font { |
|
my ($target) = @_; |
my ($size, $selected_font); |
my ($size, $selected_font); |
|
|
if ( $Apache::lonplot::plot{'font'} =~ /^(small|medium|large)/) { |
if ( $Apache::lonplot::plot{'font'} =~ /^(small|medium|large)/) { |
Line 716 sub get_font {
|
Line 718 sub get_font {
|
$size = '9'; |
$size = '9'; |
} |
} |
} else { |
} else { |
|
$size = $Apache::lonplot::plot{'font'}; |
$selected_font = $font_properties{$Apache::lonplot::plot{'fontface'}}; |
$selected_font = $font_properties{$Apache::lonplot::plot{'fontface'}}; |
} |
} |
|
if ($target eq 'tex' && defined($Apache::lonplot::plot{'texfont'})) { |
|
$size = $Apache::lonplot::plot{'texfont'}; |
|
} |
return ($size, $selected_font); |
return ($size, $selected_font); |
} |
} |
|
|
Line 1115 sub get_attributes{
|
Line 1121 sub get_attributes{
|
##------------------------------------------------------- write_gnuplot_file |
##------------------------------------------------------- write_gnuplot_file |
sub write_gnuplot_file { |
sub write_gnuplot_file { |
my ($tmpdir,$filename,$target)= @_; |
my ($tmpdir,$filename,$target)= @_; |
my ($fontsize, $font_properties) = &get_font(); |
my ($fontsize, $font_properties) = &get_font($target); |
my $gnuplot_input = ''; |
my $gnuplot_input = ''; |
my $curve; |
my $curve; |
my $pt = $Apache::lonplot::plot{'texfont'}; |
|
# |
# |
# Check to be sure we do not have any empty curves |
# Check to be sure we do not have any empty curves |
my @curvescopy; |
my @curvescopy; |
Line 1232 sub write_gnuplot_file {
|
Line 1237 sub write_gnuplot_file {
|
# title, xlabel, ylabel |
# title, xlabel, ylabel |
# titles |
# titles |
if ($target eq 'tex') { |
if ($target eq 'tex') { |
$gnuplot_input .= "set title \"$title\" font \"".$font_properties->{'printname'}.",".$pt."pt\"\n" if (defined($title)) ; |
$gnuplot_input .= "set title \"$title\" font \"".$font_properties->{'printname'}.",".$fontsize."pt\"\n" if (defined($title)) ; |
$gnuplot_input .= "set xlabel \"$xlabel\" font \"".$font_properties->{'printname'}.",".$pt."pt\"\n" if (defined($xlabel)); |
$gnuplot_input .= "set xlabel \"$xlabel\" font \"".$font_properties->{'printname'}.",".$fontsize."pt\"\n" if (defined($xlabel)); |
$gnuplot_input .= "set ylabel \"$ylabel\" font \"".$font_properties->{'printname'}.",".$pt."pt\"\n" if (defined($ylabel)); |
$gnuplot_input .= "set ylabel \"$ylabel\" font \"".$font_properties->{'printname'}.",".$fontsize."pt\"\n" if (defined($ylabel)); |
} else { |
} else { |
$gnuplot_input .= "set title \"$title\" \n" if (defined($title)) ; |
$gnuplot_input .= "set title \"$title\" \n" if (defined($title)) ; |
$gnuplot_input .= "set xlabel \"$xlabel\" \n" if (defined($xlabel)); |
$gnuplot_input .= "set xlabel \"$xlabel\" \n" if (defined($xlabel)); |
Line 1282 sub write_gnuplot_file {
|
Line 1287 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') { |
if ($target eq 'tex') { |
$gnuplot_input .=' font "'.$font_properties->{'printname'}.','.$pt.'pt"' ; |
$gnuplot_input .=' font "'.$font_properties->{'printname'}.','.$fontsize.'pt"' ; |
} |
} |
$gnuplot_input .= $/; |
$gnuplot_input .= $/; |
} |
} |