考虑类似的东西
figure plot(sin(0:0.01:pi)) axis tight set(gca,'box','on','ticklength',[0.02 0.05])
然后将图表导出为 PDF 或其他格式。图表的线条位于刻度标签和轴的顶部。 (此外,轴的线没有正确相交,但那是另一回事了。)
有没有办法(可以自动化)在顶部绘制坐标轴?
最佳答案
尝试:
set(gca, 'Layer','top')
Layer
{bottom} | top
Draw axis lines below or above graphics objects. Determines whether to draw axis lines and tick marks on top or below axes children objects for any 2-D view (for example, when you are looking along the x-, y-, or z-axis). Use this property to place grid lines and tick marks on top of images.
为了直观地看到效果(放大 1200%),我将图保存为 PDF 文件:
默认(图层=底部):
层=顶层:
关于matlab - 在图形线的顶部绘制带有框架、刻度的 Matlab 图形,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3655256/