Demeter

Description Perl tools for X-ray Absorption Spectroscopy
Demeter > Perl Modules > Demeter::Plot::Indicator
Source

NAME

Demeter::Plot::Indicator - Vertical lines marking points on a plot

VERSION

This documentation refers to Demeter version 0.9.26.

SYNOPSIS

Mark a position in k-space:

  my $data = Demeter::Data->new( ... );
  $data -> standard;
  $data -> plot('E');
  my $indic = Demeter::Plot::Indicator->new(space=>'k', x=>42);
  $indic -> plot;

then, show where that energy value is in k:

  $data  -> plot('k');
  $indic -> plot;

DESCRIPTION

Indicators are vertical lines used to draw attention to specific points in plots of your data. This can be useful for comparing specific features in different data sets or for seeing how a particular feature propagates from energy to k to q.

Points selected in energy, k, or q are plotted in any of those spaces. Points selected in R can only be plotted in R.

Note that you must set a data standard (see Demeter::Mode) to be able to plot an indicator. The indicator is always scaled to the size of the standard data set. It also uses the y_offset attribute of the standard and its E0 shift when plotting in energy.

In normal operation, the upper and lower bounds of the indicator are genertated automatically, but they can be explicitly set using the ymin and ymax attributes.

ATTRIBUTES

space

An indicator is associated with a space, one of E, k, R, or q.

x

The position on the x-axis of the indicator. For an energy indicator, this must be an energy in eV relative to the edge (i.e. something like 70 rather than 7182).

x2

For an energy indicator, this is the corresponding k value. For a k or q indicator, this is the corresponding energy value. It gets updated whenever x is set. For an R indicator, this is the same as x, although it wont actually be used for anything.

active

This turns plotting of the indicator on and off. When set to 0, the plot method returns silently. This, then, is the equivalent of "commenting out" an indicator without deleting it.

i

This is an auto-generated index associated with the indicator. In practice, this is used in gnuplot to provide a tag for the (headless) arrow that is plotted as the indicator. There is no need to set this. This attribute is accessed by the gnuplot indicator template.

ymin

The lower bound of the indicator. If left as 0, the lower bound will be generated automatically based on the contents of the data standard.

ymax

The upper bound of the indicator. If left as 0, the upper bound will be generated automatically based on the contents of the data standard.

y1

The actual lower bound of the indicator. This is ymin scaled by is the configured indicator margin. Setting this does nothing as it will be overwritten the next time that ymin is set.

y2

The actual upper bound of the indicator. This is ymax scaled by is the configured indicator margin. Setting this does nothing as it will be overwritten the next time that ymax is set.

METHODS

plot

Plot the indicator in the space oset by the space attribute of the Plot object.

  $indic -> plot;

An indicator created in energy, k, or q will be plotted in energy, k, or q. Attempting to plot in R an indicator created in energy, k, or q will silently do nothing. Similarly, an indicator created in R will silently do nothing when plotted in energy, k, or q. This behavior allows you to do something like this:

  $_ -> plot($space) foreach (@all_data, @all_indicators);

This will plot sensibly without regard to the value of $space or how the indicators were created.

xcoord

Return the value of the x-coordinate of the indicator based on the current settings of the Plot and standard Data object.

  my $x = $indic->xcoord;
y1coord

Return the value of the lower y-coordinate of the indicator based on the value of ymax or current settings of the Plot and standard Data object.

  my $y1 = $indic->y1coord;
y2coord

Return the value of the upper y-coordinate of the indicator based on the value of ymin or current settings of the Plot and standard Data object.

  my $y2 = $indic->y2coord;

The xcoord, y1coord, and y2coord are used in the templates for plotting indicators.

SERIALIZATION AND DESERIALIZATION

Good question ...

CONFIGURATION AND ENVIRONMENT

See Demeter::Config for a description of the configuration system. There is an indicator group that can be adjusted to modify the default behavior of this object. It is in the ornaments.demeter_conf file.

DEPENDENCIES

Demeter's dependencies are in the Build.PL file.

BUGS AND LIMITATIONS

Please report problems to the Ifeffit Mailing List (http://cars9.uchicago.edu/mailman/listinfo/ifeffit/)

Patches are welcome.

AUTHOR

Bruce Ravel (http://bruceravel.github.io/home)

http://bruceravel.github.io/demeter/

LICENCE AND COPYRIGHT

Copyright (c) 2006-2018 Bruce Ravel (http://bruceravel.github.io/home). All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlgpl.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.