Solution for Matlab versions prior to R2014b
You can enter a new white bounding box and place it on top.
// example data x = linspace(-4,4,100); y = 16 - x.^2; plot(x,y); hold on ax1 = gca; set(ax1,'box','off') %// here you can basically decide whether you like ticks on %// top and on the right side or not %// new white bounding box on top ax2 = axes('Position', get(ax1, 'Position'),'Color','none'); set(ax2,'XTick',[],'YTick',[],'XColor','w','YColor','w','box','on','layer','top') %// you can plot more afterwards and it doesn't effect the white box. plot(ax1,x,-y); hold on ylim(ax1,[-30,30])
It is important to deactivate the ticks of the second axes in order to keep the firest ticks.

In Luis Mendoโs solution, the drawn lines are fixed and remain in their original position if you subsequently change the properties of the axes. This will not happen here; they are adapting to new limits. Use the correct pen for each team and there will be no problems.
Dan's solution is simpler, but not applicable for Matlab versions prior to R2014b .
thewaywewalk
source share