figure hold on h1 = plot(1:10,'r'); h2 = plot(2:11,'g'); if <your condition doesn't hold> set(h2,'Visible','off') end