NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
hi all: thanks for your ealier insight, the thing with my X and Y axis scaling is that if you take a look at the attached code, you realised that only the scaling on the Z-axis is correct because it really matches the spikes height. i want the scale on the pi-axis to be up to 14 NOT 20 and secondly i will like the scale on the isotopicmass-axis to be up to 600,000 since the mass is in thousands and the original pi data does not exceed 14. but this is not really the case, it looks like the scale is set to the contents of the samples array which creates the grid. the thing is that my data is coming from a database, so i do not know in advance what the scale will be like.so the grid should be created based on the pi values and the mass values that comes from the database;as you can see from the shot, the grid is created seperately and the spikes put on the grid after reading the spike value from the proteinxwc object.I can similarly get the mass and pi value from the proteinxwc object,but how to use these values to make the spike correspond the axis and scale is the problem. i am wondering if you can show me some workaround on that, i think that will be very helpful, Isaac sample data in proteinxwc object is below Name mass pi ratio CBLC_HUMAN 502435 7.83 .6134969325153374 CIDA_HUMAN 2004671 9.34 .7692307692307692 private static final int NUM_SPIKES_X = 4; // number of spikes along Y axis private static final int NUM_SPIKES_Y = 3; // increase density value to make spikes "thinner" // decrease density value to make spikes "thicker" private static final int DENSITY = 5; double[][] samples new double[1][DENSITY * NUM_SPIKES_X * DENSITY * NUM_SPIKES_Y]; OuterLoop: for (int y=0; y<DENSITY * NUM_SPIKES_Y; y++) { for (int x=0; x<DENSITY * NUM_SPIKES_X; x++) { int ndx = y * DENSITY * NUM_SPIKES_X + x; if(x % DENSITY == 0&& y % DENSITY == 0 ) { i+=1; if (i==tex.size()) break OuterLoop; prodat pro= (prodat)tex.get(i); String name=(String)pro.getName(); double ratiox=pro.getProp(); double massx=pro.getMass(); double pix = pro.getPi(); ratioxValues.addElement(new proteinxwc(name,massx,pix,ratiox,x,y)); proteinxwc xwc=(proteinxwc)ratioxValues.get(i); double spike=Math.round(100*xwc.getRatio()); if(spike > 50) { samples[0][ndx]= spike; if (i==tex.size()) break OuterLoop; } else samples[0][ndx] =-1*spike if (i==tex.size()) break OuterLoop; }
visad
archives: