You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As an update, I looked at the code and cheated by using .render(Extent(800/4, 600/4)). So the image size is sort of ok (853 x 600) but the scaling is off. I get the image below:
So Extent seems to be for image size, but something seems to be wrong.
BTW, using version 0.7.0
Full code below:
import com.cibo.evilplot._
import com.cibo.evilplot.plot._
import com.cibo.evilplot.plot.aesthetics.DefaultTheme._
import com.cibo.evilplot.numeric.Point
import com.cibo.evilplot.geometry.Extent
import better.files._
import File._
import java.io.{File => JFile}
import javax.imageio.ImageIO
val data = Seq.tabulate(100) { i =>
Point(i.toDouble, scala.util.Random.nextDouble())
}
val plot = ScatterPlot(data)
// Supported out of the box: JPEG, PNG, GIF, BMP and WBMP
val property = "java.io.tmpdir"
val tempDir = System.getProperty(property)
val file1 = Utils.temporaryFile(tempDir, "_evilplot.png").toJava
val bufferedImage = plot
.xAxis()
.yAxis()
.frame()
.xLabel("x")
.yLabel("y")
.render(Extent(800/4, 600/4))
.asBufferedImage
ImageIO.write(bufferedImage, "png", file1)
file1.getPath
Activity
hmf commentedon Sep 10, 2019
As an update, I looked at the code and cheated by using
.render(Extent(800/4, 600/4)). So the image size is sort of ok (853 x 600) but the scaling is off. I get the image below:So
Extentseems to be for image size, but something seems to be wrong.BTW, using version
0.7.0Full code below: