Class: Tioga::X_and_Y_Axes
- Inherits:
-
Object
- Object
- Tioga::X_and_Y_Axes
- Defined in:
- lib/Tioga/X_and_Y_Axes.rb
Instance Method Summary collapse
-
#axis_information(loc) ⇒ Object
Takes the same argument as #show_axis, and returns some information about the way the corresponding axis would be organized, in the form of a hash with the following keys: * ‘major’: the position of major ticks * ‘labels’: their corresponding numeric labels (as given to LaTeX, so that includes things like tiogayaxisnumericlabel) * ‘vertical’: whether the axis is vertical or horizontal * ‘scale’, ‘shift’, ‘angle’ : the shift, scale and angle of the tick labels * ‘line_width’: the axis line width * ‘x0’, ‘y0’, ‘x1’, ‘y1’: the axis position in figure coordinates * ‘major_tick_width’, ‘major_tick_length’, ‘minor_tick_length’, ‘minor_tick_width’: ticks widths and lengths.
-
#bottom_edge_type ⇒ Object
:call-seq: bottom_edge_type bottom_edge_type = an_edge_type.
-
#bottom_edge_visible ⇒ Object
:call-seq: bottom_edge_visible bottom_edge_visible = false.
-
#left_edge_type ⇒ Object
:call-seq: left_edge_type left_edge_type = an_edge_type.
-
#left_edge_visible ⇒ Object
:call-seq: left_edge_visible left_edge_visible = false.
-
#right_edge_type ⇒ Object
:call-seq: right_edge_type right_edge_type = an_edge_type.
-
#right_edge_visible ⇒ Object
:call-seq: right_edge_visible right_edge_visible = false.
-
#show_axis(loc) ⇒ Object
Show one of the plot axes.
-
#show_bottom_edge ⇒ Object
:call-seq: show_bottom_edge.
-
#show_edge(loc) ⇒ Object
Show one of the plot edges.
-
#show_left_edge ⇒ Object
:call-seq: show_left_edge.
-
#show_right_edge ⇒ Object
:call-seq: show_right_edge.
-
#show_top_edge ⇒ Object
:call-seq: show_top_edge.
-
#show_xaxis ⇒ Object
:call-seq: show_xaxis.
-
#show_yaxis ⇒ Object
:call-seq: show_yaxis.
-
#top_edge_type ⇒ Object
:call-seq: top_edge_type top_edge_type = an_edge_type.
-
#top_edge_visible ⇒ Object
:call-seq: top_edge_visible top_edge_visible = false.
-
#xaxis_digits_max ⇒ Object
:call-seq: xaxis_digits_max xaxis_digits_max = an_integer_value.
-
#xaxis_line_width ⇒ Object
:call-seq: xaxis_line_width xaxis_line_width = a_float.
-
#xaxis_loc ⇒ Object
:call-seq: xaxis_loc xaxis_loc = a_location.
-
#xaxis_locations_for_major_ticks ⇒ Object
:call-seq: xaxis_locations_for_major_ticks xaxis_locations_for_major_ticks = a_dvector_or_nil.
-
#xaxis_locations_for_minor_ticks ⇒ Object
:call-seq: xaxis_locations_for_minor_ticks xaxis_locations_for_minor_ticks = a_dvector_or_nil.
-
#xaxis_log_values ⇒ Object
:call-seq: xaxis_log_values xaxis_log_values = true_or_false.
-
#xaxis_major_tick_length ⇒ Object
:call-seq: xaxis_major_tick_length xaxis_major_tick_length = a_float.
-
#xaxis_major_tick_width ⇒ Object
:call-seq: xaxis_major_tick_width xaxis_major_tick_width = a_float.
-
#xaxis_min_between_major_ticks ⇒ Object
:call-seq: xaxis_min_between_major_ticks xaxis_min_between_major_ticks = a_float.
-
#xaxis_minor_tick_length ⇒ Object
:call-seq: xaxis_minor_tick_length xaxis_minor_tick_length = a_float.
-
#xaxis_minor_tick_width ⇒ Object
:call-seq: xaxis_minor_tick_width xaxis_minor_tick_width = a_float.
-
#xaxis_number_of_minor_intervals ⇒ Object
:call-seq: xaxis_number_of_minor_intervals xaxis_number_of_minor_intervals = an_integer_value.
-
#xaxis_numeric_label_alignment ⇒ Object
:call-seq: xaxis_numeric_label_alignment xaxis_numeric_label_alignment = an_alignment.
-
#xaxis_numeric_label_angle ⇒ Object
:call-seq: xaxis_numeric_label_angle xaxis_numeric_label_angle = a_float_in_degrees.
-
#xaxis_numeric_label_decimal_digits ⇒ Object
:call-seq: xaxis_numeric_label_decimal_digits xaxis_numeric_label_decimal_digits = an_integer_value.
-
#xaxis_numeric_label_frequency ⇒ Object
:call-seq: xaxis_numeric_label_frequency xaxis_numeric_label_frequency = an_integer.
-
#xaxis_numeric_label_justification ⇒ Object
:call-seq: xaxis_numeric_label_justification xaxis_numeric_label_justification = a_justification.
-
#xaxis_numeric_label_phase ⇒ Object
:call-seq: xaxis_numeric_label_phase xaxis_numeric_label_phase = an_integer.
-
#xaxis_numeric_label_scale ⇒ Object
:call-seq: xaxis_numeric_label_scale xaxis_numeric_label_scale = a_float.
-
#xaxis_numeric_label_shift ⇒ Object
:call-seq: xaxis_numeric_label_shift xaxis_numeric_label_shift = a_float.
-
#xaxis_numeric_label_tex ⇒ Object
:call-seq: xaxis_numeric_label_tex xaxis_numeric_label_tex = a_string.
-
#xaxis_reversed ⇒ Object
:call-seq: xaxis_reversed .
-
#xaxis_stroke_color ⇒ Object
:call-seq: xaxis_stroke_color xaxis_stroke_color = color_value.
-
#xaxis_tick_interval ⇒ Object
:call-seq: xaxis_tick_interval xaxis_tick_interval = a_float.
-
#xaxis_tick_labels ⇒ Object
:call-seq: xaxis_tick_labels xaxis_tick_labels = array_or_nil.
-
#xaxis_ticks_inside ⇒ Object
:call-seq: xaxis_ticks_inside xaxis_ticks_inside = true_or_false.
-
#xaxis_ticks_outside ⇒ Object
:call-seq: xaxis_ticks_outside xaxis_ticks_outside = true_or_false.
-
#xaxis_type ⇒ Object
:call-seq: xaxis_type xaxis_type = an_axis_type_value.
-
#xaxis_use_fixed_pt ⇒ Object
:call-seq: xaxis_use_fixed_pt xaxis_use_fixed_pt = true_or_false.
-
#xaxis_visible ⇒ Object
:call-seq: xaxis_visible xaxis_visible = false.
-
#yaxis_digits_max ⇒ Object
:call-seq: yaxis_digits_max yaxis_digits_max = an_integer_value.
-
#yaxis_line_width ⇒ Object
:call-seq: yaxis_line_width yaxis_line_width = a_float.
-
#yaxis_loc ⇒ Object
:call-seq: yaxis_loc yaxis_loc = a_location.
-
#yaxis_locations_for_major_ticks ⇒ Object
:call-seq: yaxis_locations_for_major_ticks yaxis_locations_for_major_ticks = a_dvector_or_nil.
-
#yaxis_locations_for_minor_ticks ⇒ Object
:call-seq: yaxis_locations_for_minor_ticks yaxis_locations_for_minor_ticks = a_dvector_or_nil.
-
#yaxis_log_values ⇒ Object
:call-seq: yaxis_log_values yaxis_log_values = true_or_false.
-
#yaxis_major_tick_length ⇒ Object
:call-seq: yaxis_major_tick_length yaxis_major_tick_length = a_float.
-
#yaxis_major_tick_width ⇒ Object
:call-seq: yaxis_major_tick_width yaxis_major_tick_width = a_float.
-
#yaxis_min_between_major_ticks ⇒ Object
default text height rather than in y coordinates.
-
#yaxis_minor_tick_length ⇒ Object
:call-seq: yaxis_minor_tick_length yaxis_minor_tick_length = a_float.
-
#yaxis_minor_tick_width ⇒ Object
:call-seq: yaxis_minor_tick_width yaxis_minor_tick_width = a_float.
-
#yaxis_number_of_minor_intervals ⇒ Object
:call-seq: yaxis_number_of_minor_intervals yaxis_number_of_minor_intervals = an_integer_value.
-
#yaxis_numeric_label_alignment ⇒ Object
:call-seq: yaxis_numeric_label_alignment yaxis_numeric_label_alignment = an_alignment.
-
#yaxis_numeric_label_angle ⇒ Object
:call-seq: yaxis_numeric_label_angle yaxis_numeric_label_angle = a_float_in_degrees.
-
#yaxis_numeric_label_decimal_digits ⇒ Object
:call-seq: yaxis_numeric_label_decimal_digits yaxis_numeric_label_decimal_digits = an_integer_value.
-
#yaxis_numeric_label_frequency ⇒ Object
:call-seq: yaxis_numeric_label_frequency yaxis_numeric_label_frequency = an_integer.
-
#yaxis_numeric_label_justification ⇒ Object
:call-seq: yaxis_numeric_label_justification yaxis_numeric_label_justification = a_justification.
-
#yaxis_numeric_label_phase ⇒ Object
:call-seq: yaxis_numeric_label_phase yaxis_numeric_label_phase = an_integer.
-
#yaxis_numeric_label_scale ⇒ Object
:call-seq: yaxis_numeric_label_scale yaxis_numeric_label_scale = a_float.
-
#yaxis_numeric_label_shift ⇒ Object
:call-seq: yaxis_numeric_label_shift yaxis_numeric_label_shift = a_float.
-
#yaxis_numeric_label_tex ⇒ Object
:call-seq: yaxis_numeric_label_tex yaxis_numeric_label_tex = a_string.
-
#yaxis_reversed ⇒ Object
:call-seq: yaxis_reversed .
-
#yaxis_stroke_color ⇒ Object
:call-seq: yaxis_stroke_color yaxis_stroke_color = color_value.
-
#yaxis_tick_interval ⇒ Object
:call-seq: xaxis_numeric_label_decimal_digits xaxis_numeric_label_decimal_digits = an_integer_value.
-
#yaxis_tick_labels ⇒ Object
:call-seq: yaxis_tick_labels yaxis_tick_labels = array_or_nil.
-
#yaxis_ticks_inside ⇒ Object
:call-seq: yaxis_ticks_inside yaxis_ticks_inside = true_or_false.
-
#yaxis_ticks_outside ⇒ Object
:call-seq: yaxis_ticks_outside yaxis_ticks_outside = true_or_false.
-
#yaxis_type ⇒ Object
:call-seq: yaxis_type yaxis_type = an_axis_type_value.
-
#yaxis_use_fixed_pt ⇒ Object
:call-seq: yaxis_use_fixed_pt yaxis_use_fixed_pt = true_or_false.
-
#yaxis_visible ⇒ Object
:call-seq: yaxis_visible yaxis_visible = false.
Instance Method Details
#axis_information(loc) ⇒ Object
Takes the same argument as #show_axis, and returns some information about the way the corresponding axis would be organized, in the form of a hash with the following keys:
-
‘major’: the position of major ticks
-
‘labels’: their corresponding numeric labels (as given to LaTeX, so that includes things like tiogayaxisnumericlabel)
-
‘vertical’: whether the axis is vertical or horizontal
-
‘scale’, ‘shift’, ‘angle’ : the shift, scale and angle of
the tick labels -
‘line_width’: the axis line width
-
‘x0’, ‘y0’, ‘x1’, ‘y1’: the axis position in figure coordinates
-
‘major_tick_width’, ‘major_tick_length’, ‘minor_tick_length’, ‘minor_tick_width’: ticks widths and lengths
37 38 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 37 def axis_information(loc) end |
#bottom_edge_type ⇒ Object
:call-seq:
bottom_edge_type
bottom_edge_type = an_edge_type
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.
130 131 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 130 def bottom_edge_type end |
#bottom_edge_visible ⇒ Object
:call-seq:
bottom_edge_visible
bottom_edge_visible = false
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.
146 147 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 146 def bottom_edge_visible end |
#left_edge_type ⇒ Object
:call-seq:
left_edge_type
left_edge_type = an_edge_type
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.
158 159 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 158 def left_edge_type end |
#left_edge_visible ⇒ Object
:call-seq:
left_edge_visible
left_edge_visible = false
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.
174 175 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 174 def left_edge_visible end |
#right_edge_type ⇒ Object
:call-seq:
right_edge_type
right_edge_type = an_edge_type
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.
185 186 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 185 def right_edge_type end |
#right_edge_visible ⇒ Object
:call-seq:
right_edge_visible
right_edge_visible = false
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.
200 201 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 200 def right_edge_visible end |
#show_axis(loc) ⇒ Object
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.
Sarting from Tioga 1.8, you can specify a dictionary instead of the position. This dictionary must either have a ‘location’ or a ‘from’ and ‘to’ entry to specify the position of the axis. See #axis_information for more dictionary entries understood.
NOTE: using a dictionnary bypasses the checks #xaxis_visible and #yaxis_visible !
[from samples/plots/plots.rb]
# This plot is to demonstrate the new power of #show_axis.
def axes_fun
t.do_box_labels("Funny axes", "", "")
t.show_plot([-1, 19, 8, 2]) do
spec = {
'from' => [3,3],
'to' => [3,7],
'ticks_outside' => true,
'ticks_inside' => false,
}
t.show_axis(spec)
spec2 = {
'from' => [12,3],
'to' => [12,7],
'ticks_outside' => true,
'ticks_inside' => false,
'major_ticks' => [4,6],
'labels' => ["$a$", "$b$"]
}
t.show_axis(spec2)
spec3 = {
'from' => [17,3],
'to' => [17,7],
'ticks_outside' => true,
'ticks_inside' => false,
'labels' => ["$a$", "$b$", 'c', 'd', 'e']
}
t.show_axis(spec3)
end
t.context do
t.set_bounds([-1, 19, 8, 2])
spec = {
'from' => [4,1.2],
'to' => [12,1.2],
'major_ticks' => [ 4.5, 8.8]
}
t.show_axis(spec)
end
end

