tioga 1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Tioga_README +372 -0
- data/lgpl.txt +504 -0
- data/split/Dtable/defs.h +33 -0
- data/split/Dtable/dtable.c +1928 -0
- data/split/Dtable/dtable_intern.h +144 -0
- data/split/Dtable/dvector.h +61 -0
- data/split/Dtable/extconf.rb +4 -0
- data/split/Dtable/include/dtable.h +35 -0
- data/split/Dtable/lib/Dtable_extras.rb +90 -0
- data/split/Dtable/namespace.h +47 -0
- data/split/Dtable/safe_double.h +104 -0
- data/split/Dtable/symbols.c +92 -0
- data/split/Dtable/symbols.h +52 -0
- data/split/Dvector/defs.h +33 -0
- data/split/Dvector/dvector.c +5486 -0
- data/split/Dvector/dvector_intern.h +142 -0
- data/split/Dvector/extconf.rb +4 -0
- data/split/Dvector/include/dvector.h +61 -0
- data/split/Dvector/lib/Dvector_extras.rb +328 -0
- data/split/Dvector/lib/Numeric_extras.rb +134 -0
- data/split/Dvector/namespace.h +47 -0
- data/split/Dvector/safe_double.h +104 -0
- data/split/Dvector/symbols.c +92 -0
- data/split/Dvector/symbols.h +52 -0
- data/split/Flate/defs.h +33 -0
- data/split/Flate/extconf.rb +19 -0
- data/split/Flate/flate.c +156 -0
- data/split/Flate/flate_intern.h +97 -0
- data/split/Flate/include/flate.h +98 -0
- data/split/Flate/namespace.h +47 -0
- data/split/Flate/safe_double.h +104 -0
- data/split/Flate/symbols.c +92 -0
- data/split/Flate/symbols.h +52 -0
- data/split/Function/defs.h +33 -0
- data/split/Function/dvector.h +61 -0
- data/split/Function/extconf.rb +4 -0
- data/split/Function/function.c +988 -0
- data/split/Function/joint_qsort.c +258 -0
- data/split/Function/lib/Function_extras.rb +44 -0
- data/split/Function/namespace.h +47 -0
- data/split/Function/safe_double.h +104 -0
- data/split/Function/symbols.c +92 -0
- data/split/Function/symbols.h +52 -0
- data/split/Tioga/axes.c +774 -0
- data/split/Tioga/defs.h +33 -0
- data/split/Tioga/dtable.h +35 -0
- data/split/Tioga/dvector.h +61 -0
- data/split/Tioga/extconf.rb +4 -0
- data/split/Tioga/figures.c +672 -0
- data/split/Tioga/figures.h +855 -0
- data/split/Tioga/flate.h +98 -0
- data/split/Tioga/init.c +524 -0
- data/split/Tioga/lib/Arcs_and_Circles.rb +64 -0
- data/split/Tioga/lib/ColorConstants.rb +274 -0
- data/split/Tioga/lib/Colorbars.rb +10 -0
- data/split/Tioga/lib/Colormaps.rb +105 -0
- data/split/Tioga/lib/Coordinate_Conversions.rb +194 -0
- data/split/Tioga/lib/Creating_Paths.rb +94 -0
- data/split/Tioga/lib/Doc.rb +91 -0
- data/split/Tioga/lib/Executive.rb +515 -0
- data/split/Tioga/lib/FigMkr.rb +2224 -0
- data/split/Tioga/lib/FigureConstants.rb +125 -0
- data/split/Tioga/lib/Figures_and_Plots.rb +268 -0
- data/split/Tioga/lib/Images.rb +278 -0
- data/split/Tioga/lib/Legends.rb +190 -0
- data/split/Tioga/lib/MarkerConstants.rb +122 -0
- data/split/Tioga/lib/Markers.rb +129 -0
- data/split/Tioga/lib/Page_Frame_Bounds.rb +567 -0
- data/split/Tioga/lib/Rectangles.rb +94 -0
- data/split/Tioga/lib/Shading.rb +100 -0
- data/split/Tioga/lib/Special_Paths.rb +307 -0
- data/split/Tioga/lib/Strokes.rb +129 -0
- data/split/Tioga/lib/TeX_Text.rb +454 -0
- data/split/Tioga/lib/TexPreamble.rb +358 -0
- data/split/Tioga/lib/Titles_and_Labels.rb +306 -0
- data/split/Tioga/lib/Transparency.rb +89 -0
- data/split/Tioga/lib/Using_Paths.rb +164 -0
- data/split/Tioga/lib/Utils.rb +74 -0
- data/split/Tioga/lib/X_and_Y_Axes.rb +749 -0
- data/split/Tioga/lib/irb_tioga.rb +122 -0
- data/split/Tioga/lib/tioga.rb +1 -0
- data/split/Tioga/lib/tioga_ui.rb +5 -0
- data/split/Tioga/lib/tioga_ui_cmds.rb +793 -0
- data/split/Tioga/makers.c +989 -0
- data/split/Tioga/mk_tioga_sty.rb +53 -0
- data/split/Tioga/namespace.h +47 -0
- data/split/Tioga/pdf_font_dicts.c +18253 -0
- data/split/Tioga/pdfcolor.c +486 -0
- data/split/Tioga/pdfcoords.c +505 -0
- data/split/Tioga/pdffile.c +342 -0
- data/split/Tioga/pdfimage.c +536 -0
- data/split/Tioga/pdfpath.c +914 -0
- data/split/Tioga/pdfs.h +229 -0
- data/split/Tioga/pdftext.c +443 -0
- data/split/Tioga/safe_double.h +104 -0
- data/split/Tioga/symbols.c +92 -0
- data/split/Tioga/symbols.h +52 -0
- data/split/Tioga/texout.c +380 -0
- data/split/defs.h +33 -0
- data/split/extconf.rb +107 -0
- data/split/mkmf2.rb +1612 -0
- data/split/namespace.h +47 -0
- data/split/safe_double.h +104 -0
- data/split/scripts/tioga +4 -0
- data/split/symbols.c +92 -0
- data/split/symbols.h +52 -0
- data/tests/dtable_test.data +6 -0
- data/tests/dvector_read_test.data +1 -0
- data/tests/dvector_test.data +101 -0
- data/tests/tc_Dtable.rb +221 -0
- data/tests/tc_Dvector.rb +791 -0
- data/tests/tc_FMkr.rb +162 -0
- data/tests/tc_Flate.rb +45 -0
- data/tests/tc_Function.rb +111 -0
- data/tests/ts_Tioga.rb +38 -0
- metadata +163 -0
@@ -0,0 +1,190 @@
|
|
1
|
+
# Legends.rb
|
2
|
+
|
3
|
+
module Tioga
|
4
|
+
|
5
|
+
# These are the methods and attributes for plot legends.
|
6
|
+
|
7
|
+
class Legends < Doc < FigureMaker
|
8
|
+
|
9
|
+
# :call-seq:
|
10
|
+
# reset_legend_info
|
11
|
+
#
|
12
|
+
# Clears the current legend information.
|
13
|
+
def reset_legend_info
|
14
|
+
end
|
15
|
+
|
16
|
+
# Creates a vertical space of _dy_ text heights in the legend.
|
17
|
+
def save_legend_separator(dy)
|
18
|
+
end
|
19
|
+
|
20
|
+
# :call-seq:
|
21
|
+
# legend_height
|
22
|
+
#
|
23
|
+
# Returns the height (in units of text heights) of the currently saved legend information.
|
24
|
+
def legend_height
|
25
|
+
end
|
26
|
+
|
27
|
+
# :call-seq:
|
28
|
+
# show_legend
|
29
|
+
#
|
30
|
+
# Shows the legend in the current frame.
|
31
|
+
def show_legend
|
32
|
+
end
|
33
|
+
|
34
|
+
=begin rdoc
|
35
|
+
:call-seq:
|
36
|
+
save_legend_info(text)
|
37
|
+
save_legend_info(dict)
|
38
|
+
|
39
|
+
Saves information for later use in creating a legend. If called with a string as argument,
|
40
|
+
is equivalent to calling with a dictionary having a single entry with key 'text' and value the string.
|
41
|
+
|
42
|
+
Dictionary Entries
|
43
|
+
'text' => a_string # text of the legend
|
44
|
+
'line_color' => a_color # defaults to self.line_color
|
45
|
+
'line_width' => a_float # defaults to self.line_width
|
46
|
+
'line_cap' => a_line_cap # defaults to self.line_cap
|
47
|
+
'line_type' => a_line_type # defaults to self.line_type
|
48
|
+
'dy' => a_float # defaults to self.legend_text_dy
|
49
|
+
'marker' => a_marker # defaults to nil
|
50
|
+
'marker_color' => a_color # defaults to self.line_color
|
51
|
+
'marker_scale' => a_float # defaults to 0.5
|
52
|
+
'marker_dict' => a_dictionary # defaults to nil
|
53
|
+
|
54
|
+
The dictionary holding the information is appended to the legend_info array. If the 'marker' entry is present,
|
55
|
+
then the marker with the given 'marker_color' and 'marker_scale' will be shown in the middle of the
|
56
|
+
legend line. If the 'marker_dict' entry is present, it will have the values for 'x' and 'y' set to the location
|
57
|
+
of the middle of the legend line and then it will be passed to the show_marker method. This gives you the option of using
|
58
|
+
the full range of marker functionality in legends -- perhaps you'd like to use a line marker that is rotated, stretched, filled in one color, and stroked in another!
|
59
|
+
|
60
|
+
=end
|
61
|
+
def save_legend_info(arg)
|
62
|
+
end
|
63
|
+
|
64
|
+
# :call-seq:
|
65
|
+
# legend_defaults
|
66
|
+
# legend_defaults = a_dictionary
|
67
|
+
#
|
68
|
+
# This dictionary holds defaults for +show_plot_with_legend+.
|
69
|
+
def legend_defaults
|
70
|
+
end
|
71
|
+
|
72
|
+
# :call-seq:
|
73
|
+
# legend_info
|
74
|
+
#
|
75
|
+
# The current array of saved legend dictionaries. See save_legend_info for details.
|
76
|
+
def legend_info
|
77
|
+
end
|
78
|
+
|
79
|
+
# :call-seq:
|
80
|
+
# legend_line_x0
|
81
|
+
# legend_line_x0 = a_float
|
82
|
+
#
|
83
|
+
# The x position for the start of lines in a legend, measured in units
|
84
|
+
# of text height. The corresponding position in figure coordinates is
|
85
|
+
# (legend_line_x0 * legend_scale * default_text_height_dx).
|
86
|
+
def legend_line_x0
|
87
|
+
end
|
88
|
+
|
89
|
+
# :call-seq:
|
90
|
+
# legend_line_x1
|
91
|
+
# legend_line_x1 = a_float
|
92
|
+
#
|
93
|
+
# The x position for the end of lines in a legend, measured in units
|
94
|
+
# of text height. The corresponding position in figure coordinates is
|
95
|
+
# (legend_line_x1 * legend_scale * default_text_height_dx).
|
96
|
+
def legend_line_x1
|
97
|
+
end
|
98
|
+
|
99
|
+
# :call-seq:
|
100
|
+
# legend_line_dy
|
101
|
+
# legend_line_dy = a_float
|
102
|
+
#
|
103
|
+
# Each line in a legend is shifted up from the text baseline by this amount
|
104
|
+
# measured in units of text height. The corresponding distance in figure coordinates is
|
105
|
+
# (legend_line_dy * legend_scale * default_text_height_dy).
|
106
|
+
def legend_line_dy
|
107
|
+
end
|
108
|
+
|
109
|
+
# :call-seq:
|
110
|
+
# legend_text_width
|
111
|
+
# legend_text_width = a_float
|
112
|
+
#
|
113
|
+
# The assumed width of text in a legend, measured in units
|
114
|
+
# of text height. The corresponding width in figure coordinates is
|
115
|
+
# (legend_text_width * legend_scale * default_text_height_dx).
|
116
|
+
# The figure bounding box is expanded if necessary to provide for this
|
117
|
+
# much space. If legend_text_width is negative, then the system will
|
118
|
+
# provide a default value depending on the placement of the legend.
|
119
|
+
def legend_text_width
|
120
|
+
end
|
121
|
+
|
122
|
+
# :call-seq:
|
123
|
+
# legend_text_xstart
|
124
|
+
# legend_text_xstart = a_float
|
125
|
+
#
|
126
|
+
# The x position for the start of text in a legend, measured in units
|
127
|
+
# of text height. The corresponding position in figure coordinates is
|
128
|
+
# (legend_text_xstart * legend_scale * default_text_height_dx).
|
129
|
+
def legend_text_xstart
|
130
|
+
end
|
131
|
+
|
132
|
+
# :call-seq:
|
133
|
+
# legend_text_ystart
|
134
|
+
# legend_text_ystart = a_float
|
135
|
+
#
|
136
|
+
# The y position for the start of text in a legend, measured in units
|
137
|
+
# of text height. The corresponding position in figure coordinates is
|
138
|
+
# (legend_text_ystart * legend_scale * default_text_height_dy).
|
139
|
+
def legend_text_ystart
|
140
|
+
end
|
141
|
+
|
142
|
+
# :call-seq:
|
143
|
+
# legend_text_dy
|
144
|
+
# legend_text_dy = a_float
|
145
|
+
#
|
146
|
+
# The distance in y to move down after a legend line entry, measured in
|
147
|
+
# units of text height. The corresponding distance in figure coordinates is
|
148
|
+
# (legend_text_dy * legend_scale * default_text_height_dy).
|
149
|
+
def legend_text_dy
|
150
|
+
end
|
151
|
+
|
152
|
+
# :call-seq:
|
153
|
+
# legend_line_width
|
154
|
+
# legend_line_width = a_float
|
155
|
+
#
|
156
|
+
# If this is non-negative, then it is used as the line_width attribute when
|
157
|
+
# stroking the lines in a legend. If it is negative, then each legend
|
158
|
+
# line is stroked using the value of the line_width attribute at the time
|
159
|
+
# the legend information for the entry was saved by save_legend_info.
|
160
|
+
def legend_line_width
|
161
|
+
end
|
162
|
+
|
163
|
+
# :call-seq:
|
164
|
+
# legend_scale
|
165
|
+
# legend_scale = a_float
|
166
|
+
#
|
167
|
+
# Used for determining positions in the legend and for showing legend text.
|
168
|
+
def legend_scale
|
169
|
+
end
|
170
|
+
|
171
|
+
# :call-seq:
|
172
|
+
# legend_alignment
|
173
|
+
# legend_alignment = an_alignment
|
174
|
+
#
|
175
|
+
# Used as the #alignment value in showing legend text.
|
176
|
+
def legend_alignment
|
177
|
+
end
|
178
|
+
|
179
|
+
# :call-seq:
|
180
|
+
# legend_justification
|
181
|
+
# legend_justification = a_justification
|
182
|
+
#
|
183
|
+
# Used as the #justification value in showing legend text.
|
184
|
+
def legend_justification
|
185
|
+
end
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
end # class
|
190
|
+
end # module Tioga
|
@@ -0,0 +1,122 @@
|
|
1
|
+
module Tioga
|
2
|
+
|
3
|
+
# = PDF Fonts
|
4
|
+
#
|
5
|
+
# Text is normally sent to TeX, allowing you to use any font that can be accessed from your TeX documents.
|
6
|
+
# However, in certain special cases you may need to use text in a "graphical" manner and have it processed directly in the
|
7
|
+
# PDF output. In that case, tioga needs to have metric information for the font (in the form of an "afm" file), and any
|
8
|
+
# output device needs to have access to the font definitions. Providing a general solution to this is still a bit messy, and for the
|
9
|
+
# expected use in tioga, I decided that it wasn't worth it. All PDF devices are guaranteed to have the 14 standard Adobe
|
10
|
+
# fonts, so they are easy to provide -- and that's what I've done.
|
11
|
+
#
|
12
|
+
# Here are the abc's of the PDF fonts, clockwise from the top: Times_Roman, Times_Italic, Times_Bold, Times_BoldItalic, Helvetica, Helvetica_Oblique, Helvetica_Bold, Helvetica_BoldOblique, Courier, Courier_Oblique, Courier_Bold, Courier_BoldOblique, Symbol, and ZapfDingbats.
|
13
|
+
#
|
14
|
+
# http://theory.kitp.ucsb.edu/~paxton/tioga_jpegs/pdf_fonts.jpg
|
15
|
+
#
|
16
|
+
# ---
|
17
|
+
#
|
18
|
+
# = Markers
|
19
|
+
#
|
20
|
+
# Any character from any of the PDF fonts can be used as a marker.
|
21
|
+
# The predefined marker names are provided as a convenience, not as an exhaustive list. Markers are specified by
|
22
|
+
# either a font number and character code (for filled characters), or by a font number, character code, and line
|
23
|
+
# width (for stroked characters). In the following figure many of the markers appear in both a filled form, such
|
24
|
+
# as 'Arrow', and a stroked form, such as 'ArrowOpen'. The color of filled markers is determined by the current
|
25
|
+
# setting of fill_color, and, similarly, stroke_color determines the color of stroked markers.
|
26
|
+
#
|
27
|
+
# http://theory.kitp.ucsb.edu/~paxton/tioga_jpegs/Marker_Names.jpg
|
28
|
+
#
|
29
|
+
# Here is the full set of options from the ZapfDingbats font. If you would like to use the jet plane as a marker,
|
30
|
+
# just write [ ZapfDingbats, 40 ] where you would have used one of the predefined marker names.
|
31
|
+
#
|
32
|
+
# http://theory.kitp.ucsb.edu/~paxton/tioga_jpegs/dingbats.jpg
|
33
|
+
#
|
34
|
+
|
35
|
+
module MarkerConstants
|
36
|
+
|
37
|
+
Times_Roman = 1
|
38
|
+
Times_Italic = 2
|
39
|
+
Times_Bold = 3
|
40
|
+
Times_BoldItalic = 4
|
41
|
+
Helvetica = 5
|
42
|
+
Helvetica_Oblique = 6
|
43
|
+
Helvetica_Bold = 7
|
44
|
+
Helvetica_BoldOblique = 8
|
45
|
+
Courier = 9
|
46
|
+
Courier_Oblique = 10
|
47
|
+
Courier_Bold = 11
|
48
|
+
Courier_BoldOblique = 12
|
49
|
+
Symbol = 13
|
50
|
+
ZapfDingbats = 14
|
51
|
+
|
52
|
+
Arrow = [ZapfDingbats, 0334]
|
53
|
+
Arrowhead = [ZapfDingbats, 0344]
|
54
|
+
Asterisk = [ZapfDingbats, 0135]
|
55
|
+
Bar = [ZapfDingbats, 0171]
|
56
|
+
BarThick = [ZapfDingbats, 0172]
|
57
|
+
BarThin = [ZapfDingbats, 0170]
|
58
|
+
Box = [ZapfDingbats, 0156]
|
59
|
+
Bullet = [ZapfDingbats, 0154]
|
60
|
+
Check = [ZapfDingbats, 0064]
|
61
|
+
Circle = [ZapfDingbats, 0154]
|
62
|
+
Club = [ZapfDingbats, 0250]
|
63
|
+
Cross = [ZapfDingbats, 0072]
|
64
|
+
Diamond = [ZapfDingbats, 0251]
|
65
|
+
Semicircle = [ZapfDingbats, 0167]
|
66
|
+
Heart = [ZapfDingbats, 0252]
|
67
|
+
HeartWide = [ZapfDingbats, 0244]
|
68
|
+
Spade = [ZapfDingbats, 0253]
|
69
|
+
Square = [ZapfDingbats, 0156]
|
70
|
+
Star = [ZapfDingbats, 0110]
|
71
|
+
TriangleDown = [ZapfDingbats, 0164]
|
72
|
+
TriangleUp = [ZapfDingbats, 0163]
|
73
|
+
Plus = [ZapfDingbats, 0072]
|
74
|
+
Times = [ZapfDingbats, 0066]
|
75
|
+
|
76
|
+
ArrowOpen = [ZapfDingbats, 0334, 0.5]
|
77
|
+
ArrowheadOpen = [ZapfDingbats, 0344, 0.5]
|
78
|
+
AsteriskOpen = [ZapfDingbats, 0135, 0.5]
|
79
|
+
BarOpen = [ZapfDingbats, 0172, 0.5]
|
80
|
+
BarThickOpen = [ZapfDingbats, 0172, 0.5]
|
81
|
+
BarThinOpen = [ZapfDingbats, 0170, 0.5]
|
82
|
+
BoxOpen = [ZapfDingbats, 0156, 0.5]
|
83
|
+
BulletOpen = [ZapfDingbats, 0154, 0.5]
|
84
|
+
CheckOpen = [ZapfDingbats, 0064, 0.5]
|
85
|
+
CircleOpen = [ZapfDingbats, 0154, 0.5]
|
86
|
+
ClubOpen = [ZapfDingbats, 0250, 0.5]
|
87
|
+
DiamondOpen = [ZapfDingbats, 0251, 0.5]
|
88
|
+
SemicircleOpen = [ZapfDingbats, 0167, 0.5]
|
89
|
+
HeartOpen = [ZapfDingbats, 0252, 0.5]
|
90
|
+
HeartWideOpen = [ZapfDingbats, 0244, 0.5]
|
91
|
+
SpadeOpen = [ZapfDingbats, 0253, 0.5]
|
92
|
+
SquareOpen = [ZapfDingbats, 0156, 0.5]
|
93
|
+
StarOpen = [ZapfDingbats, 0110, 0.5]
|
94
|
+
TriangleDownOpen = [ZapfDingbats, 0164, 0.5]
|
95
|
+
TriangleUpOpen = [ZapfDingbats, 0163, 0.5]
|
96
|
+
PlusOpen = [ZapfDingbats, 0072, 0.5]
|
97
|
+
TimesOpen = [ZapfDingbats, 0066, 0.5]
|
98
|
+
Circled1 = [ZapfDingbats, 0300]
|
99
|
+
Circled2 = [ZapfDingbats, 0301]
|
100
|
+
Circled3 = [ZapfDingbats, 0302]
|
101
|
+
Circled4 = [ZapfDingbats, 0303]
|
102
|
+
Circled5 = [ZapfDingbats, 0304]
|
103
|
+
Circled6 = [ZapfDingbats, 0305]
|
104
|
+
Circled7 = [ZapfDingbats, 0306]
|
105
|
+
Circled8 = [ZapfDingbats, 0307]
|
106
|
+
Circled9 = [ZapfDingbats, 0310]
|
107
|
+
Circled10 = [ZapfDingbats, 0311]
|
108
|
+
SolidBall1 = [ZapfDingbats, 0312]
|
109
|
+
SolidBall2 = [ZapfDingbats, 0313]
|
110
|
+
SolidBall3 = [ZapfDingbats, 0314]
|
111
|
+
SolidBall4 = [ZapfDingbats, 0315]
|
112
|
+
SolidBall5 = [ZapfDingbats, 0316]
|
113
|
+
SolidBall6 = [ZapfDingbats, 0317]
|
114
|
+
SolidBall7 = [ZapfDingbats, 0320]
|
115
|
+
SolidBall8 = [ZapfDingbats, 0321]
|
116
|
+
SolidBall9 = [ZapfDingbats, 0322]
|
117
|
+
SolidBall10 = [ZapfDingbats, 0323]
|
118
|
+
Hand = [ZapfDingbats, 0052]
|
119
|
+
OtherHand = [ZapfDingbats, 0053]
|
120
|
+
|
121
|
+
end
|
122
|
+
end # module Tioga
|
@@ -0,0 +1,129 @@
|
|
1
|
+
# Markers.rb
|
2
|
+
|
3
|
+
module Tioga
|
4
|
+
|
5
|
+
# These are the methods for using text as markers in PDF graphics. See also the predefined markers in #MarkerConstants.
|
6
|
+
|
7
|
+
class Markers < Doc < FigureMaker
|
8
|
+
|
9
|
+
=begin rdoc
|
10
|
+
This routine takes care of text that is being used as a graphical element and consequently is going
|
11
|
+
straight to PDF rather than to TeX for normal typesetting (see show_text).
|
12
|
+
|
13
|
+
The most common use of markers is probably to mark points on plots (hence the name). The ZapfDingbats font
|
14
|
+
provides a useful collection for this purpose, and several glyphs from it are provided as predefined markers
|
15
|
+
(see #MarkerConstants).
|
16
|
+
A marker of this sort is represented either by an array of [ font_number, character_code ] for filled markers, or by
|
17
|
+
an array holding [ font_number, character_code, line_width ] for stroked markers. Often the same character
|
18
|
+
can be used both for a filled marker and for an open one. For example, the predefined markers include
|
19
|
+
Box and Circle (filled) as well as the same glyphs as BoxOpen and CircleOpen (stroked).
|
20
|
+
|
21
|
+
For the primary purpose of marking points on plots, we could stop with just single characters taken from
|
22
|
+
ZapfDingbats. However, for not much more effort, we can broaden this to allow strings of characters
|
23
|
+
and fonts other than the dingbats. But the usefulness of this is limited given that typesetting is
|
24
|
+
properly done using TeX, and the problems of dealing with fonts in general are notoriously awful.
|
25
|
+
So the compromise is to allow markers using any of the 14 standard Adobe PDF
|
26
|
+
fonts which are guaranteed to be supported by all PDF viewers and to toss in for good measure some
|
27
|
+
Computer Modern fonts which are likely to be around since they come with TeX. These fonts are predefined
|
28
|
+
in the FigureConstants module. Any character (or string of characters) from any of these fonts can be used as a marker.
|
29
|
+
|
30
|
+
Because markers are sent to PDF rather than TeX, they are limited typographically but powerful graphically.
|
31
|
+
In addition to specifying color, scale, and rotatation, as you can for TeX text, you can also stretch
|
32
|
+
the characters either along the baseline ('horizontal_scale') or perpendicular to it ('vertical_scale').
|
33
|
+
You can slant the individual characters ('italic_angle') or shift the baseline along the text ('ascent_angle').
|
34
|
+
Finally, you can specify the 'rendering_mode' for the marker to be any combination of #fill, #stroke, and #clip.
|
35
|
+
(So for next Valentine's Day you can take a Heart marker, scale it up, and use it to clip a JPEG image of yourself
|
36
|
+
to send to your sweetheart.)
|
37
|
+
|
38
|
+
Defaults for many of the entries come from the marker_defaults dictionary.
|
39
|
+
|
40
|
+
Dictionary Entries
|
41
|
+
'marker' => a_marker # a marker definition array
|
42
|
+
'x' => a_float # x location for marker reference point
|
43
|
+
'y' => a_float # y location for marker reference point
|
44
|
+
'at' => [ x, y ] # location for marker reference point
|
45
|
+
'point' # alias for 'at'
|
46
|
+
'Xs' => a_Dvector # x locations for marker reference points
|
47
|
+
'Ys' => a_Dvector # y locations for marker reference points
|
48
|
+
'xs' # alias for 'Xs'
|
49
|
+
'ys' # alias for 'Ys'
|
50
|
+
'font' => an_integer # one of the predefined font numbers
|
51
|
+
'string' => a_string # to be shown as a marker
|
52
|
+
'text' # alias for 'string'
|
53
|
+
'fill_color' => a_color # to be used for filled markers
|
54
|
+
'stroke_color' => a_color # to be used for stroked markers
|
55
|
+
'color' => a_color # default for fill_color and stroke_color
|
56
|
+
'angle' => a_float # degrees to rotate marker
|
57
|
+
'scale' => a_float # factor for rescaling marker size
|
58
|
+
'horizontal_scale' => a_float # for scaling along baseline
|
59
|
+
'vertical_scale' => a_float # for scaling vertical to baseline
|
60
|
+
'italic_angle' => a_float # for slanting text relative to baseline
|
61
|
+
'ascent_angle' => a_float # factor for slanting baseline
|
62
|
+
'alignment' => an_alignment # see alignment
|
63
|
+
'justification' => a_justification # see justification
|
64
|
+
'rendering_mode' => a_rendering_mode # see below
|
65
|
+
'stroke_width' => a_float # to be used for stroked markers
|
66
|
+
'mode' # alias for 'rendering_mode'
|
67
|
+
|
68
|
+
|
69
|
+
Examples
|
70
|
+
|
71
|
+
http://theory.kitp.ucsb.edu/~paxton/tioga_jpegs/Marker_Horizontal_Scaling.jpg
|
72
|
+
|
73
|
+
http://theory.kitp.ucsb.edu/~paxton/tioga_jpegs/Marker_Vertical_Scaling.jpg
|
74
|
+
|
75
|
+
http://theory.kitp.ucsb.edu/~paxton/tioga_jpegs/Marker_Italic_Angle.jpg
|
76
|
+
|
77
|
+
http://theory.kitp.ucsb.edu/~paxton/tioga_jpegs/Marker_Ascent_Angle.jpg
|
78
|
+
|
79
|
+
http://theory.kitp.ucsb.edu/~paxton/tioga_jpegs/Rendering_Modes.jpg
|
80
|
+
|
81
|
+
def marker_shadow_effect
|
82
|
+
t.landscape
|
83
|
+
background
|
84
|
+
scale = 2.6
|
85
|
+
t.line_width = 0.6
|
86
|
+
x = t.bounds_xmin + 0.5 * t.bounds_width
|
87
|
+
dy = -0.5; y = 1 + dy;
|
88
|
+
t.show_marker(
|
89
|
+
'string' => 'Shadow Effect',
|
90
|
+
'scale' => scale,
|
91
|
+
'point' => [x, y],
|
92
|
+
'mode' => FILL_AND_STROKE,
|
93
|
+
'alignment' => ALIGNED_AT_BASELINE,
|
94
|
+
'fill_color' => Blue,
|
95
|
+
'stroke_color' => Black)
|
96
|
+
t.fill_opacity = 0.8
|
97
|
+
t.show_marker(
|
98
|
+
'string' => 'Shadow Effect',
|
99
|
+
'vertical_scale' => -0.4,
|
100
|
+
'fill_color' => Grey,
|
101
|
+
'italic_angle' => -30,
|
102
|
+
'scale' => scale,
|
103
|
+
'point' => [x+0.022, y-0.03])
|
104
|
+
end
|
105
|
+
|
106
|
+
http://theory.kitp.ucsb.edu/~paxton/tioga_jpegs/Marker_Shadow_Effect.jpg
|
107
|
+
|
108
|
+
=end
|
109
|
+
def show_marker(dict)
|
110
|
+
end
|
111
|
+
|
112
|
+
# Returns an array with [_width_, <i>dx_left</i>, <i>dx_right</i>, <i>dy_down</i>, <i>dy_up</i>] given in
|
113
|
+
# figure coordinates. The first is the width in figure x coordinates, the remainder is the bounding box
|
114
|
+
# relative to the reference point for showing the string.
|
115
|
+
def marker_string_info(font_number, string, scale)
|
116
|
+
end
|
117
|
+
|
118
|
+
# :call-seq:
|
119
|
+
# marker_defaults
|
120
|
+
# marker_defaults = a_dictionary
|
121
|
+
#
|
122
|
+
# This dictionary holds defaults for +show_marker+.
|
123
|
+
def marker_defaults
|
124
|
+
end
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
end # class
|
129
|
+
end # module Tioga
|
@@ -0,0 +1,567 @@
|
|
1
|
+
# Page_Frame_Bounds.rb
|
2
|
+
|
3
|
+
module Tioga
|
4
|
+
|
5
|
+
=begin rdoc
|
6
|
+
|
7
|
+
This section describes the coordinate systems used by tioga for page layout.
|
8
|
+
|
9
|
+
The "output page" is defined in "output coordinates"
|
10
|
+
having units equal to 1/720 of an inch. This unit is 1/10 of a "big point" that is the basic size used in PostScript and PDF.
|
11
|
+
By making the unit this size, we can write output coordinates to the PDF file as integers, getting a significant size reduction in
|
12
|
+
the file without giving up noticable accuracy. The (0, 0) point of the output coordinate system is at the lower-left hand corner
|
13
|
+
of the output page. The x axis increases horizontally, and the y axis increases vertically. The dimensions of the page
|
14
|
+
are given by the attributes page_width and page_height.
|
15
|
+
The attributes page_right and page_top are aliases for these.
|
16
|
+
The attributes page_left and page_bottom are always zero. The default page size is 5 inches square,
|
17
|
+
but you can set the size to anything you like using the set_device_pagesize routine.
|
18
|
+
|
19
|
+
While the output coordinates have a fixed physical size, all the other coordinate systems are relative rather than absolute.
|
20
|
+
At the next level comes "page coordinates" that are defined relative to the output page with (0, 0) in page coordinates
|
21
|
+
at the lower left corner of the output page and (1, 1) at the upper right. Page coordinates are used to define the location of
|
22
|
+
the current "frame". The current frame location is held in the attributes frame_left, frame_right, frame_top, and frame_bottom,
|
23
|
+
all in page coordinates. In addition, the attribute frame_width is defined to be frame_right - frame_left, and frame_height is frame_top -
|
24
|
+
frame_bottom. The defaults are (0.2, 0.2) for the lower left corner of the frame and (0.8, 0.8) for the upper right.
|
25
|
+
You can change these by calling the routine set_frame_sides.
|
26
|
+
|
27
|
+
The "frame coordinates" are defined with (0, 0) at the lower left corner of the frame and (1, 1) at the upper right. Subframes are
|
28
|
+
sized and located using frame coordinates. The routine set_subframe does this job. In addition, subframes are used to
|
29
|
+
give a desired aspect ratio. The routine set_aspect_ratio_relative_to_frame does this in terms of frame coordinates -- in
|
30
|
+
other words, it creates a subframe having the requested ratio of width to height relative to the frame. In some cases
|
31
|
+
that will be what you want, but it is more common to want to specify the width to height ratio relative to the output page, i.e.,
|
32
|
+
in absolute rather than relative terms. This is provided by the routine set_physical_aspect_ratio (with set_aspect_ratio as an alias).
|
33
|
+
|
34
|
+
When doing a plot, you want yet another coordinate system, one that matches the data. This is called the "figure coordinate system"
|
35
|
+
and is set by the "bounds" attributes that give the locations in figure coordinates of the edges of the frame. These attributes are
|
36
|
+
called bounds_right, bounds_left, bounds_top, and bounds_bottom. Note that you can "reverse" the x axis, for example, by making
|
37
|
+
bounds_right smaller than bounds_left. To help with the bookkeeping for this, the attribute bounds_xmin holds the minimum
|
38
|
+
of bounds_left and bounds_right, while bounds_ymin has the minimum of bounds_top and bounds_bottom. Finally, bounds_width holds
|
39
|
+
the absolute value of bounds_right - bounds_left and bounds_height has abs(bounds_top - bounds_bottom). The default bounds
|
40
|
+
are 0 for left and bottom and 1 for right and top, making figure coordinates identical to frame coordinates. The bounds can be
|
41
|
+
changed by calling the set_bounds routine.
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
=end
|
50
|
+
|
51
|
+
|
52
|
+
class Page_Frame_Bounds < Doc < FigureMaker
|
53
|
+
|
54
|
+
# :call-seq:
|
55
|
+
# set_device_pagesize(width, height) # measured in output page coordinates (1/720 inch)
|
56
|
+
#
|
57
|
+
# The page coordinates go from 0.0 to 1.0 with (0,0) at the lower left and (1,1) at the upper right.
|
58
|
+
# This command sets the physical size of this rectangle in the output coordinate
|
59
|
+
def set_device_pagesize(width, height)
|
60
|
+
end
|
61
|
+
|
62
|
+
# :call-seq:
|
63
|
+
# page_left
|
64
|
+
#
|
65
|
+
# The position of the left of the page in the device coordinate system -- measured in output page coordinates (1/720 inch).
|
66
|
+
def page_left
|
67
|
+
end
|
68
|
+
|
69
|
+
# :call-seq:
|
70
|
+
# page_right
|
71
|
+
#
|
72
|
+
# The position of the right of the page in the device coordinate system -- measured in output page coordinates (1/720 inch).
|
73
|
+
def page_right
|
74
|
+
end
|
75
|
+
|
76
|
+
# :call-seq:
|
77
|
+
# page_bottom
|
78
|
+
#
|
79
|
+
# The position of the bottom of the page in the device coordinate system -- measured in output page coordinates (1/720 inch).
|
80
|
+
def page_bottom
|
81
|
+
end
|
82
|
+
|
83
|
+
# :call-seq:
|
84
|
+
# page_top
|
85
|
+
#
|
86
|
+
# The position of the top of the page in the device coordinate system -- measured in output page coordinates (1/720 inch).
|
87
|
+
def page_top
|
88
|
+
end
|
89
|
+
|
90
|
+
# :call-seq:
|
91
|
+
# page_width
|
92
|
+
#
|
93
|
+
# The width of the page in the device coordinate system -- measured in output page coordinates (1/720 inch).
|
94
|
+
def page_width
|
95
|
+
end
|
96
|
+
|
97
|
+
# :call-seq:
|
98
|
+
# page_height
|
99
|
+
#
|
100
|
+
# The height of the page in the device coordinate system -- measured in output page coordinates (1/720 inch).
|
101
|
+
def page_height
|
102
|
+
end
|
103
|
+
|
104
|
+
|
105
|
+
# :call-seq:
|
106
|
+
# set_frame_sides(left, right, top, bottom) # sizes in page coords [0..1]
|
107
|
+
#
|
108
|
+
# This command sets frame_left, frame_right, frame_top, and frame_bottom to the given values.
|
109
|
+
def set_frame_sides(left, right, top, bottom)
|
110
|
+
end
|
111
|
+
|
112
|
+
# :call-seq:
|
113
|
+
# frame_left
|
114
|
+
#
|
115
|
+
# The position of the left of the frame in the page x coordinate system which runs from 0 at the left to 1 at the right.
|
116
|
+
# Initialized to 0.2 and changed by set_subframe.
|
117
|
+
def frame_left
|
118
|
+
end
|
119
|
+
|
120
|
+
# :call-seq:
|
121
|
+
# frame_right
|
122
|
+
#
|
123
|
+
# The position of the right of the frame in the page x coordinate system which runs from 0 at the left to 1 at the right.
|
124
|
+
# Initialized to 0.8 and changed by set_subframe.
|
125
|
+
def frame_right
|
126
|
+
end
|
127
|
+
|
128
|
+
# :call-seq:
|
129
|
+
# frame_bottom
|
130
|
+
#
|
131
|
+
# The position of the bottom of the frame in the page y coordinate system which runs from 0 at the bottom to 1 at the top.
|
132
|
+
# Initialized to 0.2 and changed by set_subframe.
|
133
|
+
def frame_bottom
|
134
|
+
end
|
135
|
+
|
136
|
+
# :call-seq:
|
137
|
+
# frame_top
|
138
|
+
#
|
139
|
+
# The position of the top of the frame in the page y coordinate system which runs from 0 at the bottom to 1 at the top.
|
140
|
+
# Initialized to 0.8 and changed by set_subframe.
|
141
|
+
def frame_top
|
142
|
+
end
|
143
|
+
|
144
|
+
# :call-seq:
|
145
|
+
# frame_width
|
146
|
+
#
|
147
|
+
# The width of the frame in page coordinates.
|
148
|
+
# Initialized to 0.6 and changed by set_subframe.
|
149
|
+
def frame_width
|
150
|
+
end
|
151
|
+
|
152
|
+
# :call-seq:
|
153
|
+
# frame_height
|
154
|
+
#
|
155
|
+
# The height of the frame in page coordinates.
|
156
|
+
# Initialized to 0.6 and changed by set_subframe.
|
157
|
+
def frame_height
|
158
|
+
end
|
159
|
+
|
160
|
+
# :call-seq:
|
161
|
+
# bounds_left
|
162
|
+
#
|
163
|
+
# The position of the left of the frame in the figure coordinate system.
|
164
|
+
# Initialized to 0.0 and changed by set_bounds.
|
165
|
+
def bounds_left
|
166
|
+
end
|
167
|
+
|
168
|
+
# :call-seq:
|
169
|
+
# bounds_right
|
170
|
+
#
|
171
|
+
# The position of the right of the frame in the figure coordinate system.
|
172
|
+
# Initialized to 1.0 and changed by set_bounds.
|
173
|
+
def bounds_right
|
174
|
+
end
|
175
|
+
|
176
|
+
# :call-seq:
|
177
|
+
# bounds_bottom
|
178
|
+
#
|
179
|
+
# The position of the bottom of the frame in the figure coordinate system.
|
180
|
+
# Initialized to 0.0 and changed by set_bounds.
|
181
|
+
def bounds_bottom
|
182
|
+
end
|
183
|
+
|
184
|
+
# :call-seq:
|
185
|
+
# bounds_top
|
186
|
+
#
|
187
|
+
# The position of the top of the frame in the figure coordinate system.
|
188
|
+
# Initialized to 1.0 and changed by set_bounds.
|
189
|
+
def bounds_top
|
190
|
+
end
|
191
|
+
|
192
|
+
# :call-seq:
|
193
|
+
# bounds_width
|
194
|
+
#
|
195
|
+
# The width of the frame in figure coordinates.
|
196
|
+
# Initialized to 1.0 and changed by set_bounds.
|
197
|
+
def bounds_width
|
198
|
+
end
|
199
|
+
|
200
|
+
# :call-seq:
|
201
|
+
# bounds_height
|
202
|
+
#
|
203
|
+
# The height of the frame in figure coordinates.
|
204
|
+
# Initialized to 1.0 and changed by set_bounds.
|
205
|
+
def bounds_height
|
206
|
+
end
|
207
|
+
|
208
|
+
# :call-seq:
|
209
|
+
# bounds_xmin
|
210
|
+
#
|
211
|
+
# The minimum x figure coordinate that is inside the frame.
|
212
|
+
# Initialized to 0.0 and changed by set_bounds.
|
213
|
+
def bounds_xmin
|
214
|
+
end
|
215
|
+
|
216
|
+
# :call-seq:
|
217
|
+
# bounds_xmax
|
218
|
+
#
|
219
|
+
# The maximum x figure coordinate that is inside the frame.
|
220
|
+
# Initialized to 1.0 and changed by set_bounds.
|
221
|
+
def bounds_xmax
|
222
|
+
end
|
223
|
+
|
224
|
+
# :call-seq:
|
225
|
+
# bounds_ymin
|
226
|
+
#
|
227
|
+
# The minimum y figure coordinate that is inside the frame.
|
228
|
+
# Initialized to 0.0 and changed by set_bounds.
|
229
|
+
def bounds_ymin
|
230
|
+
end
|
231
|
+
|
232
|
+
# :call-seq:
|
233
|
+
# bounds_ymax
|
234
|
+
#
|
235
|
+
# The maximum y figure coordinate that is inside the frame.
|
236
|
+
# Initialized to 1.0 and changed by set_bounds.
|
237
|
+
def bounds_ymax
|
238
|
+
end
|
239
|
+
|
240
|
+
=begin rdoc
|
241
|
+
Adjusts frame margins according to the entries in the dictionary argument.
|
242
|
+
Note that this does not automatically adjust the clipping rectangle to the new frame.
|
243
|
+
If you want the clipping changed, call clip_to_frame after calling set_subframe.
|
244
|
+
|
245
|
+
Dictionary Entries
|
246
|
+
'left_margin' => a_float # optional
|
247
|
+
'right_margin' => a_float # optional
|
248
|
+
'top_margin' => a_float # optional
|
249
|
+
'bottom_margin' => a_float # optional
|
250
|
+
'left' # alias for 'left_margin'
|
251
|
+
'right' # alias for 'right_margin'
|
252
|
+
'top' # alias for 'top_margin'
|
253
|
+
'bottom' # alias for 'bottom_margin'
|
254
|
+
|
255
|
+
The following forms are also supported for calls to set_subframe:
|
256
|
+
|
257
|
+
set_subframe('margins' => [ left, right, top, bottom ])
|
258
|
+
set_subframe([ left, right, top, bottom ])
|
259
|
+
|
260
|
+
=end
|
261
|
+
def set_subframe(dict=nil)
|
262
|
+
end
|
263
|
+
|
264
|
+
=begin rdoc
|
265
|
+
Returns a dictionary with entries for 'left_margin' and 'right_margin' suitable for use with
|
266
|
+
set_subframe. The margins are determined by the column specifications in the argument _dict_.
|
267
|
+
The leftmost column is number 1 and the number of columns equals the column number for the rightmost column.
|
268
|
+
The entries 'left_margin' and 'right_margin' determine the space outside the columns, and 'column_margin' is the space between
|
269
|
+
columns, all given as fractions of the frame width. The space between the outer margins is divided to make room
|
270
|
+
for 'num_columns' of equally wide columns. The returned margins bracket the requested 'column', or the
|
271
|
+
requested range of columns from 'first_column' to 'last_column', inclusive. See also row_margins.
|
272
|
+
|
273
|
+
Dictionary Entries
|
274
|
+
'left_margin' => a_float # default is 0
|
275
|
+
'right_margin' => a_float # default is 0
|
276
|
+
'column_margin' => a_float # default is 0
|
277
|
+
'column' => an_integer
|
278
|
+
'first_column' => an_integer # default is 1
|
279
|
+
'last_column' => an_integer # default is 'first_column'
|
280
|
+
'num_columns' => an_integer # default is 'last_column'
|
281
|
+
|
282
|
+
Example
|
283
|
+
|
284
|
+
def columns
|
285
|
+
t.set_aspect_ratio(2)
|
286
|
+
t.rescale(0.8)
|
287
|
+
t.do_box_labels(
|
288
|
+
'Blues, Reds, Greens',
|
289
|
+
'Position',
|
290
|
+
'Values for Colors')
|
291
|
+
num_plots = 3
|
292
|
+
t.subplot(t.column_margins('num_columns' => 3, 'column' => 1)) do
|
293
|
+
t.right_edge_type = AXIS_HIDDEN
|
294
|
+
blues
|
295
|
+
end
|
296
|
+
t.subplot(t.column_margins('num_columns' => 3, 'column' => 2)) do
|
297
|
+
t.yaxis_type = AXIS_WITH_TICKS_ONLY
|
298
|
+
t.right_edge_type = AXIS_HIDDEN
|
299
|
+
reds
|
300
|
+
end
|
301
|
+
t.subplot(t.column_margins('num_columns' => 3, 'column' => 3)) do
|
302
|
+
t.yaxis_type = AXIS_WITH_TICKS_ONLY
|
303
|
+
t.right_edge_type = AXIS_WITH_TICKS_ONLY
|
304
|
+
greens
|
305
|
+
end
|
306
|
+
end
|
307
|
+
|
308
|
+
http://theory.kitp.ucsb.edu/~paxton/tioga_jpegs/Columns.jpg
|
309
|
+
=end
|
310
|
+
def column_margins(dict)
|
311
|
+
end
|
312
|
+
|
313
|
+
=begin rdoc
|
314
|
+
Returns a dictionary with entries for 'top_margin' and 'bottom_margin' suitable for use with
|
315
|
+
set_subframe. The margins are determined by the row specifications in the argument _dict_.
|
316
|
+
The uppermost row is number 1 and the number of rows equals the row number for the bottom-most row.
|
317
|
+
The entries 'top_margin' and 'bottom_margin' determine the space above and below the rows, and 'row_margin' is the space between
|
318
|
+
rows, all given as fractions of the frame height. The space between the outer margins is divided to make room
|
319
|
+
for 'num_rows' of equally tall rows. The returned margins bracket the requested 'row', or the
|
320
|
+
requested range of rows from 'first_row' to 'last_row', inclusive. See also column_margins.
|
321
|
+
|
322
|
+
Dictionary Entries
|
323
|
+
'top_margin' => a_float # default is 0
|
324
|
+
'bottom_margin' => a_float # default is 0
|
325
|
+
'row_margin' => a_float # default is 0
|
326
|
+
'row' => an_integer
|
327
|
+
'first_row' => an_integer # default is 1
|
328
|
+
'last_row' => an_integer # default is 'first_row'
|
329
|
+
'num_rows' => an_integer # default is 'last_row'
|
330
|
+
|
331
|
+
=end
|
332
|
+
def row_margins(dict)
|
333
|
+
end
|
334
|
+
|
335
|
+
=begin rdoc
|
336
|
+
Sets the bounds according to the entries in the dictionary argument (called by show_plot).
|
337
|
+
|
338
|
+
The values of the entries
|
339
|
+
are the figure coordinates for the edges of the frame. The following attributes are changed:
|
340
|
+
bounds_left, bounds_right, bounds_bottom, bounds_top, xaxis_reversed, bounds_xmin, bounds_xmax,
|
341
|
+
bounds_width, yaxis_reversed, bounds_ymin, bounds_ymax, bounds_height,
|
342
|
+
default_text_height_dx, and default_text_height_dy.
|
343
|
+
|
344
|
+
Dictionary Entries
|
345
|
+
'bounds_left' => a_float # required
|
346
|
+
'bounds_right' => a_float # required
|
347
|
+
'bounds_top' => a_float # required
|
348
|
+
'bounds_bottom' => a_float # required
|
349
|
+
'left_boundary' # alias for 'bounds_left'
|
350
|
+
'right_boundary' # alias for 'bounds_right'
|
351
|
+
'top_boundary' # alias for 'bounds_top'
|
352
|
+
'bottom_boundary' # alias for 'bounds_bottom'
|
353
|
+
|
354
|
+
The following forms are also supported for calls to set_bounds:
|
355
|
+
|
356
|
+
set_bounds('boundaries' => [ left, right, top, bottom ])
|
357
|
+
set_bounds([ left, right, top, bottom ])
|
358
|
+
|
359
|
+
=end
|
360
|
+
def set_bounds(dict=nil)
|
361
|
+
end
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
# Convert the distance _d_ measured in output coordinates to millimeters.
|
366
|
+
def convert_output_to_mm(d)
|
367
|
+
end
|
368
|
+
|
369
|
+
# Convert the distance _d_ measured in millimeters to output coordinates.
|
370
|
+
def convert_mm_to_output(d)
|
371
|
+
end
|
372
|
+
|
373
|
+
# Convert the distance _d_ measured in output coordinates to inches.
|
374
|
+
def convert_output_to_inches(d)
|
375
|
+
end
|
376
|
+
|
377
|
+
# Convert the distance _d_ measured in inches to output coordinates.
|
378
|
+
def convert_inches_to_output(d)
|
379
|
+
end
|
380
|
+
|
381
|
+
|
382
|
+
# Convert the position _x_ measured in page x coordinates to the
|
383
|
+
# position in output x coordinates.
|
384
|
+
def convert_page_to_output_x(x)
|
385
|
+
end
|
386
|
+
|
387
|
+
|
388
|
+
# Convert the position _y_ measured in page y coordinates to the
|
389
|
+
# position in output y coordinates.
|
390
|
+
def convert_page_to_output_y(y)
|
391
|
+
end
|
392
|
+
|
393
|
+
# Convert the distance _dx_ measured in page x coordinates to the
|
394
|
+
# distance in output x coordinates.
|
395
|
+
def convert_page_to_output_dx(dx)
|
396
|
+
end
|
397
|
+
|
398
|
+
# Convert the distance _dy_ measured in page y coordinates to the
|
399
|
+
# distance in output y coordinates.
|
400
|
+
def convert_page_to_output_dy(dy)
|
401
|
+
end
|
402
|
+
|
403
|
+
# Convert the position _x_ measured in output x coordinates to the
|
404
|
+
# position in page x coordinates.
|
405
|
+
def convert_output_to_page_x(x)
|
406
|
+
end
|
407
|
+
|
408
|
+
# Convert the position _y_ measured in output y coordinates to the
|
409
|
+
# position in page y coordinates.
|
410
|
+
def convert_output_to_page_y(y)
|
411
|
+
end
|
412
|
+
|
413
|
+
# Convert the distance _dx_ measured in output x coordinates to the
|
414
|
+
# distance in page x coordinates.
|
415
|
+
def convert_output_to_page_dx(dx)
|
416
|
+
end
|
417
|
+
|
418
|
+
# Convert the distance _dy_ measured in output y coordinates to the same
|
419
|
+
# distance in page y coordinates.
|
420
|
+
def convert_output_to_page_dy(dy)
|
421
|
+
end
|
422
|
+
|
423
|
+
# Convert the position _x_ measured in page x coordinates to the
|
424
|
+
# position in frame x coordinates.
|
425
|
+
def convert_page_to_frame_x(x)
|
426
|
+
end
|
427
|
+
|
428
|
+
# Convert the position _y_ measured in page y coordinates to the
|
429
|
+
# position in frame y coordinates.
|
430
|
+
def convert_page_to_frame_y(y)
|
431
|
+
end
|
432
|
+
|
433
|
+
# Convert the distance _dx_ measured in page x coordinates to the
|
434
|
+
# distance in frame x coordinates.
|
435
|
+
def convert_page_to_frame_dx(dx)
|
436
|
+
end
|
437
|
+
|
438
|
+
# Convert the distance _dy_ measured in page y coordinates to the
|
439
|
+
# distance in frame y coordinates.
|
440
|
+
def convert_page_to_frame_dy(dy)
|
441
|
+
end
|
442
|
+
|
443
|
+
# Convert the position _x_ measured in frame x coordinates to the
|
444
|
+
# position in page x coordinates.
|
445
|
+
def convert_frame_to_page_x(x)
|
446
|
+
end
|
447
|
+
|
448
|
+
# Convert the position _y_ measured in frame y coordinates to the
|
449
|
+
# position in page y coordinates.
|
450
|
+
def convert_frame_to_page_y(y)
|
451
|
+
end
|
452
|
+
|
453
|
+
# Convert the distance _dx_ measured in frame x coordinates to the
|
454
|
+
# distance in page x coordinates.
|
455
|
+
def convert_frame_to_page_dx(dx)
|
456
|
+
end
|
457
|
+
|
458
|
+
# Convert the distance _dy_ measured in frame y coordinates to the
|
459
|
+
# distance in page y coordinates.
|
460
|
+
def convert_frame_to_page_dy(dy)
|
461
|
+
end
|
462
|
+
|
463
|
+
# Convert the position _x_ measured in figure x coordinates to the
|
464
|
+
# position in frame x coordinates.
|
465
|
+
def convert_figure_to_frame_x(x)
|
466
|
+
end
|
467
|
+
|
468
|
+
# Convert the position _y_ measured in figure y coordinates to the
|
469
|
+
# position in frame y coordinates.
|
470
|
+
def convert_figure_to_frame_y(y)
|
471
|
+
end
|
472
|
+
|
473
|
+
# Convert the distance _dx_ measured in figure x coordinates to the
|
474
|
+
# distance in frame x coordinates.
|
475
|
+
def convert_figure_to_frame_dx(dx)
|
476
|
+
end
|
477
|
+
|
478
|
+
# Convert the distance _dy_ measured in figure y coordinates to the
|
479
|
+
# distance in frame y coordinates.
|
480
|
+
def convert_figure_to_frame_dy(dy)
|
481
|
+
end
|
482
|
+
|
483
|
+
# Convert the position _x_ measured in frame x coordinates to the
|
484
|
+
# position in figure x coordinates.
|
485
|
+
def convert_frame_to_figure_x(x)
|
486
|
+
end
|
487
|
+
|
488
|
+
# Convert the position _y_ measured in frame y coordinates to the
|
489
|
+
# position in figure y coordinates.
|
490
|
+
def convert_frame_to_figure_y(y)
|
491
|
+
end
|
492
|
+
|
493
|
+
# Convert the distance _dx_ measured in frame x coordinates to the
|
494
|
+
# distance in figure x coordinates.
|
495
|
+
def convert_frame_to_figure_dx(dx)
|
496
|
+
end
|
497
|
+
|
498
|
+
# Convert the distance _dy_ measured in frame y coordinates to the
|
499
|
+
# distance in figure y coordinates.
|
500
|
+
def convert_frame_to_figure_dy(dy)
|
501
|
+
end
|
502
|
+
|
503
|
+
# Convert the position _x_ measured in figure x coordinates to the
|
504
|
+
# position in output x coordinates.
|
505
|
+
def convert_figure_to_output_x(x)
|
506
|
+
end
|
507
|
+
|
508
|
+
# Convert the position _y_ measured in figure y coordinates to the
|
509
|
+
# position in output y coordinates.
|
510
|
+
def convert_figure_to_output_y(y)
|
511
|
+
end
|
512
|
+
|
513
|
+
# Convert the distance _dx_ measured in figure x coordinates to the
|
514
|
+
# distance in output x coordinates.
|
515
|
+
def convert_figure_to_output_dx(dx)
|
516
|
+
end
|
517
|
+
|
518
|
+
# Convert the distance _dy_ measured in figure y coordinates to the
|
519
|
+
# distance in output y coordinates.
|
520
|
+
def convert_figure_to_output_dy(dy)
|
521
|
+
end
|
522
|
+
|
523
|
+
# Convert the position _x_ measured in output x coordinates to the
|
524
|
+
# position in figure x coordinates.
|
525
|
+
def convert_output_to_figure_x(x)
|
526
|
+
end
|
527
|
+
|
528
|
+
# Convert the position _y_ measured in output y coordinates to the
|
529
|
+
# position in figure y coordinates.
|
530
|
+
def convert_output_to_figure_y(y)
|
531
|
+
end
|
532
|
+
|
533
|
+
# Convert the distance _dx_ measured in output x coordinates to the
|
534
|
+
# distance in figure x coordinates.
|
535
|
+
def convert_output_to_figure_dx(dx)
|
536
|
+
end
|
537
|
+
|
538
|
+
# Convert the distance _dy_ measured in output y coordinates to the
|
539
|
+
# distance in figure y coordinates.
|
540
|
+
def convert_output_to_figure_dy(dy)
|
541
|
+
end
|
542
|
+
|
543
|
+
# Returns the angle measured in degrees clockwise from the horizontal for the
|
544
|
+
# slope specified by _dx_ and _dy_ given in figure coordinates.
|
545
|
+
def convert_to_degrees(dx, dy)
|
546
|
+
end
|
547
|
+
|
548
|
+
|
549
|
+
=begin rdoc
|
550
|
+
:call-seq:
|
551
|
+
tex_preamble
|
552
|
+
tex_preamble = a_string
|
553
|
+
|
554
|
+
This string will be used as the "preamble" for the TeX file.
|
555
|
+
The default does "usepackage" commands for "color" and "geometry".
|
556
|
+
You may want to use some other packages as well. Here's an example of how to do it which
|
557
|
+
adds the 'marvosym' package by inserting the following line into the 'initialize' routine.
|
558
|
+
|
559
|
+
t.tex_preamble = t.tex_preamble + "\n\t\\usepackage{marvosym}\n"
|
560
|
+
|
561
|
+
=end
|
562
|
+
def tex_preamble
|
563
|
+
end
|
564
|
+
|
565
|
+
|
566
|
+
end # class
|
567
|
+
end # module Tioga
|