diff --git a/gillespy2/core/results.py b/gillespy2/core/results.py index 810b5f0dd..50c53806d 100644 --- a/gillespy2/core/results.py +++ b/gillespy2/core/results.py @@ -255,7 +255,7 @@ def to_csv(self, path=None, nametag=None, stamp=None): this_line.append(trajectory[species][n]) csv_writer.writerow(this_line) # write one line of the CSV file - def plot(self, index=None, xaxis_label="Time ", xscale='linear', yscale='linear', yaxis_label="Species Population", + def plot(self, index=None, xaxis_label="Time", xscale='linear', yscale='linear', yaxis_label="Value", style="default", title=None, show_title=False, show_legend=True, multiple_graphs=False, included_species_list=[], save_png=False, figsize=(18, 10)): """ @@ -339,7 +339,7 @@ def plot(self, index=None, xaxis_label="Time ", xscale='linear', yscale='linear' elif save_png: plt.savefig(title) - def plotplotly(self, index=None, xaxis_label="Time ", yaxis_label="Species Population", title=None, + def plotplotly(self, index=None, xaxis_label="Time", yaxis_label="Value", title=None, show_title=False, show_legend=True, multiple_graphs=False, included_species_list=[], return_plotly_figure=False, **layout_args): """ Plots the Results using plotly. Can only be viewed in a Jupyter Notebook. @@ -535,7 +535,7 @@ def stddev_ensemble(self, ddof=0): output_results = Results(data=[output_trajectory]) # package output_trajectory in a Results object return output_results - def plotplotly_std_dev_range(self, xaxis_label="Time ", yaxis_label="Species Population", title=None, + def plotplotly_std_dev_range(self, xaxis_label="Time", yaxis_label="Value", title=None, show_title=False, show_legend=True, included_species_list=[], return_plotly_figure=False, ddof=0, **layout_args): """ @@ -653,7 +653,7 @@ def plotplotly_std_dev_range(self, xaxis_label="Time ", yaxis_label="Species Pop else: iplot(fig) - def plot_std_dev_range(self, xscale='linear', yscale='linear', xaxis_label="Time ", yaxis_label="Species Population" + def plot_std_dev_range(self, xscale='linear', yscale='linear', xaxis_label="Time", yaxis_label="Value" , title=None, show_title=False, style="default", show_legend=True, included_species_list=[], ddof=0, save_png=False, figsize=(18, 10)): """ diff --git a/test/test_results.py b/test/test_results.py index 48222f4a5..04910226c 100644 --- a/test/test_results.py +++ b/test/test_results.py @@ -46,7 +46,7 @@ def test_plotly_layout_args(self): with mock.patch('plotly.graph_objs.Scatter') as mock_scatter: with mock.patch('plotly.graph_objs.Layout') as mock_layout: results.plotplotly(return_plotly_figure=True,xscale='log') - mock_layout.assert_called_with(showlegend=True, title='', xaxis_title='Time ', xscale='log', yaxis_title='Species Population') + mock_layout.assert_called_with(showlegend=True, title='', xaxis_title='Time', xscale='log', yaxis_title='Value') def test_plotly_std_dev_range_layout_args(self): from unittest import mock @@ -59,7 +59,7 @@ def test_plotly_std_dev_range_layout_args(self): with mock.patch('plotly.graph_objs.Layout') as mock_layout: results.plotplotly_std_dev_range(return_plotly_figure=True, xscale='log') mock_layout.assert_called_with(legend={'traceorder':'normal'},showlegend=True, title='Standard Deviation Range', - xaxis_title='Time ', xscale='log', yaxis_title='Species Population') + xaxis_title='Time', xscale='log', yaxis_title='Value') def test_pickle_stable_plot_iterate(self): from unittest import mock