--- loncom/xml/lonplot.pm 2004/08/30 15:23:23 1.101 +++ loncom/xml/lonplot.pm 2004/12/02 15:38:11 1.104 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Dynamic plot # -# $Id: lonplot.pm,v 1.101 2004/08/30 15:23:23 matthew Exp $ +# $Id: lonplot.pm,v 1.104 2004/12/02 15:38:11 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -246,7 +246,7 @@ my %gnuplot_defaults = bmargin => { default => 'default', test => sub {$_[0]=~/^(default|\d+)$/}, - description => 'Bottm margin width (pts):', + description => 'Bottom margin width (pts):', edit_type => 'choice', choices => $margin_choices, }, @@ -1030,7 +1030,7 @@ sub write_gnuplot_file { } # set term if ($target eq 'web') { - $gnuplot_input .= 'set term gif '; + $gnuplot_input .= 'set term '.$weboutputformat .' '; $gnuplot_input .= 'transparent ' if ($plot{'transparent'} eq 'on'); $gnuplot_input .= $plot{'font'} . ' '; $gnuplot_input .= 'size '.$plot{'width'}.','.$plot{'height'}.' '; @@ -1123,7 +1123,11 @@ sub write_gnuplot_file { my $label; foreach $label (@labels) { $gnuplot_input .= 'set label "'.$label->{'text'}.'" at '. - $label->{'xpos'}.','.$label->{'ypos'}.' '.$label->{'justify'}.' font "Helvetica,'.$pt.'pt"'.$/ ; + $label->{'xpos'}.','.$label->{'ypos'}.' '.$label->{'justify'}; + if ($target eq 'tex') { + $gnuplot_input .=' font "Helvetica,'.$pt.'pt"' ; + } + $gnuplot_input .= $/; } if ($target eq 'tex') { $gnuplot_input .="set size 1,".$plot{'height'}/$plot{'width'}*1.38; @@ -1234,10 +1238,10 @@ sub edit_attributes { ($description,$attr,$token, $defaults->{$attr}->{'size'}); } elsif ($defaults->{$attr}->{'edit_type'} eq 'choice') { - $result .= &Apache::edit::select_arg + $result .= &Apache::edit::select_or_text_arg ($description,$attr,$defaults->{$attr}->{'choices'},$token); } elsif ($defaults->{$attr}->{'edit_type'} eq 'onoff') { - $result .= &Apache::edit::select_arg + $result .= &Apache::edit::select_or_text_arg ($description,$attr,['on','off'],$token); } $result .= '
';