Fixing issue of scale and translate with legend.