haifengl / smile

Statistical Machine Intelligence & Learning Engine

Home Page:https://haifengl.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

smile.plot.swing.BarPlot works with smile-plot 3.0.2 but not with 3.1.0

appsofteng opened this issue · comments

With smile-plot 3.0.2 it works as I understand the API description, but with smile-plot 3.1.0 it throws an exception.
I read there was a change:

BarPlot.getUpperBound() computes wrong bound. #752.

What should the code look like to work with smile-plot 3.1.0?
Thank you.

new BarPlot(new Bar(new double[][] { { 1, 1 } }, 1, Color.RED),
	new Bar(new double[][] { { 2, 2 } }, 1, Color.BLUE)).canvas().window();

smile-plot 3.0.2
image

smile-plot 3.1.0

Exception in thread "main" java.lang.IllegalArgumentException: Lower bound is larger than upper bound.
	at smile.plot.swing.Base.<init>(Base.java:94)
	at smile.plot.swing.Canvas.initBase(Canvas.java:169)
	at smile.plot.swing.Canvas.<init>(Canvas.java:106)
	at smile.plot.swing.Canvas.<init>(Canvas.java:99)
	at smile.plot.swing.BarPlot.canvas(BarPlot.java:107)

Thanks for reporting. The fix is in master branch now. Please have a try.

v3.1.1 is released including the fix. Please let's know if it addresses the issue. Thanks!