I am working in java android platform. I am creating a child thread from main thread. I want to stop child thread as my requirments. My child thread has simple function which doesn't have any loop. I want to kill child thread and free resources it is using, whenever I want. I searched for it and I found inturrupt() function.my thread is:

public class childThread implements Runnable{
  public void run() {
     firstFunction();
     secondFunction();
    }
}


Main thread has this code to start above thread:

Thread tChild;
tChild = new Thread(new childThread(), "Child Thread");
tChild.start();


my run() function is calling function like this. How to I use inturrupt() in this? Please tell me any other way to kill child thread and deallocating its resources. Thank you.


Question: Scatterplots for subsets of multivariate data [Updated]
Answer: I'm still uncertain whether this is what you want.  Just make an array of plots and wrap it in Grid.  Fiddle with the options to get axes, dividers, etc. the way you want them.

The way I understand it, the data is really four subsets, each a group of datasets.  For each group, you want to plot one group vs. another group, for each pair of groups, data[[1, All, i ]] vs data[[1, All, j ]].  I'm still unsure about the desired coloring.  I've colored the plots by subset (which gives no extra information, except colors are pretty :).  The question states


  The individual colouring of the subsets is what i'm aiming for.


In the example plot, there are mixed colors.  I can only think that the plot is an amalgamation of subsets.  With my current understanding of the question, I don't how to use color to add more to each plot.  I feel like I'm missing something here.



Some random data with some structure:

SeedRandom[1];
data1 = Map[(# + RandomReal[{-0.1, 0.1}, 3])^Range[3] &amp;, RandomReal[{-1, 1}, {4, 4}], {-1}];
Dimensions[data1]


Plotting functions:

colorFn[subset_] := Hue[subset/4];
plot[subset_, datasets_] := Graphics[{colorFn[subset], Point[#]},
          AspectRatio -&gt; 1/GoldenRatio, ImageSize -&gt; 100] &amp; /@ datasets;


Mapping the plotting functions:

Grid[
 MapIndexed[plot[First@#2, Thread /@ Subsets[Transpose[#], {2}]] &amp;, data1],
 Dividers -&gt; All]




It's more interesting with 40 points instead of 4:

SeedRandom[1];
data1 = Map[(# + RandomReal[{-0.1, 0.1}, 3])^Range[3] &amp;, RandomReal[{-1, 1}, {4, 40}], {-1}];

Grid[
 MapIndexed[plot[First@#2, Thread /@ Subsets[Transpose@#, {2}]] &amp;, data1],
 Dividers -&gt; All]






Just to show the data is being processed as indicated:

foo = MapIndexed[Thread /@ Subsets[Transpose@#, {2}] &amp;, data1];
foo[[1, 1]] == Transpose@{data1[[1, All, 1]], data1[[1, All, 2]]}
foo[[1, 2]] == Transpose@{data1[[1, All, 1]], data1[[1, All, 3]]}
foo[[1, 3]] == Transpose@{data1[[1, All, 2]], data1[[1, All, 3]]}
(* etc. *)



True
True
True