diff --git a/uk/ac/sanger/artemis/components/Plot.java b/uk/ac/sanger/artemis/components/Plot.java
index 5a24f1de1757616800c3ed93e3537d071b716282..07eb3a9808e237870d056eb5a1142b9dc9aa9695 100644
--- a/uk/ac/sanger/artemis/components/Plot.java
+++ b/uk/ac/sanger/artemis/components/Plot.java
@@ -1031,11 +1031,12 @@ public abstract class Plot extends JPanel
     final FontMetrics fm = g.getFontMetrics();
     int font_width = fm.stringWidth("2");
 
-    int width = getWidth() - window_changer.getWidth() -
-               ((5*numPlots)*font_width);
+    int width = 0;
+    for(LineAttributes ln : lines)
+      width += ln.getLabelWidth(fm);
+    width = getWidth() - window_changer.getWidth() - width;
 
     g.translate(width,0);
-    // note GCFrameAlgorithm overrides this
     ((BaseAlgorithm)getAlgorithm()).drawLegend(g,font_height,
                                                font_width,lines, numPlots);
     g.translate(-width,0);