Skip to content

Commit 6f7e720

Browse files
committed
Format values in legend to 2 decimal places
1 parent 20c3dc9 commit 6f7e720

File tree

1 file changed

+2
-2
lines changed
  • EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/view/legend

1 file changed

+2
-2
lines changed

EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/view/legend/LegendPanel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ private void updateNodeColorPanel(Collection<EMDataSet> dataSets, EnrichmentMap
266266
double min = range.get(0) ;
267267
double max = range.get(1);
268268

269-
String posMaxLabel = max > 0 ? String.valueOf(max) : "N/A";
269+
String posMaxLabel = max > 0 ? String.format("%.2f", max) : "N/A";
270270
Color posMaxColor = colors.get(0);
271271
Color posMinColor = colors.get(colors.size()/2);
272272
ColorLegendPanel clpPos = new ColorLegendPanel(posMaxColor, posMinColor, posMaxLabel, "0", false);
@@ -288,7 +288,7 @@ private void updateNodeColorPanel(Collection<EMDataSet> dataSets, EnrichmentMap
288288

289289

290290
if(data == ChartData.NES_VALUE) { // need to show negative range
291-
String negMinLabel = min < 0 ? String.valueOf(min) : "N/A";
291+
String negMinLabel = min < 0 ? String.format("%.2f", min) : "N/A";
292292
Color negMaxColor = colors.get(colors.size()-1);
293293
Color negMinColor = colors.get(colors.size()/2);
294294
ColorLegendPanel clpNeg = new ColorLegendPanel(negMinColor, negMaxColor, "0", negMinLabel, false);

0 commit comments

Comments
 (0)