Allow plotting of summary through plot_gc()
This commit is contained in:
parent
224d05e0e9
commit
20111a7457
1 changed files with 21 additions and 16 deletions
|
|
@ -36,25 +36,25 @@ def plot_gc(data, options=None):
|
||||||
options = aux.update_options(options=options, required_options=required_options, default_options=default_options)
|
options = aux.update_options(options=options, required_options=required_options, default_options=default_options)
|
||||||
|
|
||||||
|
|
||||||
|
# Read data if not already loaded
|
||||||
if not 'cycles' in data.keys():
|
if not 'cycles' in data.keys():
|
||||||
data['cycles'] = ec.io.read_data(data=data, options=options)
|
data['cycles'] = ec.io.read_data(data=data, options=options)
|
||||||
|
|
||||||
|
|
||||||
if not options['summary']:
|
|
||||||
# Update list of cycles to correct indices
|
# Update list of cycles to correct indices
|
||||||
update_cycles_list(data=data, options=options)
|
update_cycles_list(data=data, options=options)
|
||||||
|
|
||||||
colours = generate_colours(cycles=data['cycles'], options=options)
|
|
||||||
|
|
||||||
if options['interactive']:
|
if options['interactive']:
|
||||||
options['interactive'], options['interactive_session_active'] = False, True
|
options['interactive'], options['interactive_session_active'] = False, True
|
||||||
plot_gc_interactive(data=data, options=options)
|
plot_gc_interactive(data=data, options=options)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
# Prepare plot, and read and process data
|
# Prepare plot
|
||||||
|
|
||||||
fig, ax = btp.prepare_plot(options=options)
|
fig, ax = btp.prepare_plot(options=options)
|
||||||
|
colours = generate_colours(cycles=data['cycles'], options=options)
|
||||||
|
|
||||||
|
if not options['summary']:
|
||||||
|
|
||||||
for i, cycle in enumerate(data['cycles']):
|
for i, cycle in enumerate(data['cycles']):
|
||||||
if i in options['which_cycles']:
|
if i in options['which_cycles']:
|
||||||
|
|
@ -70,13 +70,18 @@ def plot_gc(data, options=None):
|
||||||
else:
|
else:
|
||||||
update_labels(options)
|
update_labels(options)
|
||||||
|
|
||||||
fig, ax = btp.adjust_plot(fig=fig, ax=ax, options=options)
|
|
||||||
|
|
||||||
elif options['summary']:
|
elif options['summary']:
|
||||||
|
|
||||||
fig, ax = 0, 0
|
# FIXME To begin, the default is that y-values correspond to x-values. This should probably be implemented in more logical and consistent manner in the future.
|
||||||
|
if options['charge']:
|
||||||
|
data['cycles'][0].plot(x='cycle', y=options['x_vals'], ax=ax, color=colours[0][0], kind='scatter', s=plt.rcParams['lines.markersize'])
|
||||||
|
data['cycles'][1].plot(x='cycle', y=options['x_vals'], ax=ax, color=colours[0][1], kind='scatter', s=plt.rcParams['lines.markersize'])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
fig, ax = btp.adjust_plot(fig=fig, ax=ax, options=options)
|
||||||
|
|
||||||
return data['cycles'], fig, ax
|
return data['cycles'], fig, ax
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue