Initial simple plot
Status:
Coding done but remaining issues to look at with reviewer are:
- callback for bvalue: not sure what to do
- how to refactor to make it less ugly and more extendable?
Summary
In order to have more flexible plotting, we need a new data class. This issue is about creating a simple plotting function that uses this class.
Update: Data class idea has been dumped. Now using a dictionary of ColumnDataSource
It will also create a new plotting module.
Design.
Something like
def plot_signal_vs_bval(data, fig, display_options={...}):
'''Creates a line plot of signal vs bvalue
Checks what's in the data
If it finds 'data_points', it uses scatter plot
If it finds 'signal', it uses line plot
would be nice to be able to configure the display as well
'''
for src in data.sources:
if src.dtype == 'data_points':
fig.circle('bvals','signal',src,**display_options)
elif src.dtype == 'signal':
fig.line('bvals','signal',src,**display_options)
else:
raise(Exception("src.dtype should be one of 'data_points' or 'signal'"))
Edited by Sean Fitzgibbon