261 262 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 261 def show_axis(loc) end |
#show_bottom_edge ⇒ Object
:call-seq:
show_bottom_edge
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.
61 62 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 61 def show_bottom_edge end |
#show_edge(loc) ⇒ Object
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.
268 269 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 268 def show_edge(loc) end |
#show_left_edge ⇒ Object
:call-seq:
show_left_edge
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.
69 70 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 69 def show_left_edge end |
#show_right_edge ⇒ Object
:call-seq:
show_right_edge
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.
77 78 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 77 def show_right_edge end |
#show_top_edge ⇒ Object
:call-seq:
show_top_edge
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.
53 54 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 53 def show_top_edge end |
#show_xaxis ⇒ Object
:call-seq:
show_xaxis
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.
20 21 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 20 def show_xaxis end |
#show_yaxis ⇒ Object
:call-seq:
show_yaxis
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.
45 46 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 45 def show_yaxis end |
#top_edge_type ⇒ Object
:call-seq:
top_edge_type
top_edge_type = an_edge_type
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.
103 104 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 103 def top_edge_type end |
#top_edge_visible ⇒ Object
:call-seq:
top_edge_visible
top_edge_visible = false
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.
119 120 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 119 def top_edge_visible end |
#xaxis_digits_max ⇒ Object
:call-seq:
xaxis_digits_max
xaxis_digits_max = an_integer_value
If non-zero (and xaxis_use_fixed_pt is not true), then x axis numeric labels will be switched to exponential format if they require more than this number of digits. If yaxis_digits_max is set to zero, then a system-choosen default value is used instead. See also xaxis_use_fixed_pt.
346 347 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 346 def xaxis_digits_max end |
#xaxis_line_width ⇒ Object
:call-seq:
xaxis_line_width
xaxis_line_width = a_float
Value for the line_width attribute when painting the x axis line.
467 468 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 467 def xaxis_line_width end |
#xaxis_loc ⇒ Object
:call-seq:
xaxis_loc
xaxis_loc = a_location
Determines the location of the x axis. Valid locations are given as the following predefined constants: BOTTOM, TOP, and AT_Y_ORIGIN.
292 293 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 292 def xaxis_loc end |
#xaxis_locations_for_major_ticks ⇒ Object
:call-seq:
xaxis_locations_for_major_ticks
xaxis_locations_for_major_ticks = a_dvector_or_nil
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.
398 399 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 398 def xaxis_locations_for_major_ticks end |
#xaxis_locations_for_minor_ticks ⇒ Object
:call-seq:
xaxis_locations_for_minor_ticks
xaxis_locations_for_minor_ticks = a_dvector_or_nil
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.
407 408 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 407 def xaxis_locations_for_minor_ticks end |
#xaxis_log_values ⇒ Object
:call-seq:
xaxis_log_values
xaxis_log_values = true_or_false
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.
425 426 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 425 def xaxis_log_values end |
#xaxis_major_tick_length ⇒ Object
:call-seq:
xaxis_major_tick_length
xaxis_major_tick_length = a_float
Length of major ticks on the x axis measured in units of the default text height.
451 452 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 451 def xaxis_major_tick_length end |
#xaxis_major_tick_width ⇒ Object
:call-seq:
xaxis_major_tick_width
xaxis_major_tick_width = a_float
Value for the line_width attribute when painting the x axis major tick marks.
475 476 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 475 def xaxis_major_tick_width end |
#xaxis_min_between_major_ticks ⇒ Object
:call-seq:
xaxis_min_between_major_ticks
xaxis_min_between_major_ticks = a_float
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.
377 378 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 377 def xaxis_min_between_major_ticks end |
#xaxis_minor_tick_length ⇒ Object
:call-seq:
xaxis_minor_tick_length
xaxis_minor_tick_length = a_float
Length of minor ticks on the x axis measured in units of the default text height.
459 460 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 459 def xaxis_minor_tick_length end |
#xaxis_minor_tick_width ⇒ Object
:call-seq:
xaxis_minor_tick_width
xaxis_minor_tick_width = a_float
Value for the line_width attribute when painting the x axis minor tick marks.
483 484 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 483 def xaxis_minor_tick_width end |
#xaxis_number_of_minor_intervals ⇒ Object
:call-seq:
xaxis_number_of_minor_intervals
xaxis_number_of_minor_intervals = an_integer_value
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.
367 368 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 367 def xaxis_number_of_minor_intervals end |
#xaxis_numeric_label_alignment ⇒ Object
:call-seq:
xaxis_numeric_label_alignment
xaxis_numeric_label_alignment = an_alignment
The #alignment setting for numeric labels on the x axis. See also tex_xaxis_numeric_label.
529 530 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 529 def xaxis_numeric_label_alignment end |
#xaxis_numeric_label_angle ⇒ Object
:call-seq:
xaxis_numeric_label_angle
xaxis_numeric_label_angle = a_float_in_degrees
Numeric labels on the x axis are rotated by this angle from vertical. See also tex_xaxis_numeric_label.
520 521 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 520 def xaxis_numeric_label_angle end |
#xaxis_numeric_label_decimal_digits ⇒ Object
:call-seq:
xaxis_numeric_label_decimal_digits
xaxis_numeric_label_decimal_digits = an_integer_value
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.
335 336 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 335 def xaxis_numeric_label_decimal_digits end |
#xaxis_numeric_label_frequency ⇒ Object
:call-seq:
xaxis_numeric_label_frequency
xaxis_numeric_label_frequency = an_integer
The #frequency setting for numeric labels on the x axis. Major ticks are numbered from 0 at the small x end of the axis. Tick number k gets a label only if mod(i+j,k)==0 where j=xaxis_numeric_label_phase and k=xaxis_numeric_label_frequency. The default for xaxis_numeric_label_frequency is 1 so that every major tick gets a label. See also xaxis_numeric_label_phase.
555 556 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 555 def xaxis_numeric_label_frequency end |
#xaxis_numeric_label_justification ⇒ Object
:call-seq:
xaxis_numeric_label_justification
xaxis_numeric_label_justification = a_justification
The #justification setting for numeric labels on the x axis. See also tex_xaxis_numeric_label.
538 539 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 538 def xaxis_numeric_label_justification end |
#xaxis_numeric_label_phase ⇒ Object
:call-seq:
xaxis_numeric_label_phase
xaxis_numeric_label_phase = an_integer
The #phase setting for numeric labels on the x axis. The default phase is 0. See xaxis_numeric_label_frequency for details.
565 566 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 565 def xaxis_numeric_label_phase end |
#xaxis_numeric_label_scale ⇒ Object
:call-seq:
xaxis_numeric_label_scale
xaxis_numeric_label_scale = a_float
Scaling factor relative to default_text_scale for the numeric labels on the x axis in plots. See also tex_xaxis_numeric_label.
500 501 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 500 def xaxis_numeric_label_scale end |
#xaxis_numeric_label_shift ⇒ Object
:call-seq:
xaxis_numeric_label_shift
xaxis_numeric_label_shift = a_float
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.
511 512 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 511 def xaxis_numeric_label_shift end |
#xaxis_numeric_label_tex ⇒ Object
:call-seq:
xaxis_numeric_label_tex
xaxis_numeric_label_tex = a_string
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.
313 314 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 313 def xaxis_numeric_label_tex end |
#xaxis_reversed ⇒ Object
:call-seq:
xaxis_reversed
Flag is true if the bounds_left is not the bounds_xmin.
84 85 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 84 def xaxis_reversed end |
#xaxis_stroke_color ⇒ Object
:call-seq:
xaxis_stroke_color
xaxis_stroke_color = color_value
Value for the stroke_color attribute when painting the x axis.
491 492 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 491 def xaxis_stroke_color end |
#xaxis_tick_interval ⇒ Object
:call-seq:
xaxis_tick_interval
xaxis_tick_interval = a_float
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.
872 873 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 872 def xaxis_tick_interval end |
#xaxis_tick_labels ⇒ Object
:call-seq:
xaxis_tick_labels
xaxis_tick_labels = array_or_nil
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.
389 390 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 389 def xaxis_tick_labels end |
#xaxis_ticks_inside ⇒ Object
:call-seq:
xaxis_ticks_inside
xaxis_ticks_inside = true_or_false
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.
434 435 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 434 def xaxis_ticks_inside end |
#xaxis_ticks_outside ⇒ Object
:call-seq:
xaxis_ticks_outside
xaxis_ticks_outside = true_or_false
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.
443 444 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 443 def xaxis_ticks_outside end |
#xaxis_type ⇒ Object
:call-seq:
xaxis_type
xaxis_type = an_axis_type_value
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.
303 304 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 303 def xaxis_type end |
#xaxis_use_fixed_pt ⇒ Object
:call-seq:
xaxis_use_fixed_pt
xaxis_use_fixed_pt = true_or_false
If this flag is true, then numeric labels for the x axis will always use fixed point notation rather than exponential. If false, then the value of xaxis_digits_max will be used to decide between fixed point or exponential notation. See also xaxis_digits_max.
358 359 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 358 def xaxis_use_fixed_pt end |
#xaxis_visible ⇒ Object
:call-seq:
xaxis_visible
xaxis_visible = false
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.
283 284 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 283 def xaxis_visible end |
#yaxis_digits_max ⇒ Object
:call-seq:
yaxis_digits_max
yaxis_digits_max = an_integer_value
If non-zero (and yaxis_use_fixed_pt is not true), then y axis numeric labels will be switched to exponential format if they require more than this number of digits. If yaxis_digits_max is set to zero, then a system-choosen default value is used instead. See also yaxis_use_fixed_pt.
651 652 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 651 def yaxis_digits_max end |
#yaxis_line_width ⇒ Object
:call-seq:
yaxis_line_width
yaxis_line_width = a_float
Value for the line_width attribute when painting the y axis line.
792 793 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 792 def yaxis_line_width end |
#yaxis_loc ⇒ Object
:call-seq:
yaxis_loc
yaxis_loc = a_location
Determines the location of the y axis. Valid locations are given as the following predefined constants: LEFT, RIGHT, and AT_X_ORIGIN.
619 620 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 619 def yaxis_loc end |
#yaxis_locations_for_major_ticks ⇒ Object
:call-seq:
yaxis_locations_for_major_ticks
yaxis_locations_for_major_ticks = a_dvector_or_nil
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.
732 733 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 732 def yaxis_locations_for_major_ticks end |
#yaxis_locations_for_minor_ticks ⇒ Object
:call-seq:
yaxis_locations_for_minor_ticks
yaxis_locations_for_minor_ticks = a_dvector_or_nil
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.
741 742 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 741 def yaxis_locations_for_minor_ticks end |
#yaxis_log_values ⇒ Object
:call-seq:
yaxis_log_values
yaxis_log_values = true_or_false
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.
750 751 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 750 def yaxis_log_values end |
#yaxis_major_tick_length ⇒ Object
:call-seq:
yaxis_major_tick_length
yaxis_major_tick_length = a_float
Length of major ticks on the y axis measured in units of the default text height.
776 777 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 776 def yaxis_major_tick_length end |
#yaxis_major_tick_width ⇒ Object
:call-seq:
yaxis_major_tick_width
yaxis_major_tick_width = a_float
Value for the line_width attribute when painting the y axis major tick marks.
800 801 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 800 def yaxis_major_tick_width end |
#yaxis_min_between_major_ticks ⇒ Object
default text height rather than in y coordinates.
681 682 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 681 def yaxis_min_between_major_ticks end |
#yaxis_minor_tick_length ⇒ Object
:call-seq:
yaxis_minor_tick_length
yaxis_minor_tick_length = a_float
Length of minor ticks on the y axis measured in units of the default text height.
784 785 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 784 def yaxis_minor_tick_length end |
#yaxis_minor_tick_width ⇒ Object
:call-seq:
yaxis_minor_tick_width
yaxis_minor_tick_width = a_float
Value for the line_width attribute when painting the y axis minor tick marks.
808 809 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 808 def yaxis_minor_tick_width end |
#yaxis_number_of_minor_intervals ⇒ Object
:call-seq:
yaxis_number_of_minor_intervals
yaxis_number_of_minor_intervals = an_integer_value
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.
672 673 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 672 def yaxis_number_of_minor_intervals end |
#yaxis_numeric_label_alignment ⇒ Object
:call-seq:
yaxis_numeric_label_alignment
yaxis_numeric_label_alignment = an_alignment
The #alignment setting for numeric labels on the y axis. See also tex_yaxis_numeric_label.
854 855 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 854 def yaxis_numeric_label_alignment end |
#yaxis_numeric_label_angle ⇒ Object
:call-seq:
yaxis_numeric_label_angle
yaxis_numeric_label_angle = a_float_in_degrees
Numeric labels on the y axis are rotated by this angle from horizontal. See also tex_yaxis_numeric_label.
845 846 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 845 def yaxis_numeric_label_angle end |
#yaxis_numeric_label_decimal_digits ⇒ Object
:call-seq:
yaxis_numeric_label_decimal_digits
yaxis_numeric_label_decimal_digits = an_integer_value
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.
640 641 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 640 def yaxis_numeric_label_decimal_digits end |
#yaxis_numeric_label_frequency ⇒ Object
:call-seq:
yaxis_numeric_label_frequency
yaxis_numeric_label_frequency = an_integer
The #frequency setting for numeric labels on the y axis. Major ticks are numbered from 0 at the small y end of the axis. Tick number k gets a label only if mod(i+j,k)==0 where j=yaxis_numeric_label_phase and k=yaxis_numeric_label_frequency. The default for yaxis_numeric_label_frequency is 1 so that every major tick gets a label. See also yaxis_numeric_label_phase.
582 583 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 582 def yaxis_numeric_label_frequency end |
#yaxis_numeric_label_justification ⇒ Object
:call-seq:
yaxis_numeric_label_justification
yaxis_numeric_label_justification = a_justification
The #justification setting for numeric labels on the y axis.
863 864 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 863 def yaxis_numeric_label_justification end |
#yaxis_numeric_label_phase ⇒ Object
:call-seq:
yaxis_numeric_label_phase
yaxis_numeric_label_phase = an_integer
The #phase setting for numeric labels on the y axis. The default phase is 0. See yaxis_numeric_label_frequency for details.
592 593 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 592 def yaxis_numeric_label_phase end |
#yaxis_numeric_label_scale ⇒ Object
:call-seq:
yaxis_numeric_label_scale
yaxis_numeric_label_scale = a_float
Scaling factor relative to default_text_scale for the numeric labels on the y axis in plots. See also tex_yaxis_numeric_label.
825 826 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 825 def yaxis_numeric_label_scale end |
#yaxis_numeric_label_shift ⇒ Object
:call-seq:
yaxis_numeric_label_shift
yaxis_numeric_label_shift = a_float
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.
836 837 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 836 def yaxis_numeric_label_shift end |
#yaxis_numeric_label_tex ⇒ Object
:call-seq:
yaxis_numeric_label_tex
yaxis_numeric_label_tex = a_string
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.
323 324 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 323 def yaxis_numeric_label_tex end |
#yaxis_reversed ⇒ Object
:call-seq:
yaxis_reversed
Flag is true if the bounds_bottom is not the bounds_ymin.
91 92 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 91 def yaxis_reversed end |
#yaxis_stroke_color ⇒ Object
:call-seq:
yaxis_stroke_color
yaxis_stroke_color = color_value
Value for the stroke_color attribute when painting the y axis.
816 817 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 816 def yaxis_stroke_color end |
#yaxis_tick_interval ⇒ Object
:call-seq:
xaxis_numeric_label_decimal_digits
xaxis_numeric_label_decimal_digits = an_integer_value
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.
416 417 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 416 def yaxis_tick_interval end |
#yaxis_tick_labels ⇒ Object
:call-seq:
yaxis_tick_labels
yaxis_tick_labels = array_or_nil
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

