sclass rgbMakeGraph_Info { // input float overdrive = 1f; // output float min, max; public S toString() { ret "min: " + min + ", max: " + max; } } static RGBImage rgbMakeGraph(float[] data) { ret rgbMakeGraph(data, null); } static RGBImage rgbMakeGraph(float[] data, rgbMakeGraph_Info info) { if (empty(data)) ret new RGBImage(1, 1); float min = min(data), max = max(min+0.0001f, max(data)); if (info != null) { info.min = min; info.max = max; } int w = l(data), h = 60; RGBImage img = new RGBImage(w, h, Color.white); Color foreground = Color.red; for x to w: { float f = (data[x]-min)/(max-min); if (info != null) f *= info.overdrive; int y1 = max(0, iround(h*(1-f))); for (int y = y1; y < h; y++) img.setPixel(x, y, foreground); } ret img; }