Closed wwulfric closed 3 months ago
import java.awt.Color; import smile.io.; import smile.plot.swing.; import org.apache.commons.csv.CSVFormat;
var toy = Read.csv("data/classification/toy200.txt", CSVFormat.DEFAULT.withDelimiter('\t'));
var canvas = ScatterPlot.of(toy, "V2", "V3", "V1", '.').canvas();
var image = canvas.toBufferedImage(400, 400);
javax.imageio.ImageIO.write(image, "png", new java.io.File("headless.png"));
BTW, this was covered in the FAQ of smile website.
Is your feature request related to a problem? Please describe.
I wanna plot and save it to a image file, then send it
Describe the solution you'd like View could have a save method.