| Class | Tioga::X_and_Y_Axes |
| In: |
split/Tioga/lib/X_and_Y_Axes.rb
|
| Parent: | Doc< FigureMaker |
These are the methods and attributes for the plot axes.
See Tutorial::Plots for more information.
Determines the axis type to use when showing the bottom edge of a plot. Valid types are the following predefined constants: AXIS_HIDDEN, AXIS_LINE_ONLY, AXIS_WITH_MAJOR_TICKS_ONLY, AXIS_WITH_TICKS_ONLY, AXIS_WITH_MAJOR_TICKS_AND_NUMERIC_LABELS, and AXIS_WITH_TICKS_AND_NUMERIC_LABELS.
If true, then it is okay for tioga to show the bottom edge of a plot. If false, then calls on show_bottom_edge return immediately. This attribute is "one-way-only" in that it starts true and can be set false, but cannot be reset to true except by restoring the graphics state in which is was still true. This is intended to help control the behavior of plots when embedded as subplots in a larger configuration. Note that this does not effect showing the x axis on the bottom; it only applies to calls on show_bottom_edge.
Determines the axis type to use when showing the left edge of a plot. Valid types are the following predefined constants: AXIS_HIDDEN, AXIS_LINE_ONLY, AXIS_WITH_MAJOR_TICKS_ONLY, AXIS_WITH_TICKS_ONLY, AXIS_WITH_MAJOR_TICKS_AND_NUMERIC_LABELS, and AXIS_WITH_TICKS_AND_NUMERIC_LABELS.
If true, then it is okay for tioga to show the left edge of a plot. If false, then calls on show_left_edge return immediately. This attribute is "one-way-only" in that it starts true and can be set false, but cannot be reset to true except by restoring the graphics state in which is was still true. This is intended to help control the behavior of plots when embedded as subplots in a larger configuration. Note that this does not effect showing the y axis on the left; it only applies to calls on show_left_edge.
Determines the axis type to use when showing the right edge of a plot. Valid types are the following predefined constants: AXIS_HIDDEN, AXIS_LINE_ONLY, AXIS_WITH_MAJOR_TICKS_ONLY, AXIS_WITH_TICKS_ONLY, AXIS_WITH_MAJOR_TICKS_AND_NUMERIC_LABELS, and AXIS_WITH_TICKS_AND_NUMERIC_LABELS.
If true, then it is okay for tioga to show the right edge of a plot. If false, then calls on show_right_edge return immediately. This attribute is "one-way-only" in that it starts true and can be set false, but cannot be reset to true except by restoring the graphics state in which is was still true. This is intended to help control the behavior of plots when embedded as subplots in a larger configuration. Note that this does not effect showing the y axis on the right; it only applies to calls on show_right_edge.
Show one of the plot axes. If loc is LEFT, RIGHT, or AT_X_ORIGIN, and yaxis_visible is true, then the axis is shown using the current y axis settings. If loc is TOP, BOTTOM, or AT_Y_ORIGIN, and xaxis_visible is true, then the axis is shown using the current x axis settings.
If the flag bottom_edge_visible is true and the xaxis_loc is not BOTTOM, then shows the bottom edge of the frame. Otherwise, simply returns.
Show one of the plot edges. The loc argument must be one of LEFT, RIGHT, TOP, or BOTTOM. Left and right edges are shown using the current y axis settings. Top and bottom edges are shown using the x axis settings. If the corresponding edge_visible attribute has been set false, this command simply returns without doing anything.
If the flag left_edge_visible is true and the yaxis_loc is not LEFT, then shows the left edge of the frame. Otherwise, simply returns.
If the flag right_edge_visible is true and the yaxis_loc is not RIGHT, then shows the right edge of the frame. Otherwise, simply returns.
If the flag top_edge_visible is true and the xaxis_loc is not TOP, then shows the top edge of the frame. Otherwise, simply returns.
If the flag xaxis_visible is currently true, then this routine shows the x axis at the location specified by xaxis_loc. If the flag is false, it simply returns.
If the flag yaxis_visible is currently true, then this routine shows the y axis at the location specified by yaxis_loc. If the flag is false, it simply returns.
Determines the axis type to use when showing the top edge of a plot. Valid types are the following predefined constants: AXIS_HIDDEN, AXIS_LINE_ONLY, AXIS_WITH_MAJOR_TICKS_ONLY, AXIS_WITH_TICKS_ONLY, AXIS_WITH_MAJOR_TICKS_AND_NUMERIC_LABELS, and AXIS_WITH_TICKS_AND_NUMERIC_LABELS.
If true, then it is okay for tioga to show the top edge of a plot. If false, then calls on show_top_edge return immediately. This attribute is "one-way-only" in that it starts true and can be set false, but cannot be reset to true except by restoring the graphics state in which is was still true. This is intended to help control the behavior of plots when embedded as subplots in a larger configuration. Note that this does not effect showing the x axis on the top; it only applies to calls on show_top_edge.
If non-zero and tioga is creating numeric labels for the x axis, then numeric label will be switched to exponential format if it requires more than this number of digits.
Determines the location of the x axis. Valid locations are given as the following predefined constants: BOTTOM, TOP, and AT_Y_ORIGIN.
If nil, then tioga will pick locations for major ticks on the x axis. Otherwise, this should be Dvector of locations in x figure coordinates in strictly increasing order.
If nil, then tioga will pick locations for minor ticks on the x axis. Otherwise, this should be Dvector of locations in x figure coordinates in strictly increasing order.
If true, then locations along the x axis are to be treated as log values (base 10). This changes both the default placing of tick marks and the appearance of numeric labels.
When tioga picks the interval between major tick marks on the x axis, it will ensure that the interval is at least this large. Note that this distance is given in units of the default text height rather than in x coordinates.
Determines the number of minor intervals making up the distance between major ticks marks on the x axis. If this is set to 0, then tioga will pick the number.
Numeric labels on the x axis are rotated by this angle from vertical. See also tex_xaxis_numeric_label.
If non-negative, then use this number of digits after the decimal when creating numeric labels for the x axis. See also tex_xaxis_numeric_label.
Scaling factor relative to default_text_scale for the numeric labels on the x axis in plots. See also tex_xaxis_numeric_label.
Distance to shift the reference point for showing numeric labels on the x axis measured in character heights with positive directed out away from the plot for x axis on top or bottom, or toward positive y values for x axis at y origin. See also tex_xaxis_numeric_label.
The string for a numeric label is put in this TeX command string to be formatted. For example, `$1$’ will give the numbers in math mode, while `$\mathsf{1}$’ will show the label using the math sans-serif font.
If 0, then tioga will pick the interval between major tick marks on the x axis. Otherwise, this will be used as the interval in x coordinates for the spacing between major ticks.
If nil, then tioga will create numeric labels for the major ticks on the x axis. Otherwise, you must also specify xaxis_locations_for_major_ticks, and xaxis_tick_labels must be an equal length array of strings giving the corresponding labels.
See also yaxis_tick_labels.
If true, then ticks will be added along the x axis inside the plot frame. If false, then no ticks will appear inside the frame along the x axis.
If true, then ticks will be added along the x axis outside the plot frame. If false, then no ticks will appear outside the frame along the x axis.
Determines the axis type to use when showing the x axis of a plot. Valid types are the following predefined constants: AXIS_HIDDEN, AXIS_LINE_ONLY, AXIS_WITH_MAJOR_TICKS_ONLY, AXIS_WITH_TICKS_ONLY, AXIS_WITH_MAJOR_TICKS_AND_NUMERIC_LABELS, and AXIS_WITH_TICKS_AND_NUMERIC_LABELS.
If this flag is true, and tioga is creating numeric labels for the x axis, and the xaxis_log_values flag is also true, then the labels will be shown using fixed point notation rather than exponential. For example, a label at x location 3.0 will display as "1000" rather than as "10^3", and a label at x == -2.0 will display as "0.01" rather than as "10^-2".
If true, then it is okay for tioga to show the x axis of a plot. If false, then calls on show_axis for the x axis return immediately. This attribute is "one-way-only" in that it starts true and can be set false, but cannot be reset to true except by restoring the graphics state in which is was still true. This is intended to help control the behavior of plots when embedded as subplots in a larger configuration. Note that this does not effect showing the top or bottom edges; it only applies to calls on show_axis.
If non-zero and tioga is creating numeric labels for the y axis, then numeric label will be switched to exponential format if it requires more than this number of digits.
Determines the location of the y axis. Valid locations are given as the following predefined constants: LEFT, RIGHT, and AT_X_ORIGIN.
If nil, then tioga will pick locations for major ticks on the y axis. Otherwise, this should be Dvector of locations in y figure coordinates in strictly increasing order.
See also yaxis_tick_labels.
If nil, then tioga will pick locations for minor ticks on the y axis. Otherwise, this should be Dvector of locations in x figure coordinates in strictly increasing order.
If true, then locations along the y axis are to be treated as log values (base 10). This changes both the default placing of tick marks and the appearance of numeric labels.
When tioga picks the interval between major tick marks on the y axis, it will ensure that the interval is at least this large. Note that this distance is given in units of the default text height rather than in y coordinates.
Determines the number of minor intervals making up the distance between major ticks marks on the y axis. If this is set to 0, then tioga will pick the number.
Numeric labels on the y axis are rotated by this angle from horizontal. See also tex_yaxis_numeric_label.
If non-negative, then use this number of digits after the decimal when creating numeric labels for the y axis. See also tex_yaxis_numeric_label.
Scaling factor relative to default_text_scale for the numeric labels on the y axis in plots. See also tex_yaxis_numeric_label.
Distance to shift the reference point for showing numeric labels on the y axis measured in character heights with positive directed out away from the plot for y axis on left or right, or toward positive x values for y axis at x origin. See also tex_yaxis_numeric_label.
The string for a numeric label is put in this TeX command string to be formatted. For example, `$1$’ will give the numbers in math mode, while `$\mathsf{1}$’ will show the label using the math sans-serif font.
If 0, then tioga will pick the interval between major tick marks on the y axis. Otherwise, this will be used as the interval in y coordinates for the spacing between major ticks.
If nil, then tioga will create numeric labels for the major ticks on the y axis. Otherwise, you must also specify yaxis_locations_for_major_ticks, and yaxis_tick_labels must be an equal length array of strings giving the corresponding labels.
See also xaxis_tick_labels.
Examples
def special_y
t.ylabel_shift += 2
t.do_box_labels('Special Y Axis', 'Position', 'Y Values')
t.yaxis_numeric_label_angle = -90
t.yaxis_locations_for_major_ticks = [
-10.0, -6.0, -PI, 0.0, PI, 6.0, 10.0 ]
t.yaxis_tick_labels = [
"-IX", "-VI", "$-\\pi$", "$\\mathcal{ZERO}$", "$\\pi$", "VI", "IX" ]
t.yaxis_type = AXIS_WITH_MAJOR_TICKS_AND_NUMERIC_LABELS
t.stroke_color = Blue
t.yaxis_numeric_label_justification = RIGHT_JUSTIFIED
t.right_edge_type = AXIS_WITH_MAJOR_TICKS_ONLY
t.yaxis_numeric_label_shift = 0
xs = @positions; ys = @big_blues
t.show_plot('boundaries' => plot_boundaries(xs,ys,@margin,-11, 11)) do
t.append_points_to_path(xs,ys)
t.stroke
end
end
If true, then ticks will be added along the y axis inside the plot frame. If false, then no ticks will appear inside the frame along the y axis.
If true, then ticks will be added along the y axis outside the plot frame. If false, then no ticks will appear outside the frame along the y axis.
Determines the axis type to use when showing the y axis of a plot. Valid types are the following predefined constants: AXIS_HIDDEN, AXIS_LINE_ONLY, AXIS_WITH_MAJOR_TICKS_ONLY, AXIS_WITH_TICKS_ONLY, AXIS_WITH_MAJOR_TICKS_AND_NUMERIC_LABELS, and AXIS_WITH_TICKS_AND_NUMERIC_LABELS.
If this flag is true, and tioga is creating numeric labels for the y axis, and the yaxis_log_values flag is also true, then the labels will be shown using fixed point notation rather than exponential. For example, a label at y location 3.0 will display as "1000" rather than as "10^3", and a label at y == -2.0 will display as "0.01" rather than as "10^-2".
If true, then it is okay for tioga to show the y axis of a plot. If false, then calls on show_axis for the y axis return immediately. This attribute is "one-way-only" in that it starts true and can be set false, but cannot be reset to true except by restoring the graphics state in which is was still true. This is intended to help control the behavior of plots when embedded as subplots in a larger configuration. Note that this does not effect showing the left or right edges; it only applies to calls on show_axis.