version 1.145, 2008/06/03 10:49:00
|
version 1.148.2.2, 2009/03/18 14:05:19
|
Line 496 my %axis_defaults =
|
Line 496 my %axis_defaults =
|
yformat => { |
yformat => { |
default => 'on', |
default => 'on', |
test => sub {$_[0]=~/^(on|off|\d+(f|F|e|E))$/}, |
test => sub {$_[0]=~/^(on|off|\d+(f|F|e|E))$/}, |
description => 'X-axis number formatting', |
description => 'Y-axis number formatting', |
edit_type => 'choice', |
edit_type => 'choice', |
choices => ['on', 'off', '2e', '2f'], |
choices => ['on', 'off', '2e', '2f'], |
}, |
}, |
Line 757 sub get_font {
|
Line 757 sub get_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'})) { |
if ($target eq 'tex' && defined($Apache::lonplot::plot{'texfont'})) { |
|
# $selected_font = $font_properties{'classic'}; |
$size = $Apache::lonplot::plot{'texfont'}; |
$size = $Apache::lonplot::plot{'texfont'}; |
} |
} |
return ($size, $selected_font); |
return ($size, $selected_font); |
Line 1361 sub start_function {
|
Line 1362 sub start_function {
|
my $function = &Apache::lonxml::get_all_text("/function",$parser, |
my $function = &Apache::lonxml::get_all_text("/function",$parser, |
$style); |
$style); |
$function = &Apache::run::evaluate($function,$safeeval,$$parstack[-1]); |
$function = &Apache::run::evaluate($function,$safeeval,$$parstack[-1]); |
|
$function=~s/\^/\*\*/gs; |
$curves[-1]->{'function'} = $function; |
$curves[-1]->{'function'} = $function; |
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
$result .= &Apache::edit::tag_start($target,$token,'Gnuplot compatible curve function'); |
$result .= &Apache::edit::tag_start($target,$token,'Gnuplot compatible curve function'); |
Line 1431 sub start_data {
|
Line 1433 sub start_data {
|
} |
} |
# complain if the number of data points is not the same as |
# complain if the number of data points is not the same as |
# in previous sets of data. |
# in previous sets of data. |
if (($curves[-1]->{'data'}) && ($#data != $#{@{$curves[-1]->{'data'}->[0]}})){ |
if (($curves[-1]->{'data'}) && ($#data != $#{$curves[-1]->{'data'}->[0]})){ |
&Apache::lonxml::warning |
&Apache::lonxml::warning |
('Number of data points is not consistent with previous '. |
('Number of data points is not consistent with previous '. |
'number of data points'); |
'number of data points'); |
Line 1675 sub write_gnuplot_file {
|
Line 1677 sub write_gnuplot_file {
|
$gnuplot_input .= ( $xtics{'mirror'} eq 'on'?"mirror ":"nomirror "); |
$gnuplot_input .= ( $xtics{'mirror'} eq 'on'?"mirror ":"nomirror "); |
$gnuplot_input .= "$xtics{'start'}, "; |
$gnuplot_input .= "$xtics{'start'}, "; |
$gnuplot_input .= "$xtics{'increment'}, "; |
$gnuplot_input .= "$xtics{'increment'}, "; |
$gnuplot_input .= "$xtics{'end'}\n"; |
$gnuplot_input .= "$xtics{'end'} "; |
|
if ($target eq 'tex') { |
|
$gnuplot_input .= 'font "Helvetica,22"'; # Needed in iso 8859-1 enc. |
|
} |
|
$gnuplot_input .= "\n"; |
if ($xtics{'minorfreq'} != 0) { |
if ($xtics{'minorfreq'} != 0) { |
$gnuplot_input .= "set mxtics ".$xtics{'minorfreq'}."\n"; |
$gnuplot_input .= "set mxtics ".$xtics{'minorfreq'}."\n"; |
} |
} |
|
} else { |
|
if ($target eq 'tex') { |
|
$gnuplot_input .= 'set xtics font "Helvetica,22"'."\n"; # needed in iso 8859-1 enc |
|
} |
} |
} |
if (%ytics) { |
if (%ytics) { |
$gnuplot_input .= "set ytics $ytics{'location'} "; |
$gnuplot_input .= "set ytics $ytics{'location'} "; |
$gnuplot_input .= ( $ytics{'mirror'} eq 'on'?"mirror ":"nomirror "); |
$gnuplot_input .= ( $ytics{'mirror'} eq 'on'?"mirror ":"nomirror "); |
$gnuplot_input .= "$ytics{'start'}, "; |
$gnuplot_input .= "$ytics{'start'}, "; |
$gnuplot_input .= "$ytics{'increment'}, "; |
$gnuplot_input .= "$ytics{'increment'}, "; |
$gnuplot_input .= "$ytics{'end'}\n"; |
$gnuplot_input .= "$ytics{'end'} "; |
|
if ($target eq 'tex') { |
|
$gnuplot_input .= 'font "Helvetica,22"'; # Needed in iso-8859-1 encoding. |
|
} |
|
$gnuplot_input .= "\n"; |
if ($ytics{'minorfreq'} != 0) { |
if ($ytics{'minorfreq'} != 0) { |
$gnuplot_input .= "set mytics ".$ytics{'minorfreq'}."\n"; |
$gnuplot_input .= "set mytics ".$ytics{'minorfreq'}."\n"; |
} |
} |
|
} else { |
|
if ($target eq 'tex') { |
|
$gnuplot_input .= 'set ytics font "Helvetica,22"'."\n"; # Needed for iso 8859-1 enc. |
|
} |
} |
} |
# axis |
# axis |
if (%axis) { |
if (%axis) { |