-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add mock plot data to result file * solution 1: using binary * add histogram * Co-authored-by: Megan Riel-Mehan <meganrm@gmail.com> * remove unused flag and call * wip: comment out saveResult in pack_one_seed to avoid packing twice * save each seed * merge add_histogram into histogram() * remove unused code * set save_png to true for pairwise distances * avoid early return in saving histogram
- Loading branch information
Showing
5 changed files
with
103 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import numpy as np | ||
from simulariumio import ScatterPlotData, HistogramPlotData | ||
|
||
|
||
class PlotData: | ||
def __init__(self): | ||
self.plot_list = [] # list of tuples | ||
|
||
def _add_plot(self, plot): | ||
self.plot_list.append(plot) | ||
|
||
def add_scatter(self, title, xaxis_title, yaxis_title, xtrace, ytraces): | ||
self._add_plot( | ||
( | ||
"scatter", | ||
ScatterPlotData( | ||
title=title, | ||
xaxis_title=xaxis_title, | ||
yaxis_title=yaxis_title, | ||
xtrace=np.array(xtrace), | ||
ytraces={key: np.array(value) for key, value in ytraces.items()}, | ||
), | ||
) | ||
) | ||
|
||
def add_histogram(self, title, xaxis_title, traces): | ||
self._add_plot( | ||
( | ||
"histogram", | ||
HistogramPlotData( | ||
title=title, | ||
xaxis_title=xaxis_title, | ||
traces={key: np.array(value) for key, value in traces.items()}, | ||
), | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters