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