Chart-Graph

 view release on metacpan or  search on metacpan

Graph/Xmgrace.pm  view on Meta::CPAN

			       "stacked" => "false",
			       "extra opts" => undef,
			      ); 


my $def_graph_appearance = new Chart::Graph::Xmgrace::Graph_Presentation_Type;

my %def_xmgrace_data_opts = (
			     "set presentation" => "XY",
			     "options" => $def_graph_appearance->{"XY graph"},
			     "title" => "untitled data set", # comment, legend
			     "data format" => undef, # columns, matrix, or file
			    );

# New Hash of array references to hold list of options that might need to
# be checked against options.  If Xmgrace program changes.  Update here
my %def_xmgrace_available_options = 
    ( "type of graph" => ["XY graph", "XY chart", "Bar chart",
			  "Polar graph", "Smith chart", "Fixed",
			  # "Pie Chart", # Not yet implemented
			  ],

Graph/Xmgrace.pm  view on Meta::CPAN

	my $data_options_ref = _mesh_xmgrace_opts($user_data_opts_ref, 
						  \%def_xmgrace_data_opts);
	
	if (not $data_options_ref) {
	    # error message already printed
	    $handle->close();
	    _cleanup_tmpdir();
	    return 0;
	}

	# change the "title" into "comment" and "legend"
	_set_title($data_options_ref);

	# set data options in the dataset object
	$data_set_object->options($data_options_ref);

	# create new set presention for each data set
	my $sp = $user_data_opts_ref->{"set presentation"};
	if ($sp) {
	    if ($sp eq "XY") {
		_set_XY($data_set_object);

Graph/Xmgrace.pm  view on Meta::CPAN

# Name: _set_title
#
# Description: sets up the necessary characteristics for the
#              title of the graph
#

sub _set_title ($ ) {
    my $ds_ref = shift;
    my $title = $ds_ref->{title};
    $ds_ref->{options}->{options}->{comment} = $title;
    $ds_ref->{options}->{options}->{legend} = $title;
    return 1;
}                                  

####################################################################
#
# The following functions are used to map an option value from 
# prose to it's corresponding number value which grace understands
# Note: these routines are not used in the current version. the user
#       must use numbers (NOT prose) for now.
#

Graph/Xmgrace/Base_Dataset_Option.pm  view on Meta::CPAN

	} else {	

	    # we skip hidden datasets
	    if ($option eq "hidden") {
		if ($option_ref->{"hidden"} eq "true") {
		    last;
		}
	    }

	    if (!ref($option_ref->{$option})) {
		if ($option eq "comment" or $option eq "legend") {
		    $string = "$set $option \"$option_ref->{$option}\"\n";	
		} elsif (!$self->{name}) {
		    $string = "$set $option $option_ref->{$option}\n";
		} else {
		    $string = "$set $self->{name} $option $option_ref->{$option}\n";
		}
		
	    } elsif (ref($option_ref->{$option}) eq ARRAY) {
		$substr = join (", ", (@{ $option_ref->{$option} })); 
		$string = "$set $self->{name} $option $substr\n";

Graph/Xmgrace/Grace.pm  view on Meta::CPAN

package Chart::Graph::Xmgrace::Grace;
use Chart::Graph::Xmgrace::Graph_Options;
use Chart::Graph::Xmgrace::Axes;
@ISA = qw(Chart::Graph::Xmgrace::Base_Option);

sub _init {
    my $self = shift;
    my $graph_number = shift;
    $self->{print_order} = ["global options","graph global options","world options",
			    "stack options","view options","title options",
			    "subtitle options","axes options","legend options",
			    "frame options", "extra options"];
    $self->{output_type} = undef;
    $self->{output_file} = undef;
    $self->{grace_output_file} = undef;
    $self->{auto_color} = undef;
    $self->{length} = 0;
    $self->{options} = {
			"global options" => new Chart::Graph::Xmgrace::Global_Options,
			"graph global options" => new Chart::Graph::Xmgrace::Graph_Global_Options($graph_number),
			"world options" => new Chart::Graph::Xmgrace::World_Options,
			"stack options" => new Chart::Graph::Xmgrace::Stack_Options,
			"view options" => new Chart::Graph::Xmgrace::View_Options,
			"title options" => new Chart::Graph::Xmgrace::Title_Options,
			"subtitle options" => new Chart::Graph::Xmgrace::Subtitle_Options,
			"axes options" => new Chart::Graph::Xmgrace::Axes,
			"legend options" => new Chart::Graph::Xmgrace::Legend_Options,
			"frame options" => new Chart::Graph::Xmgrace::Frame_Options,
			"extra options" => new Chart::Graph::Xmgrace::Extra_Options,
		       };
}      

sub print ($$ ) {
    my $self = shift; 
    my ($handle) = @_;
    #my @cum_data_set_objects = @{$cum_data_set_objects}; 

Graph/Xmgrace/Grace.pm  view on Meta::CPAN

sub title_options ($$) {
    my $self = shift;
    return $self->{options}->{"title options"};
}

sub subtitle_options ($) {
    my $self = shift;
    return $self->{options}->{"subtitle options"};
}

sub legend_options ($) {
    my $self = shift;
    return $self->{options}->{"legend options"};
}
sub frame_options ($) {
    my $self = shift;
    return $self->{options}->{"frame options"};
}
sub extra_options ($) {
    my $self = shift;
    return $self->{options}->{"extra options"};
}
sub output_file ($$) {

Graph/Xmgrace/Graph_Options.pm  view on Meta::CPAN

			"size" => "1.000000",
			"color" => "1",		
		       };
}

package Chart::Graph::Xmgrace::Legend_Options;
@ISA = qw(Chart::Graph::Xmgrace::Base_Option);

sub _init {
    my $self = shift;  
    $self->{name} = "legend";
    $self->{print_order} = ["status","loctype","x1","y1","box color",
			    "box pattern","box linewidth","box linestyle",
			    "box fill color","box fill pattern","font",
			    "char size","color","length","vgap","hgap",
			    "invert"];
    $self->{length} = 4;
    $self->{options} = {
			"status" => "on",
			"loctype" => "view",
			"x1" => "0.85",

Graph/Xmgrace/Graph_Presentation_Type.pm  view on Meta::CPAN

package Chart::Graph::Xmgrace::Graph;
use Carp;
@ISA = qw(Chart::Graph::Xmgrace::Base_Dataset_Option);

sub _init {
    my $self = shift;
    my ($type, $color) = @_;
    $self->{type} = $type;
    $self->{print_order} = ["hidden","type","symbol","line","baseline",
			    "dropline","fill","avalue","errorbar","comment",
			    "legend"],
    $self->{length} = 4;
    $self->{options} = {
			"hidden" => "false",
			"type" => "$type",
			"symbol" => new Chart::Graph::Xmgrace::Symbol_Options($color),
			"line" => new Chart::Graph::Xmgrace::Line_Options($color),
			"baseline" => new Chart::Graph::Xmgrace::Baseline_Options($color),
			"dropline" => new Chart::Graph::Xmgrace::Dropline_Options($color),
			"fill" => new Chart::Graph::Xmgrace::Fill_Options($color),
			"avalue" => new Chart::Graph::Xmgrace::Avalue_Options($color),
			"errorbar" => new Chart::Graph::Xmgrace::Errorbar_Options($color),
			"comment" => "",
			"legend" =>  "",
		       };

    if ($type eq "XY") {
	return 1;
    } elsif ($type eq "BAR") {
	$self->symbol->fill_pattern("1");
	$self->symbol->color("1");
	$self->line->type("0");  
	return 1;
    } else {

Graph/Xmgrace/Graph_Presentation_Type.pm  view on Meta::CPAN

package Chart::Graph::Xmgrace::Chart;
use Carp;
@ISA = qw(Chart::Graph::Xmgrace::Base_Dataset_Option);

sub _init {
    my $self = shift;
    my ($type, $color) = @_;
    $self->{type} = $type;
    $self->{print_order} = ["hidden","type","symbol","line","baseline",
			    "dropline","fill","avalue","errorbar","comment",
			    "legend"],
    $self->{length} = 4;

    $self->{options} = {
			"hidden" => "false",
			"type" => "$type",
			"symbol" => new Chart::Graph::Xmgrace::Symbol_Options($color),
			"line" => new Chart::Graph::Xmgrace::Line_Options($color),
			"baseline" => new Chart::Graph::Xmgrace::Baseline_Options($color),
			"dropline" => new Chart::Graph::Xmgrace::Dropline_Options($color),
			"fill" => new Chart::Graph::Xmgrace::Fill_Options($color),
			"avalue" => new Chart::Graph::Xmgrace::Avalue_Options($color),
			"errorbar" => new Chart::Graph::Xmgrace::Errorbar_Options($color),
			"comment" => "",
			"legend" =>  "",
		       };

    if ($type eq "XY") {
	return 1;
    } elsif ($type eq "BAR") {
	$self->symbol->fill_pattern("1");
	$self->symbol->pattern("0");
	$self->line->type("0");  
	return 1;
    } else {

Graph/Xrt2d.pm  view on Meta::CPAN

		   $xrt_options .= " -xrm '*xrtLegendReversed: True'";
		   $xrt_options .= " -xrm '*xrtType: TYPEAREA'" .
			" -xrm '*xrtIsStacked: True'";
		} else {
		   carp "No graph type defined, defaulting to bar";
		   $xrt_options .= " -xrm '*xrtType: TYPEBAR'";
		}
	    }
	}
    }
    # Only reverse legend if NOT inverting bars.
    if (not $global_opts{"invert"} and $global_opts{"style"} eq "stackedbar") {
	$xrt_options .= " -xrm '*xrtLegendReversed: True'";
    }
    
    # get the number of columns and number of rows
    
    $x_cnt = @{$point_labels};
    $y_cnt = @{$set_labels};
    
    # because xrt allows multiline headers

doc/xmgrace1.agr  view on Meta::CPAN

@    yaxis  ticklabel type spec
@    yaxis  tick spec 3
@    yaxis  tick major 0,		1
@    yaxis  ticklabel 0, "one"
@    yaxis  tick major 1,		2
@    yaxis  ticklabel 1, "two"
@    yaxis  tick major 2,		3
@    yaxis  ticklabel 2, "three"
@    altxaxis  off
@    altyaxis  off
@    legend on
@    legend loctype view
@    legend x1 0.85
@    legend y1 0.8
@    legend box color 1
@    legend box pattern 1
@    legend box linewidth 1.0
@    legend box linestyle 1
@    legend box fill color 0
@    legend box fill pattern 1
@    legend font 0
@    legend char size 1.000000
@    legend color 1
@    legend length 4
@    legend vgap 1
@    legend hgap 1
@    legend invert false
@    frame type 0
@    frame linestyle 1
@    frame linewidth 1.0
@    frame color 1
@    frame pattern 1
@    frame background color 0
@    frame background pattern 0
@ target G0.S0
@ type XY
		1		2

doc/xmgrace2.agr  view on Meta::CPAN

@    yaxis  ticklabel start type auto
@    yaxis  ticklabel start 0.000000
@    yaxis  ticklabel stop type auto
@    yaxis  ticklabel stop 0.000000
@    yaxis  ticklabel char size 1.000000
@    yaxis  ticklabel font 0
@    yaxis  ticklabel color 1
@    yaxis  ticklabel type auto
@    altxaxis  off
@    altyaxis  off
@    legend on
@    legend loctype view
@    legend x1 0.85
@    legend y1 0.8
@    legend box color 1
@    legend box pattern 1
@    legend box linewidth 1.0
@    legend box linestyle 1
@    legend box fill color 0
@    legend box fill pattern 1
@    legend font 0
@    legend char size 1.000000
@    legend color 1
@    legend length 4
@    legend vgap 1
@    legend hgap 1
@    legend invert false
@    frame type 0
@    frame linestyle 1
@    frame linewidth 1.0
@    frame color 1
@    frame pattern 1
@    frame background color 0
@    frame background pattern 0
@ target G0.S0
@ type XY
		1		2

doc/xmgrace3.agr  view on Meta::CPAN

@    yaxis  ticklabel start type auto
@    yaxis  ticklabel start 0.000000
@    yaxis  ticklabel stop type auto
@    yaxis  ticklabel stop 0.000000
@    yaxis  ticklabel char size 1.000000
@    yaxis  ticklabel font 0
@    yaxis  ticklabel color 1
@    yaxis  ticklabel type auto
@    altxaxis  off
@    altyaxis  off
@    legend on
@    legend loctype view
@    legend x1 0.85
@    legend y1 0.8
@    legend box color 1
@    legend box pattern 1
@    legend box linewidth 1.0
@    legend box linestyle 1
@    legend box fill color 0
@    legend box fill pattern 1
@    legend font 0
@    legend char size 1.000000
@    legend color 1
@    legend length 4
@    legend vgap 1
@    legend hgap 1
@    legend invert false
@    frame type 0
@    frame linestyle 1
@    frame linewidth 1.0
@    frame color 1
@    frame pattern 1
@    frame background color 0
@    frame background pattern 0
@ target G0.S0
@ type BAR
		2001-07-24		32.58



( run in 0.721 second using v1.01-cache-2.11-cpan-49f99fa48dc )