version 1.163, 2012/07/24 10:50:54
|
version 1.167, 2012/10/07 15:04:44
|
Line 132 my $real_test =
|
Line 132 my $real_test =
|
sub {$_[0]=~s/\s+//g;$_[0]=~/^[+-]?\d*\.?\d*([eE][+-]\d+)?$/}; |
sub {$_[0]=~s/\s+//g;$_[0]=~/^[+-]?\d*\.?\d*([eE][+-]\d+)?$/}; |
my $pos_real_test = |
my $pos_real_test = |
sub {$_[0]=~s/\s+//g;$_[0]=~/^[+]?\d*\.?\d*([eE][+-]\d+)?$/}; |
sub {$_[0]=~s/\s+//g;$_[0]=~/^[+]?\d*\.?\d*([eE][+-]\d+)?$/}; |
my $color_test = sub {$_[0]=~s/\s+//g;$_[0]=~/^x[\da-fA-F]{6}$/}; |
my $color_test; |
|
if ($version < 4.6) { |
|
$color_test = sub {$_[0]=~s/\s+//g;$_[0]=~s/^\#/x/;$_[0]=~/^x[\da-fA-F]{6}$/}; |
|
} else { |
|
$color_test = sub {$_[0]=~s/\s+//g;$_[0]=~s/^x/#/;$_[0]=~/^\#[\da-fA-F]{6}$/}; |
|
} |
my $onoff_test = sub {$_[0]=~/^(on|off)$/}; |
my $onoff_test = sub {$_[0]=~/^(on|off)$/}; |
my $key_pos_test = sub {$_[0]=~/^(top|bottom|right|left|outside|below| )+$/}; |
my $key_pos_test = sub {$_[0]=~/^(top|bottom|right|left|outside|below| )+$/}; |
my $sml_test = sub {$_[0]=~/^(\d+|small|medium|large)$/}; |
my $sml_test = sub {$_[0]=~/^(\d+|small|medium|large)$/}; |
Line 463 my %tic_defaults =
|
Line 468 my %tic_defaults =
|
description => 'Number of minor tics per major tic mark', |
description => 'Number of minor tics per major tic mark', |
edit_type => 'entry', |
edit_type => 'entry', |
size => '10' |
size => '10' |
}, |
}, |
|
rotate => { |
|
default => 'off', |
|
test => $onoff_test, |
|
description => 'Rotate tic label by 90 degrees if on', |
|
edit_type => 'onoff' |
|
} |
); |
); |
|
|
my @axis_edit_order = ('color','xmin','xmax','ymin','ymax','xformat', 'yformat', 'xzero', 'yzero'); |
my @axis_edit_order = ('color','xmin','xmax','ymin','ymax','xformat', 'yformat', 'xzero', 'yzero'); |
Line 1714 sub generate_tics {
|
Line 1725 sub generate_tics {
|
|
|
$result .= "set $type $spec->{'location'} "; |
$result .= "set $type $spec->{'location'} "; |
$result .= ($spec->{'mirror'} eq 'on') ? 'mirror ' : 'nomirror '; |
$result .= ($spec->{'mirror'} eq 'on') ? 'mirror ' : 'nomirror '; |
|
if ($spec->{'rotate'} eq 'on') { |
|
$result .= ' rotate '; |
|
} |
if (defined $spec->{'ticspecs'}) { |
if (defined $spec->{'ticspecs'}) { |
$result .= '( '; |
$result .= '( '; |
my @ticspecs; |
my @ticspecs; |
Line 1750 sub generate_tics {
|
Line 1764 sub generate_tics {
|
sub write_gnuplot_file { |
sub write_gnuplot_file { |
my ($tmpdir,$filename,$target)= @_; |
my ($tmpdir,$filename,$target)= @_; |
my ($fontsize, $font_properties) = &get_font($target); |
my ($fontsize, $font_properties) = &get_font($target); |
|
&Apache::lonnet::logthis("Fontsize: $fontsize"); |
my $gnuplot_input = ''; |
my $gnuplot_input = ''; |
my $curve; |
my $curve; |
# |
# |
Line 2081 sub write_gnuplot_file {
|
Line 2096 sub write_gnuplot_file {
|
$linestyle_index++; # Each curve get a unique linestyle. |
$linestyle_index++; # Each curve get a unique linestyle. |
} |
} |
# Write the output to a file. |
# Write the output to a file. |
|
|
# &Apache::lonnet::logthis($gnuplot_input); # uncomment to log the gnuplot input. |
# &Apache::lonnet::logthis($gnuplot_input); # uncomment to log the gnuplot input. |
open (my $fh, "> $tmpdir$filename.data"); |
open (my $fh, "> $tmpdir$filename.data"); |
binmode($fh, ':utf8'); |
binmode($fh, ':utf8'); |