720 721 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 720 def yaxis_tick_labels end |
#yaxis_ticks_inside ⇒ Object
:call-seq:
yaxis_ticks_inside
yaxis_ticks_inside = true_or_false
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.
759 760 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 759 def yaxis_ticks_inside end |
#yaxis_ticks_outside ⇒ Object
:call-seq:
yaxis_ticks_outside
yaxis_ticks_outside = true_or_false
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.
768 769 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 768 def yaxis_ticks_outside end |
#yaxis_type ⇒ Object
:call-seq:
yaxis_type
yaxis_type = an_axis_type_value
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.
630 631 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 630 def yaxis_type end |
#yaxis_use_fixed_pt ⇒ Object
:call-seq:
yaxis_use_fixed_pt
yaxis_use_fixed_pt = true_or_false
If this flag is true, then numeric labels for the y axis will always use fixed point notation rather than exponential. If false, then the value of yaxis_digits_max will be used to decide between fixed point or exponential notation. See also yaxis_digits_max.
663 664 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 663 def yaxis_use_fixed_pt end |
#yaxis_visible ⇒ Object
:call-seq:
yaxis_visible
yaxis_visible = false
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.
610 611 |
# File 'lib/Tioga/X_and_Y_Axes.rb', line 610 def yaxis_visible end |