diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
index 16f8793a..6e6a43c3 100644
--- a/.idea/jarRepositories.xml
+++ b/.idea/jarRepositories.xml
@@ -41,16 +41,16 @@
-
-
-
-
-
+
+
+
+
+
diff --git a/meteoinfo-chart/meteoinfo-chart.iml b/meteoinfo-chart/meteoinfo-chart.iml
index 26744b90..9581d2bb 100644
--- a/meteoinfo-chart/meteoinfo-chart.iml
+++ b/meteoinfo-chart/meteoinfo-chart.iml
@@ -13,20 +13,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
@@ -35,20 +87,14 @@
-
-
-
-
-
-
@@ -64,7 +110,6 @@
-
@@ -80,75 +125,30 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/meteoinfo-data/meteoinfo-data.iml b/meteoinfo-data/meteoinfo-data.iml
index 8c6e978e..a9343a36 100644
--- a/meteoinfo-data/meteoinfo-data.iml
+++ b/meteoinfo-data/meteoinfo-data.iml
@@ -12,27 +12,20 @@
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -41,17 +34,24 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/meteoinfo-geo/meteoinfo-geo.iml b/meteoinfo-geo/meteoinfo-geo.iml
index 5b1ddc14..89bf2441 100644
--- a/meteoinfo-geo/meteoinfo-geo.iml
+++ b/meteoinfo-geo/meteoinfo-geo.iml
@@ -12,19 +12,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
@@ -33,28 +65,15 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -70,7 +89,6 @@
-
@@ -86,49 +104,31 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/meteoinfo-lab/milconfig.xml b/meteoinfo-lab/milconfig.xml
index 77dab833..dc33470a 100644
--- a/meteoinfo-lab/milconfig.xml
+++ b/meteoinfo-lab/milconfig.xml
@@ -1,10 +1,6 @@
-
-
-
-
-
+
@@ -16,15 +12,21 @@
+
+
+
+
+
+
@@ -32,5 +34,5 @@
-
+
diff --git a/meteoinfo-lab/pylib/mipylib/numeric/core/numeric$py.class b/meteoinfo-lab/pylib/mipylib/numeric/core/numeric$py.class
index 68e73905..7618a43c 100644
Binary files a/meteoinfo-lab/pylib/mipylib/numeric/core/numeric$py.class and b/meteoinfo-lab/pylib/mipylib/numeric/core/numeric$py.class differ
diff --git a/meteoinfo-lab/pylib/mipylib/numeric/core/numeric.py b/meteoinfo-lab/pylib/mipylib/numeric/core/numeric.py
index c2adfd71..adf5fbfe 100644
--- a/meteoinfo-lab/pylib/mipylib/numeric/core/numeric.py
+++ b/meteoinfo-lab/pylib/mipylib/numeric/core/numeric.py
@@ -1640,12 +1640,15 @@ def histogram(a, bins=10, density=False):
a = array(a)
elif isinstance(a, numbers.Number):
a = array([a])
+
if isinstance(bins, list):
bins = array(bins)
+
if isinstance(bins, int):
r = ArrayUtil.histogram(a.asarray(), bins)
else:
r = ArrayUtil.histogram(a.asarray(), bins.asarray())
+
h = NDArray(r[0])
b = NDArray(r[1])
diff --git a/meteoinfo-lab/pylib/mipylib/plotlib/_axes$py.class b/meteoinfo-lab/pylib/mipylib/plotlib/_axes$py.class
index 1deb54a9..42a77a50 100644
Binary files a/meteoinfo-lab/pylib/mipylib/plotlib/_axes$py.class and b/meteoinfo-lab/pylib/mipylib/plotlib/_axes$py.class differ
diff --git a/meteoinfo-lab/pylib/mipylib/plotlib/_axes.py b/meteoinfo-lab/pylib/mipylib/plotlib/_axes.py
index f74305b4..29c00a84 100644
--- a/meteoinfo-lab/pylib/mipylib/plotlib/_axes.py
+++ b/meteoinfo-lab/pylib/mipylib/plotlib/_axes.py
@@ -2011,29 +2011,68 @@ class Axes(object):
return barbreaks
- def hist(self, x, bins=10, range=None, density=False, cumulative=False,
- bottom=None, histtype='bar', align='mid',
- orientation='vertical', rwidth=None, log=False, **kwargs):
+ def hist(self, x, bins=10, density=False, cumulative=False,
+ rwidth=None, **kwargs):
"""
Plot a histogram.
- :param x: (*array_like*) Input values, this takes either a single array or a sequency of arrays
+ :param x: (*array_like*) Input values, this takes either a single array or a sequence of arrays
which are not required to be of the same length.
:param bins: (*int*) If an integer is given, bins + 1 bin edges are returned.
+ :param density: (*bool*) Default is `False`. If `True`, draw and return a probability
+ density: each bin will display the bin's raw count divided by the total number of
+ counts and the bin width
+ :param cumulative: (*bool*) Default is `False`. If `True`, then a histogram is computed
+ where each bin gives the counts in that bin plus all bins for smaller values. The
+ last bin gives the total number of datapoints.
+ :param rwidth: (*float or None*) Default is `None`. The relative width of the bars as a
+ fraction of the bin width. If None, automatically compute the width.
"""
- # Add data series
- label = kwargs.pop('label', 'S_0')
+ if isinstance(x, NDArray) and x.ndim == 1:
+ m, bins = np.histogram(x, bins=bins, density=density)
+ width = np.diff(bins)
+ if cumulative:
+ m = np.cumsum(m * width)
- # histogram
- m, bins = np.histogram(x, bins=bins, density=density)
- width = np.diff(bins)
- if cumulative:
- m = np.cumsum(m * width)
- if not rwidth is None:
- width = width * rwidth
- barbreaks = self.bar(bins[:-1], m, width, align='center', **kwargs)
+ if rwidth is not None:
+ width = width * rwidth
- return m, bins, barbreaks
+ barbreaks = self.bar(bins[:-1], m, width, align='center', **kwargs)
+
+ return m, bins, barbreaks
+ else:
+ mlist = []
+ barbreaklist = []
+ if isinstance(x, (list, tuple)):
+ n = len(x)
+ else:
+ n = x.shape[1]
+
+ colors = kwargs.pop('color', None)
+ if colors is None:
+ colors = plotutil.makecolors(n)
+ labels = kwargs.pop('label', None)
+
+ for i in range(n):
+ if isinstance(x, NDArray):
+ xx = x[:,i]
+ else:
+ xx = x[i]
+
+ m, bins = np.histogram(xx, bins=bins, density=density)
+ width = np.diff(bins) / n
+ if cumulative:
+ m = np.cumsum(m * width)
+ mlist.append(m)
+ if rwidth is not None:
+ width = width * rwidth
+ kwargs['color'] = colors[i]
+ if labels is not None:
+ kwargs['label'] = labels[i]
+ barbreaks = self.bar(bins[:-1] + width * i, m, width, align='center', **kwargs)
+ barbreaklist.append(barbreaks)
+
+ return mlist, bins, barbreaklist
def hist_back(self, x, bins=10, range=None, density=False, cumulative=False,
bottom=None, histtype='bar', align='mid',
diff --git a/meteoinfo-lab/pylib/mipylib/plotlib/miplot$py.class b/meteoinfo-lab/pylib/mipylib/plotlib/miplot$py.class
index 7bcaa38d..11d4b11d 100644
Binary files a/meteoinfo-lab/pylib/mipylib/plotlib/miplot$py.class and b/meteoinfo-lab/pylib/mipylib/plotlib/miplot$py.class differ
diff --git a/meteoinfo-lab/pylib/mipylib/plotlib/miplot.py b/meteoinfo-lab/pylib/mipylib/plotlib/miplot.py
index 5828b631..f877f74b 100644
--- a/meteoinfo-lab/pylib/mipylib/plotlib/miplot.py
+++ b/meteoinfo-lab/pylib/mipylib/plotlib/miplot.py
@@ -295,9 +295,8 @@ def barh(*args, **kwargs):
@_copy_docstring_and_deprecators(Axes.hist)
-def hist(x, bins=10, range=None, density=False, cumulative=False,
- bottom=None, histtype='bar', align='mid',
- orientation='vertical', rwidth=None, log=False, **kwargs):
+def hist(x, bins=10, density=False, cumulative=False,
+ rwidth=None, **kwargs):
global g_axes
if g_figure is None:
figure()
@@ -308,8 +307,8 @@ def hist(x, bins=10, range=None, density=False, cumulative=False,
if g_axes.axestype != 'cartesian':
g_axes = axes()
- r = g_axes.hist(x, bins, range, density, cumulative,
- bottom, histtype, align, orientation, rwidth, log, **kwargs)
+ r = g_axes.hist(x, bins, density, cumulative,
+ rwidth, **kwargs)
if r is not None:
draw_if_interactive()
return r
diff --git a/meteoinfo-lab/pylib/mipylib/plotlib/plotutil$py.class b/meteoinfo-lab/pylib/mipylib/plotlib/plotutil$py.class
index 8d94ccf5..fe751754 100644
Binary files a/meteoinfo-lab/pylib/mipylib/plotlib/plotutil$py.class and b/meteoinfo-lab/pylib/mipylib/plotlib/plotutil$py.class differ
diff --git a/meteoinfo-lab/pylib/mipylib/plotlib/plotutil.py b/meteoinfo-lab/pylib/mipylib/plotlib/plotutil.py
index 976898af..bdc8d7f2 100644
--- a/meteoinfo-lab/pylib/mipylib/plotlib/plotutil.py
+++ b/meteoinfo-lab/pylib/mipylib/plotlib/plotutil.py
@@ -88,8 +88,8 @@ def getcolor(style, alpha=None):
if isinstance(style, Color):
c = style
- if not alpha is None:
- alpha = (int)(alpha * 255)
+ if alpha is not None:
+ alpha = int(alpha * 255)
c = Color(c.getRed(), c.getGreen(), c.getBlue(), alpha)
return c
@@ -117,6 +117,10 @@ def getcolor(style, alpha=None):
c = Color.magenta
elif style == 'pink' or style == 'p':
c = Color.pink
+ elif style == 'tan':
+ c = Color(210, 180, 140)
+ elif style == 'lime':
+ c = Color(124, 252, 0)
else:
try:
c = ColorUtil.parseToColor(style)
@@ -130,8 +134,8 @@ def getcolor(style, alpha=None):
else:
c = Color(style[0], style[1], style[2], style[3])
- if not alpha is None:
- alpha = (int)(alpha * 255)
+ if alpha is not None:
+ alpha = int(alpha * 255)
c = Color(c.getRed(), c.getGreen(), c.getBlue(), alpha)
return c