ctioga2 0.4 → 0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog +16 -0
- data/lib/ctioga2/commands/arguments.rb +5 -2
- data/lib/ctioga2/commands/commands.rb +45 -13
- data/lib/ctioga2/commands/context.rb +9 -1
- data/lib/ctioga2/commands/doc/help.rb +2 -2
- data/lib/ctioga2/commands/doc/html.rb +8 -8
- data/lib/ctioga2/commands/doc/introspection.rb +7 -5
- data/lib/ctioga2/commands/parsers/file.rb +123 -120
- data/lib/ctioga2/commands/parsers/old-file.rb +191 -0
- data/lib/ctioga2/commands/strings.rb +2 -2
- data/lib/ctioga2/data/datacolumn.rb +5 -2
- data/lib/ctioga2/data/dataset.rb +3 -13
- data/lib/ctioga2/data/indexed-dtable.rb +43 -11
- data/lib/ctioga2/data/stack.rb +65 -8
- data/lib/ctioga2/graphics/elements.rb +2 -1
- data/lib/ctioga2/graphics/elements/containers.rb +22 -3
- data/lib/ctioga2/graphics/elements/primitive.rb +5 -5
- data/lib/ctioga2/graphics/elements/xyz-contour.rb +123 -0
- data/lib/ctioga2/graphics/generator.rb +31 -5
- data/lib/ctioga2/graphics/legends.rb +44 -3
- data/lib/ctioga2/graphics/legends/area.rb +28 -9
- data/lib/ctioga2/graphics/legends/items.rb +34 -23
- data/lib/ctioga2/graphics/legends/multicols.rb +132 -0
- data/lib/ctioga2/graphics/styles.rb +3 -1
- data/lib/ctioga2/graphics/styles/axes.rb +10 -4
- data/lib/ctioga2/graphics/styles/base.rb +65 -11
- data/lib/ctioga2/graphics/styles/colormap.rb +2 -1
- data/lib/ctioga2/graphics/styles/contour.rb +141 -0
- data/lib/ctioga2/graphics/styles/curve.rb +49 -67
- data/lib/ctioga2/graphics/styles/drawable.rb +17 -8
- data/lib/ctioga2/graphics/styles/factory.rb +79 -38
- data/lib/ctioga2/graphics/styles/legend.rb +49 -6
- data/lib/ctioga2/graphics/styles/plot.rb +10 -9
- data/lib/ctioga2/graphics/styles/sheet.rb +11 -11
- data/lib/ctioga2/graphics/styles/texts.rb +38 -9
- data/lib/ctioga2/graphics/types.rb +20 -1
- data/lib/ctioga2/graphics/types/dimensions.rb +7 -1
- data/lib/ctioga2/metabuilder/types/lists.rb +4 -4
- data/lib/ctioga2/metabuilder/types/numbers.rb +3 -3
- data/lib/ctioga2/metabuilder/types/styles.rb +2 -2
- data/lib/ctioga2/plotmaker.rb +12 -1
- data/lib/ctioga2/utils.rb +27 -3
- metadata +8 -4
@@ -0,0 +1,141 @@
|
|
1
|
+
# contour.rb: the style of a contour plot
|
2
|
+
# copyright (c) 2009 by Vincent Fourmond
|
3
|
+
|
4
|
+
# This program is free software; you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation; either version 2 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details (in the COPYING file).
|
13
|
+
|
14
|
+
require 'ctioga2/utils'
|
15
|
+
require 'ctioga2/log'
|
16
|
+
|
17
|
+
|
18
|
+
# This module contains all the classes used by ctioga
|
19
|
+
module CTioga2
|
20
|
+
|
21
|
+
Version::register_svn_info('$Revision$', '$Date$')
|
22
|
+
|
23
|
+
module Graphics
|
24
|
+
|
25
|
+
module Styles
|
26
|
+
|
27
|
+
|
28
|
+
# The base for a contour plot
|
29
|
+
class BaseContourStyle < BasicStyle
|
30
|
+
|
31
|
+
# Whether or not to use conrec for the contour computation
|
32
|
+
typed_attribute :conrec, 'boolean'
|
33
|
+
|
34
|
+
def make_contour(table, level, opts = {})
|
35
|
+
if @conrec && (! opts.key? 'method')
|
36
|
+
opts['method'] = 'conrec'
|
37
|
+
end
|
38
|
+
return table.make_contour(level, opts)
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
|
44
|
+
# This class expands on the previous one to provide for
|
45
|
+
# mechanisms to draw many related contour plots.
|
46
|
+
class ContoursStyle < BaseContourStyle
|
47
|
+
|
48
|
+
# The overall number of ticks (including minor ticks when
|
49
|
+
# there is). May be approximative
|
50
|
+
typed_attribute :number, 'integer'
|
51
|
+
|
52
|
+
# Whether or not to "stick" to natural numbers for the
|
53
|
+
typed_attribute :use_naturals, 'boolean'
|
54
|
+
|
55
|
+
# Number of subticks
|
56
|
+
typed_attribute :minor_number, 'integer'
|
57
|
+
|
58
|
+
# Relative scale of the minor ticks. Used if the absolute
|
59
|
+
# width is not specified.
|
60
|
+
typed_attribute :minor_scale, 'float'
|
61
|
+
|
62
|
+
# Line style of minor ticks.
|
63
|
+
sub_style :minor, LineStyle
|
64
|
+
|
65
|
+
def initialize()
|
66
|
+
@number = 20
|
67
|
+
@use_naturals = true
|
68
|
+
@minor_number = 4
|
69
|
+
@minor_scale = 0.6
|
70
|
+
end
|
71
|
+
|
72
|
+
# Computes and plots the contours according to the style,
|
73
|
+
# using the given color map.
|
74
|
+
def plot_contours(t, table, zmin, zmax, color_map)
|
75
|
+
|
76
|
+
ticks = []
|
77
|
+
minor_ticks = []
|
78
|
+
|
79
|
+
if @use_naturals
|
80
|
+
bdz = (zmax - zmin)*@minor_number/@number
|
81
|
+
bdz = Utils.closest_subdivision(bdz)
|
82
|
+
|
83
|
+
zb = ((zmin/bdz).ceil) * bdz
|
84
|
+
z = zb
|
85
|
+
i = 0
|
86
|
+
while z < zmax
|
87
|
+
ticks << z
|
88
|
+
z = zb + i*bdz
|
89
|
+
i += 1
|
90
|
+
end
|
91
|
+
|
92
|
+
sbdz = bdz/@minor_number
|
93
|
+
sbdz = Utils.closest_subdivision(sbdz, false)
|
94
|
+
|
95
|
+
zb = ((zmin/sbdz).ceil) * sbdz
|
96
|
+
z = zb
|
97
|
+
i = 0
|
98
|
+
idx = 0
|
99
|
+
while z < zmax
|
100
|
+
if ticks[idx] == z
|
101
|
+
idx += 1
|
102
|
+
else
|
103
|
+
minor_ticks << z
|
104
|
+
end
|
105
|
+
i += 1
|
106
|
+
z = zb + i*sbdz
|
107
|
+
end
|
108
|
+
else
|
109
|
+
dz = (zmax - zmin)/@number
|
110
|
+
@number.times do |i|
|
111
|
+
ticks << zmin + (i + 0.5) * dz
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
for lvl in ticks
|
116
|
+
t.context do
|
117
|
+
t.stroke_color = color_map.z_color(lvl, zmin, zmax)
|
118
|
+
contour = make_contour(table, lvl)
|
119
|
+
t.append_points_with_gaps_to_path(*contour)
|
120
|
+
t.stroke
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
# Minor ticks, when applicable !
|
125
|
+
t.context do
|
126
|
+
t.line_width = t.line_width * @minor_scale
|
127
|
+
@minor.set_stroke_style(t) if @minor
|
128
|
+
for lvl in minor_ticks
|
129
|
+
t.stroke_color = color_map.z_color(lvl, zmin, zmax)
|
130
|
+
contour = make_contour(table, lvl)
|
131
|
+
t.append_points_with_gaps_to_path(*contour)
|
132
|
+
t.stroke
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
@@ -17,7 +17,7 @@ require 'ctioga2/log'
|
|
17
17
|
# This module contains all the classes used by ctioga
|
18
18
|
module CTioga2
|
19
19
|
|
20
|
-
Version::register_svn_info('$Revision:
|
20
|
+
Version::register_svn_info('$Revision: 416 $', '$Date: 2013-08-23 00:35:49 +0200 (Fri, 23 Aug 2013) $')
|
21
21
|
|
22
22
|
module Graphics
|
23
23
|
|
@@ -28,61 +28,69 @@ module CTioga2
|
|
28
28
|
# \todo maybe for objects different than Curve2D, a subclass of
|
29
29
|
# CurveStyle could be used ? This way, we could have clearly
|
30
30
|
# separated legends and the like ?
|
31
|
-
|
32
|
-
# @todo This should probably be a subclass of basicStyle, to
|
33
|
-
# handle style sheets.
|
34
|
-
class CurveStyle
|
31
|
+
class CurveStyle < BasicStyle
|
35
32
|
|
36
33
|
# The style of the line that is drawn, as a StrokeStyle.
|
37
|
-
|
34
|
+
sub_style :line, StrokeStyle
|
38
35
|
|
39
36
|
# The style of markers that should be drawn, as a MarkerStyle.
|
40
|
-
|
37
|
+
sub_style :marker, MarkerStyle
|
41
38
|
|
42
39
|
# The text of the legend, if there is one.
|
43
|
-
|
40
|
+
typed_attribute :legend, 'text'
|
44
41
|
|
45
42
|
# The style of the error bars when needed, as a ErrorBarStyle.
|
46
|
-
|
43
|
+
sub_style :error_bar, ErrorBarStyle
|
47
44
|
|
48
45
|
# Filling of the curve, if applicable
|
49
|
-
|
46
|
+
sub_style :fill, CurveFillStyle
|
50
47
|
|
51
48
|
# Details of the location of the curve, a LocationStyle object.
|
52
|
-
|
49
|
+
sub_style :location, LocationStyle, nil, true
|
53
50
|
|
54
51
|
# Whether in a region plot, the curve should be above or below
|
55
52
|
# the filled region.
|
56
|
-
|
53
|
+
typed_attribute :region_position, "region-side"
|
57
54
|
|
58
55
|
# A path style.
|
59
56
|
#
|
60
|
-
# @todo Ideas for a path
|
57
|
+
# @todo Ideas for a path style include
|
61
58
|
# - plain lines
|
62
59
|
# - impulses ?
|
63
60
|
# - splines
|
64
61
|
# See gnuplot help for "plot with" for inspiration.
|
65
|
-
|
62
|
+
#
|
63
|
+
# For now completely useless !
|
64
|
+
typed_attribute :path_style, 'text'
|
66
65
|
|
67
66
|
# A colormap for strokes (only for XYZ data)
|
68
67
|
#
|
69
68
|
# @todo There should be a very clear way to mark curve style
|
70
69
|
# elements which are specific to certain kinds of plots (and
|
71
70
|
# warn the user about misuses ?)
|
72
|
-
|
71
|
+
typed_attribute :color_map, 'colormap'
|
73
72
|
|
74
73
|
# The name of an axis to create to use for the display of the
|
75
74
|
# Z scale.
|
76
75
|
#
|
77
76
|
# @todo specify the behaviour when the axis exists.
|
78
|
-
|
77
|
+
typed_attribute :zaxis, 'text'
|
79
78
|
|
80
79
|
# A colormap for markers (only for XYZ data)
|
81
|
-
|
80
|
+
typed_attribute :marker_color_map, 'colormap'
|
82
81
|
|
83
82
|
# Whether the XY display should split on NaN values (wherever)
|
84
|
-
|
83
|
+
typed_attribute :split_on_nan, 'boolean'
|
84
|
+
|
85
85
|
|
86
|
+
# Style of contour plots
|
87
|
+
sub_style :contour, ContoursStyle, nil, true
|
88
|
+
|
89
|
+
# The following attributes are not styles but here to help
|
90
|
+
|
91
|
+
# The object attached to this style. It is set by
|
92
|
+
# Generator#curve_from_dataset
|
93
|
+
attr_accessor :target
|
86
94
|
|
87
95
|
# True if a line should be drawn.
|
88
96
|
def has_line?
|
@@ -99,62 +107,36 @@ module CTioga2
|
|
99
107
|
return @legend
|
100
108
|
end
|
101
109
|
|
102
|
-
# Sets the values of the different sub-objects from a 'flat'
|
103
|
-
# _hash_. Keys have the following meaning:
|
104
|
-
# * 'line_...': a StrokeStyle for the drawing the line
|
105
|
-
# * 'marker_...': a MarkerStyle for the drawing of markers
|
106
|
-
# * 'legend': the legend of the curve
|
107
|
-
# * '[xy]axis': the name of the axis the curve should be
|
108
|
-
# plotted onto
|
109
|
-
#
|
110
|
-
# \todo make #legend another object derived from BasicStyle ?
|
111
|
-
#
|
112
|
-
# @todo This function should essentially disappear if we make
|
113
|
-
# this derive from BasicStyle.
|
114
|
-
def set_from_hash(hash)
|
115
|
-
@line = StrokeStyle.from_hash(hash, 'line_%s')
|
116
|
-
@marker = MarkerStyle.from_hash(hash, 'marker_%s')
|
117
|
-
@error_bar = ErrorBarStyle.from_hash(hash, 'error_bar_%s')
|
118
|
-
@location = LocationStyle.from_hash(hash, 'location_%s')
|
119
|
-
@fill = CurveFillStyle.from_hash(hash, 'fill_%s')
|
120
|
-
|
121
|
-
@region_position = hash['region_position']
|
122
|
-
|
123
|
-
@legend = hash['legend']
|
124
|
-
|
125
|
-
@path_style = hash['style']
|
126
|
-
|
127
|
-
@color_map = hash['color_map']
|
128
|
-
|
129
|
-
@marker_color_map = hash['marker_color_map']
|
130
|
-
|
131
|
-
@split_on_nan = hash['split_on_nan']
|
132
|
-
|
133
|
-
@zaxis = hash['zaxis']
|
134
|
-
end
|
135
|
-
|
136
|
-
# Creates a CurveStyle object straight from a hash
|
137
|
-
# description. See #set_from_hash for more information.
|
138
|
-
def self.from_hash(hash)
|
139
|
-
a = CurveStyle.new
|
140
|
-
a.set_from_hash(hash)
|
141
|
-
return a
|
142
|
-
end
|
143
|
-
|
144
|
-
|
145
110
|
# Draws a legend pictogram that fills up the whole current
|
146
111
|
# frame.
|
147
112
|
#
|
148
113
|
# \todo add more elements to the pictogram in case of more
|
149
114
|
# complex things.
|
115
|
+
#
|
116
|
+
# @todo Most probably the legend pictogram should be done by
|
117
|
+
# the curve directly rather than by the style.
|
150
118
|
def draw_legend_pictogram(t)
|
151
119
|
t.context do
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
120
|
+
case @target
|
121
|
+
when Elements::Curve2D
|
122
|
+
if has_line?
|
123
|
+
@line.set_stroke_style(t)
|
124
|
+
t.stroke_line(0.0, 0.5, 1.0, 0.5)
|
125
|
+
end
|
126
|
+
if has_marker?
|
127
|
+
@marker.draw_markers_at(t, [0.5], [0.5])
|
128
|
+
end
|
129
|
+
when Elements::Parametric2D
|
130
|
+
if has_marker? && @marker_color_map
|
131
|
+
colors = @marker_color_map.colors.uniq
|
132
|
+
i = 1
|
133
|
+
total = colors.size + 1.0
|
134
|
+
for c in colors
|
135
|
+
@marker.draw_markers_at(t, [i/total], [0.5],
|
136
|
+
{'color' => c} )
|
137
|
+
i += 1
|
138
|
+
end
|
139
|
+
end
|
158
140
|
end
|
159
141
|
end
|
160
142
|
end
|
@@ -17,19 +17,15 @@ require 'ctioga2/log'
|
|
17
17
|
# This module contains all the classes used by ctioga
|
18
18
|
module CTioga2
|
19
19
|
|
20
|
-
Version::register_svn_info('$Revision:
|
20
|
+
Version::register_svn_info('$Revision: 419 $', '$Date: 2013-08-23 01:05:42 +0200 (Fri, 23 Aug 2013) $')
|
21
21
|
|
22
22
|
module Graphics
|
23
23
|
|
24
24
|
# All the styles
|
25
25
|
module Styles
|
26
26
|
|
27
|
-
# This class represents
|
28
|
-
|
29
|
-
class StrokeStyle < BasicStyle
|
30
|
-
# The color
|
31
|
-
typed_attribute :color, 'color-or-false'
|
32
|
-
|
27
|
+
# This class represents a plain line style.
|
28
|
+
class LineStyle < BasicStyle
|
33
29
|
# The line style
|
34
30
|
typed_attribute :style, 'line-style'
|
35
31
|
|
@@ -38,7 +34,6 @@ module CTioga2
|
|
38
34
|
|
39
35
|
# Sets the stroke style to a FigureMaker object, _t_.
|
40
36
|
def set_stroke_style(t)
|
41
|
-
t.stroke_color = @color if @color
|
42
37
|
t.line_type = @style if @style
|
43
38
|
t.line_width = @width if @width
|
44
39
|
end
|
@@ -52,6 +47,20 @@ module CTioga2
|
|
52
47
|
end
|
53
48
|
end
|
54
49
|
|
50
|
+
# This class represents all the stylistic information to stroke
|
51
|
+
# a Tioga path.
|
52
|
+
class StrokeStyle < LineStyle
|
53
|
+
# The color
|
54
|
+
typed_attribute :color, 'color-or-false'
|
55
|
+
|
56
|
+
# Sets the stroke style to a FigureMaker object, _t_.
|
57
|
+
def set_stroke_style(t)
|
58
|
+
t.stroke_color = @color if @color
|
59
|
+
super
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
|
55
64
|
# This class represents all the stylistic information to draw a
|
56
65
|
# Marker.
|
57
66
|
#
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# factory.rb: an object in charge of generating the style for Curves
|
2
|
-
# copyright (c) 2009 by Vincent Fourmond
|
2
|
+
# copyright (c) 2009, 2013 by Vincent Fourmond
|
3
3
|
|
4
4
|
# This program is free software; you can redistribute it and/or modify
|
5
5
|
# it under the terms of the GNU General Public License as published by
|
@@ -17,7 +17,7 @@ require 'ctioga2/log'
|
|
17
17
|
# This module contains all the classes used by ctioga
|
18
18
|
module CTioga2
|
19
19
|
|
20
|
-
Version::register_svn_info('$Revision:
|
20
|
+
Version::register_svn_info('$Revision: 432 $', '$Date: 2013-08-23 19:06:36 +0200 (Fri, 23 Aug 2013) $')
|
21
21
|
|
22
22
|
module Graphics
|
23
23
|
|
@@ -62,7 +62,7 @@ module CTioga2
|
|
62
62
|
def initialize(name, type, sets, description,
|
63
63
|
short_option = nil, disable_cmds = false)
|
64
64
|
@name = name
|
65
|
-
@type =
|
65
|
+
@type = type
|
66
66
|
@sets = sets
|
67
67
|
@description = description
|
68
68
|
@short_option = short_option
|
@@ -108,11 +108,14 @@ module CTioga2
|
|
108
108
|
#
|
109
109
|
# \todo add a way to add some more text to the description;
|
110
110
|
# possibly a self.describe_parameter function ?
|
111
|
-
|
111
|
+
#
|
112
|
+
# @todo Remove completely the 'type' argument
|
113
|
+
def self.define_parameter(target, name, sets, description,
|
112
114
|
short_option = nil, disable_cmds = false)
|
113
115
|
# We define two new types:
|
114
116
|
# - first, the color-or-auto type:
|
115
|
-
base_type = Commands::CommandType.get_type(type)
|
117
|
+
# base_type = Commands::CommandType.get_type(type)
|
118
|
+
base_type = CurveStyle.attribute_type(target)
|
116
119
|
|
117
120
|
if ! Commands::Interpreter.type("#{base_type.name}-or-auto")
|
118
121
|
mb_type = base_type.type.dup
|
@@ -141,7 +144,7 @@ module CTioga2
|
|
141
144
|
"Sets of {type: #{base_type.name}}")
|
142
145
|
end
|
143
146
|
param =
|
144
|
-
CurveStyleFactoryParameter.new(name,
|
147
|
+
CurveStyleFactoryParameter.new(name, base_type, sets,
|
145
148
|
description, short_option,
|
146
149
|
disable_cmds)
|
147
150
|
@parameters ||= {}
|
@@ -151,6 +154,13 @@ module CTioga2
|
|
151
154
|
@name_to_target[name] = target
|
152
155
|
end
|
153
156
|
|
157
|
+
# A simple parameter is something whose target defines all, ie
|
158
|
+
# only the name and a documentation text is necessary.
|
159
|
+
def self.simple_parameter(target, text, sets = nil)
|
160
|
+
name = target.gsub(/_/, '-')
|
161
|
+
define_parameter(target, name, sets, text, nil)
|
162
|
+
end
|
163
|
+
|
154
164
|
# Returns the Hash containing the class parameters.
|
155
165
|
def self.parameters
|
156
166
|
return @parameters || {}
|
@@ -316,71 +326,67 @@ module CTioga2
|
|
316
326
|
# Now, the parameters:
|
317
327
|
|
318
328
|
# Lines:
|
319
|
-
define_parameter 'line_color', 'color',
|
320
|
-
Sets::ColorSets, "color", "-c"
|
329
|
+
define_parameter 'line_color', 'color',
|
330
|
+
Sets::ColorSets, "line color", "-c"
|
321
331
|
|
322
|
-
|
323
|
-
Sets::LineWidthSets, "line width", nil
|
332
|
+
simple_parameter 'line_width', 'line width', Sets::LineWidthSets
|
324
333
|
|
325
|
-
|
326
|
-
Sets::LineStyleSets, "line style", nil
|
334
|
+
simple_parameter 'line_style', 'line style', Sets::LineStyleSets
|
327
335
|
|
328
336
|
# Markers
|
329
|
-
define_parameter 'marker_marker', 'marker',
|
337
|
+
define_parameter 'marker_marker', 'marker',
|
330
338
|
Sets::MarkerSets, "marker", '-m'
|
331
339
|
|
332
|
-
|
333
|
-
Sets::ColorSets, "marker color", nil
|
340
|
+
simple_parameter 'marker_color', "marker color", Sets::ColorSets
|
334
341
|
|
335
|
-
|
336
|
-
Sets::LineWidthSets, "marker scale", nil
|
342
|
+
simple_parameter 'marker_scale', "marker scale", Sets::LineWidthSets
|
337
343
|
|
338
344
|
# Error bars:
|
339
|
-
|
340
|
-
Sets::ColorSets
|
345
|
+
simple_parameter 'error_bar_color', "error bar color",
|
346
|
+
Sets::ColorSets
|
341
347
|
|
342
348
|
# Location:
|
343
|
-
define_parameter 'location_xaxis', 'xaxis',
|
349
|
+
define_parameter 'location_xaxis', 'xaxis',
|
344
350
|
nil, "X axis", nil, true
|
345
351
|
|
346
|
-
define_parameter 'location_yaxis', 'yaxis',
|
352
|
+
define_parameter 'location_yaxis', 'yaxis',
|
347
353
|
nil, "Y axis", nil, true
|
348
354
|
|
349
355
|
# Now, fill style
|
350
|
-
define_parameter 'fill_y0', 'fill',
|
356
|
+
define_parameter 'fill_y0', 'fill',
|
351
357
|
{}, "Fill until", nil
|
352
358
|
|
353
|
-
|
354
|
-
Sets::ColorSets, "fill color", nil
|
359
|
+
simple_parameter 'fill_color', "fill color", Sets::ColorSets
|
355
360
|
|
356
|
-
|
357
|
-
{}, "Fill transparency", nil
|
361
|
+
simple_parameter 'fill_transparency', 'fill transparency', {}
|
358
362
|
|
359
363
|
# Region handling
|
360
|
-
define_parameter 'region_position', 'region-side',
|
364
|
+
define_parameter 'region_position', 'region-side',
|
361
365
|
{"default" => [:above, :below]}, "region side", nil
|
362
366
|
|
363
367
|
|
364
|
-
|
365
|
-
{}, "Path style", nil
|
368
|
+
simple_parameter 'path_style', 'path style', {}
|
366
369
|
|
367
370
|
# Only for xyz-maps or xy-parametric
|
368
|
-
|
369
|
-
nil, "Color map", nil
|
370
|
-
|
371
|
+
simple_parameter 'color_map', 'color map'
|
371
372
|
|
372
|
-
|
373
|
-
nil, "Name for the Z axis", nil
|
373
|
+
simple_parameter 'zaxis', "name for the Z axis"
|
374
374
|
|
375
375
|
## @todo For xy-parametric, there should be a way to specify
|
376
376
|
## to which z value the maps apply (ie lines = y2, marker =
|
377
377
|
## y3...). Although for readability, it is probably better
|
378
378
|
## to avoid that...
|
379
|
-
|
380
|
-
nil, "Marker color map", nil
|
379
|
+
simple_parameter 'marker_color_map', 'color map for markers'
|
381
380
|
|
382
|
-
|
383
|
-
|
381
|
+
simple_parameter 'split_on_nan', 'split on NaN'
|
382
|
+
|
383
|
+
|
384
|
+
# Contour plot styles
|
385
|
+
simple_parameter 'contour_conrec', "use CONREC for contouring"
|
386
|
+
simple_parameter 'contour_number', "overall number of level lines"
|
387
|
+
simple_parameter 'contour_minor_number', "number of minor level lines between major ones (approx)"
|
388
|
+
simple_parameter 'contour_minor_scale', "relative scale of minor level lines"
|
389
|
+
simple_parameter 'contour_minor_style', "minor ticks line style"
|
384
390
|
|
385
391
|
|
386
392
|
# And finally, we register all necessary commands...
|
@@ -462,6 +468,41 @@ module CTioga2
|
|
462
468
|
end
|
463
469
|
end
|
464
470
|
end
|
471
|
+
|
472
|
+
# Now, we document some aspects of the above created commands
|
473
|
+
c = Commands::Command
|
474
|
+
|
475
|
+
c.document_command("color-map", <<EOD)
|
476
|
+
Sets the color map for the subsequent curves, until cancelled by an
|
477
|
+
@auto@ argument.
|
478
|
+
|
479
|
+
Color maps are used for 3D plots, ie under the effet of
|
480
|
+
{command: contour}, {command: xyz-map} and {command: xy-parametric}.
|
481
|
+
EOD
|
482
|
+
|
483
|
+
c.document_command("contour-conrec", <<EOD)
|
484
|
+
If on, the subsequent curves will use the CONREC algorithm for
|
485
|
+
contouring. In the opposite case, the contouring algorithm of Gri is
|
486
|
+
used.
|
487
|
+
|
488
|
+
Only useful when {command: contour} is in effect.
|
489
|
+
EOD
|
490
|
+
|
491
|
+
c.document_command("split-on-nan", <<EOD)
|
492
|
+
In general, the NaN (not a number, ie invalid data points in the
|
493
|
+
dataset) in a dataset are silently ignored. When this option is on,
|
494
|
+
the lines of {command: xy-plot}-style plots are split upon
|
495
|
+
encountering a NaN.
|
496
|
+
EOD
|
497
|
+
|
498
|
+
c.document_command("zaxis", <<EOD)
|
499
|
+
Sets the name of the zaxis for the subsequent curves. This must be an
|
500
|
+
axis that has been previously created using {command: new-zaxis}.
|
501
|
+
|
502
|
+
This axis will be used to display the colormaps of the following
|
503
|
+
curve.
|
504
|
+
EOD
|
505
|
+
|
465
506
|
end
|
466
507
|
end
|
467
508
|
|