mirror of
https://github.com/red-data-tools/YouPlot.git
synced 2025-05-05 22:31:11 +08:00
Add grid to parser
This commit is contained in:
parent
b2f2c16c59
commit
c9513e463f
@ -171,6 +171,12 @@ module YouPlot
|
||||
end
|
||||
end
|
||||
|
||||
def sub_parser_add_grid
|
||||
sub_parser.on_head('--[no-]grid', TrueClass, 'draws grid-lines at the origin') do |v|
|
||||
params.grid = v
|
||||
end
|
||||
end
|
||||
|
||||
def create_sub_parser
|
||||
@sub_parser = create_default_parser
|
||||
sub_parser.banner = \
|
||||
@ -191,59 +197,61 @@ module YouPlot
|
||||
|
||||
when :barplot, :bar
|
||||
sub_parser_add_symbol
|
||||
sub_parser_add_xscale
|
||||
sub_parser.on_head('--fmt STR', String, 'xy : header is like x, y...', 'yx : header is like y, x...') do |v|
|
||||
@options[:fmt] = v
|
||||
end
|
||||
sub_parser_add_xscale
|
||||
|
||||
when :count, :c
|
||||
sub_parser_add_symbol
|
||||
sub_parser_add_xscale
|
||||
|
||||
when :histogram, :hist
|
||||
sub_parser.on_head('-n', '--nbins INT', Numeric, 'approximate number of bins') do |v|
|
||||
params.nbins = v
|
||||
end
|
||||
sub_parser_add_symbol
|
||||
sub_parser.on_head('--closed STR', String, 'side of the intervals to be closed [left]') do |v|
|
||||
params.closed = v
|
||||
end
|
||||
sub_parser_add_symbol
|
||||
sub_parser.on_head('-n', '--nbins INT', Numeric, 'approximate number of bins') do |v|
|
||||
params.nbins = v
|
||||
end
|
||||
|
||||
when :lineplot, :line
|
||||
sub_parser_add_canvas
|
||||
sub_parser_add_xlim
|
||||
sub_parser_add_grid
|
||||
sub_parser.on_head('--fmt STR', String, 'xy : header is like x, y...', 'yx : header is like y, x...') do |v|
|
||||
@options[:fmt] = v
|
||||
end
|
||||
sub_parser_add_xlim
|
||||
|
||||
when :lineplots, :lines
|
||||
sub_parser_add_canvas
|
||||
sub_parser_add_xlim
|
||||
sub_parser_add_ylim
|
||||
sub_parser_add_grid
|
||||
sub_parser.on_head('--fmt STR', String, 'xyxy : header is like x1, y1, x2, y2, x3, y3...',
|
||||
'xyy : header is like x, y1, y2, y2, y3...') do |v|
|
||||
@options[:fmt] = v
|
||||
end
|
||||
sub_parser_add_ylim
|
||||
sub_parser_add_xlim
|
||||
|
||||
when :scatter, :s
|
||||
sub_parser_add_canvas
|
||||
sub_parser_add_xlim
|
||||
sub_parser_add_ylim
|
||||
sub_parser_add_grid
|
||||
sub_parser.on_head('--fmt STR', String, 'xyxy : header is like x1, y1, x2, y2, x3, y3...',
|
||||
'xyy : header is like x, y1, y2, y2, y3...') do |v|
|
||||
@options[:fmt] = v
|
||||
end
|
||||
sub_parser_add_ylim
|
||||
sub_parser_add_xlim
|
||||
|
||||
when :density, :d
|
||||
sub_parser.on_head('--grid', TrueClass) do |v|
|
||||
params.grid = v
|
||||
end
|
||||
sub_parser_add_xlim
|
||||
sub_parser_add_ylim
|
||||
sub_parser_add_canvas
|
||||
sub_parser_add_grid
|
||||
sub_parser.on('--fmt STR', String, 'xyxy : header is like x1, y1, x2, y2, x3, y3...',
|
||||
'xyy : header is like x, y1, y2, y2, y3...') do |v|
|
||||
@options[:fmt] = v
|
||||
end
|
||||
sub_parser_add_ylim
|
||||
sub_parser_add_xlim
|
||||
|
||||
when :boxplot, :box
|
||||
sub_parser_add_xlim
|
||||
|
Loading…
Reference in New Issue
Block a user