Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def histogram_3d(self, X, win=None, env=None, opts=None):
"""
Given an array it plots the histrograms of the entries
:param X: An array of at least 2 dimensions, where the first dimensions gives the number of histograms
:param win: Window name
:param env: Env name
:param opts: dict with options, especially opts['numbins'] (number of histogram bins) and opts['mutiplier']
( factor to stretch / queeze the values on the x axis) should ne considered
:return: The send result
"""
opts = {} if opts is None else opts
_assert_opts(opts)
X = np.asarray(X)
assert X.ndim >= 2, 'X must have atleast 2 dimensions'
opts['numbins'] = opts.get('numbins', min(30, len(X[0])))
opts['mutiplier'] = opts.get('numbins', 100)
traces = []
for i, array in enumerate(X):
array = array.flatten()
bins, intervals = np.histogram(array, bins=opts['numbins'])
x = []
y = []
z = []
prev_interv = 0.