Index: src/hg/instinct/hgGeneset/drawingCode.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/instinct/hgGeneset/drawingCode.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -B -U 4 -r1.2 -r1.3
--- src/hg/instinct/hgGeneset/drawingCode.c	22 Jan 2010 05:11:28 -0000	1.2
+++ src/hg/instinct/hgGeneset/drawingCode.c	28 Jan 2010 23:19:35 -0000	1.3
@@ -127,20 +127,20 @@
     {
     val    = rd->val;    
     // Attempt to reduce number of hash calls by checking if we *just* searched 
     // for sample or feature id. 
-    if (rd->feature_id != prevFeatureId)
+    if (rd->sample_id != prevSampleId)
 	{
-	safef(id, sizeof (id), "%d", rd->feature_id);
+	safef(id, sizeof (id), "%d", rd->sample_id);
 	i = hashIntValDefault(settings->x_index, id, -1);
-	prevFeatureId = rd->feature_id;
+	prevSampleId = rd->sample_id;
 	}
 
-    if (rd->sample_id != prevSampleId)
+    if (rd->feature_id != prevFeatureId)
 	{
-	safef(id, sizeof (id), "%d", rd->sample_id);
+	safef(id, sizeof (id), "%d", rd->feature_id);
 	j = hashIntValDefault(settings->y_index, id, -1);
-	prevSampleId = rd->sample_id;
+	prevFeatureId = rd->feature_id;
 	}
 
     if (i < 0 || j < 0)
 	continue;
@@ -247,25 +247,25 @@
 struct slName *sl;
 int numFeatures = 0;
 for (sl = features; sl; sl = sl->next)
     {
-    if ((el = hashLookup(settings->x_index, sl->name)) != NULL)
+    if ((el = hashLookup(settings->y_index, sl->name)) != NULL)
 	continue;
-    hashAddInt(settings->x_index, sl->name, numFeatures);    
+    hashAddInt(settings->y_index, sl->name, numFeatures);    
     numFeatures += 1;
     }
 
 int numSamples = 0;
 for (sl = samples; sl; sl = sl->next)
     {
-    if ((el = hashLookup(settings->y_index, sl->name)) != NULL)
+    if ((el = hashLookup(settings->x_index, sl->name)) != NULL)
 	continue;
-    hashAddInt(settings->y_index, sl->name, numSamples);    
+    hashAddInt(settings->x_index, sl->name, numSamples);    
     numSamples += 1;
     }
 	 
-settings->x_scale = (double) width / (double) numFeatures;
-settings->y_scale = (double) height / (double) numSamples;
+settings->x_scale = (double) width / (double) numSamples;
+settings->y_scale = (double) height / (double) numFeatures;
 
 return settings;
 }
 

