Is it possible to graph multiple data sets in a single XYChart line graph?
I have multiple arrays of floats that I would like to graph together (with lines in different colors)...if this is possible, how would one go about it?
Thanks for any help!
Here is the example code (I've tried another setData, but that just then plots the second set without overlaying them):
import org.gicentre.utils.stat.*; // For chart classes.
// Sketch to demonstrate the use of the XYChart class to draw simple line charts.
// Version 1.0, 27th May, 2010.
// Author Jo Wood.
XYChart lineChart;
/** Initialises the sketch, loads data into the chart and customises its appearance.
At the end is the code snippet from the reference manual for pixels[].
So, you can set the color using an english word describing the color (in the case below, "pink"). My question is can you feed it a set of RGB values and get the english equivalent word back? So, (255, 255, 0) would return "yellow." Essentially, query pixels[] and instead of the RGB values, it returns the english equivalent word.
Is this possible? I am working on some code (will have other questions about it soon!) that goes through a series of images and counts the number of pixels in each that are red, yellow, and green. For example, to classify a pixel as red the R value has to be above 200 and the other two values have to be below 50. But I am testing this on "perfect" test images and the actual working images will have varying shades of each color and I will need to account for that. I'm playing around with ways to compare each of the values to each other, but that can get rather tedious...
If one cannot get the english color name back, are there any functions that can classify various shades of a given color as the color? Or will I have to "brute force" it?
Thanks!
james
color pink = color(255, 102, 204); loadPixels(); for (int i = 0; i < (width*height/2)-width/2; i++) { pixels[i] = pink; } updatePixels();
I am brand new to Processing, so I fear my initial questions might be obvious ones, but I find myself stuck and hope that someone might be kind enough to offer some advice.
I am analyzing an image and based upon certain criteria, I will want to crop out regions of this image and then save them out to separate files. The problem that I am encountering in the code below is that when I open the initial file (it's a 1360x1024 png file), I can use get() to specify a crop region and it works, but the output (to display as well as to the saved file) is the entire input image with the cropped region overlaid starting at 0, 0.
I guess this is expected...
I have tried leaving out size() and background() and then I simply get a 250x250 image of the standard background color...which I guess is exactly what my code is asking it to do...
So, how would I get just the cropped region to display, and is there a way I could simply save the cropped regions to a file without displaying them?