public static void writeBoxplot(TDoubleObjectHashMap<double[]> table,String file) throws IOException {
  int maxSize=0;
  TDoubleObjectIterator<double[]> it=table.iterator();
  for (int i=0; i < table.size(); i++) {
    it.advance();
    maxSize=Math.max(maxSize,it.value().length);
  }
  double keys[]=table.keys();
  Arrays.sort(keys);
  BufferedWriter writer=new BufferedWriter(new FileWriter(file));
  for (int k=0; k < keys.length; k++) {
    writer.write(String.valueOf(keys[k]));
    if (k + 1 < keys.length)     writer.write(TAB);
  }
  writer.newLine();
  for (int i=0; i < maxSize; i++) {
    for (int k=0; k < keys.length; k++) {
      double[] list=table.get(keys[k]);
      if (i < list.length) {
        writer.write(String.valueOf(list[i]));
      }
 else {
        writer.write(NA);
      }
      if (k + 1 < keys.length)       writer.write(TAB);
    }
    writer.newLine();
  }
  writer.close();
}

public static void writeBoxplot ( TDoubleObjectHashMap < double [ ] > table , String file ) throws IOException { int maxSize = 0 ; TDoubleObjectIterator < double [ ] > it = table . iterator ( ) ; for ( int i = 0 ; i < table . size ( ) ; i ++ ) { it . advance ( ) ; maxSize = Math . max ( maxSize , it . value ( ) . length ) ; } double keys [ ] = table . keys ( ) ; Arrays . sort ( keys ) ; BufferedWriter writer = new BufferedWriter ( new FileWriter ( file ) ) ; for ( int k = 0 ; k < keys . length ; k ++ ) { writer . write ( String . valueOf ( keys [ k ] ) ) ; if ( k + 1 < keys . length ) writer . write ( TAB ) ; } writer . newLine ( ) ; for ( int i = 0 ; i < maxSize ; i ++ ) { for ( int k = 0 ; k < keys . length ; k ++ ) { double [ ] list = table . get ( keys [ k ] ) ; if ( i < list . length ) { writer . write ( String . valueOf ( list [ i ] ) ) ; } else { writer . write ( NA ) ; } if ( k + 1 < keys . length ) writer . write ( TAB ) ; } writer . newLine ( ) ; } writer . close ( ) ; }
writes a table with one column for each map entry . columns are filled with the list of values in each map entry . column headers are the map keys . for instance , use this function to create boxplots .
