Closed JS3xton closed 4 years ago
Can you provide examples of your code producing a few plots as before, and at least one plot demonstrating the new ability to specify weights
?
develop (9cd83ef7fadf235e548bc6c1bb5ed22d4dde8416) |
hist1d-weights (ed1af38f3dc9130d5f5e5a5c8cabd617caf0e893) |
|
---|---|---|
hist1d(d) |
||
hist1d(d, normed_height=True) |
||
hist1d(d, normed_area=True) |
||
hist1d(d, weights=weights) |
TypeError |
Source code (inspired by the hist1d
tutorial):
import numpy as np
import matplotlib.pyplot as plt
import FlowCal
d = FlowCal.io.FCSData('./FCFiles/Data002.fcs')
d = FlowCal.transform.to_rfi(d)
bins = np.logspace(0,4,100+1)
weights = np.ones(d.shape[0])
weights /= float(d.shape[0])
kwargs = {'data_list' : d,
'channel' : 'FL1',
'bins' : bins,
'xlim' : (1e0,1e4)}
FlowCal.plot.hist1d(**kwargs, savefig='1.png')
FlowCal.plot.hist1d(**kwargs, savefig='2.png', normed_height=True)
FlowCal.plot.hist1d(**kwargs, savefig='3.png', normed_area=True)
FlowCal.plot.hist1d(**kwargs, savefig='4.png', weights=weights)
plot.hist1d()
called with theweights
parameter fails:I refactored
plot.hist1d()
to more precisely specify arguments toplt.hist()
. Closes https://github.com/taborlab/FlowCal/issues/255.All unit tests pass in
Python 3.8 + Anaconda 2020.02
andPython 2.7 + Anaconda 4.4.0
.After the change, the error shown above no longer occurs.
> python -m FlowCal.excel_ui -v -p -i ./examples/experiment.xlsx
also executes without error in bothPython 3.8 + Anaconda 2020.02
andPython 2.7 + Anaconda 4.4.0
.