You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently I faced with only 'set style' option.
Usually I consider options as set [key] [value] and here I think key is 'style data' or 'style function' or 'style fill' (they are considered different in gnuplot docs too) Thus I'm going to allow option keys like :style_function and :style_fill and replace '_' with space before unputting it to gnuplot.
This will allow to use plot.options(style_data: 'histograms', style_fill: '...') in this case for example.
What do you think?
Are there any commands in gnuplot which are separated similarly? Maybe there is an option called awesome_option which would also be separated and we might not want that.
An alternative could be plot.options(style: { data: 'histograms', fill: '...' })
I think we should get some more opinions on the topic @agisga@agarie
The point is that this command can't be used this way. plot.options(style: { data: 'histograms', fill: '...' })
will produce set style data histograms fill ...
but gnuplot waits for
set style data histograms
set style fill ...
So this will require to make exception for style in hash-as-option treatment.
I also looked through gnuplot docs and found that there are some other separated options ('set object |index|' for example) and found no underline separated options. Of course they may appear later.
I am not very familiar with gnuplot yet, so I might be wrong, but I think that most of the time the user will not use style multiple times (like style data ...andstyle fill ... simultaneously). Therefore, I think that the syntax with the underscore is less cumbersome and more straight forward: style_data: 'histograms' vs style: {data: 'histograms'}
You should also keep in mind that, based on how other options work, the user might expect that she can write: style: 'data histograms'
to produce set style data histograms
for gnuplot, if she does not need to specify multiple style options simultaneously.
Do you want to allow or forbid that behaviour?
Activity
mess110 commentedon Jun 18, 2015
Do you have a list of such commands? Or is this the only case?
ievgrafov commentedon Jun 18, 2015
Currently I faced with only 'set style' option.
Usually I consider options as
set [key] [value]and here I think key is 'style data' or 'style function' or 'style fill' (they are considered different in gnuplot docs too) Thus I'm going to allow option keys like :style_function and :style_fill and replace '_' with space before unputting it to gnuplot.This will allow to use
plot.options(style_data: 'histograms', style_fill: '...')in this case for example.What do you think?
mess110 commentedon Jun 18, 2015
Are there any commands in gnuplot which are separated similarly? Maybe there is an option called awesome_option which would also be separated and we might not want that.
An alternative could be
plot.options(style: { data: 'histograms', fill: '...' })I think we should get some more opinions on the topic @agisga @agarie
ievgrafov commentedon Jun 18, 2015
The point is that this command can't be used this way.
plot.options(style: { data: 'histograms', fill: '...' })will produce
set style data histograms fill ...but gnuplot waits for
So this will require to make exception for
stylein hash-as-option treatment.I also looked through gnuplot docs and found that there are some other separated options ('set object |index|' for example) and found no underline separated options. Of course they may appear later.
agisga commentedon Jun 18, 2015
I am not very familiar with gnuplot yet, so I might be wrong, but I think that most of the time the user will not use
stylemultiple times (likestyle data ...andstyle fill ...simultaneously). Therefore, I think that the syntax with the underscore is less cumbersome and more straight forward:style_data: 'histograms'vsstyle: {data: 'histograms'}You should also keep in mind that, based on how other options work, the user might expect that she can write:
style: 'data histograms'to produce
set style data histogramsfor gnuplot, if she does not need to specify multiple
styleoptions simultaneously.Do you want to allow or forbid that behaviour?
ievgrafov commentedon Jun 19, 2015
Yes, it's really possible case and all following options are the same (if we decide to implement underscore):
allow multi word keys for options (see #7) with example
[-]set style[/-][+]multi word keys in options[/+]