Another easy fix for legend() with trace=TRUE would be to replace "...)" by ", ...)" in this code: [...] if (trace) catn(" rect2(", left, ",", top, ", w=", w, ", h=", h, "...)", sep = "") [...] Cheers, Jerome