matlab - 在图形线的顶部绘制带有框架、刻度的 Matlab 图形

标签 matlab plot

考虑类似的东西

figure
plot(sin(0:0.01:pi))
axis tight
set(gca,'box','on','ticklength',[0.02 0.05])

然后将图表导出为 PDF 或其他格式。图表的线条位于刻度标签和轴的顶部。 (此外,轴的线没有正确相交,但那是另一回事了。)

有没有办法(可以自动化)在顶部绘制坐标轴?

最佳答案

尝试:

set(gca, 'Layer','top')

根据documentation page :

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 文件:

alt text

默认(图层=底部):

alt text

层=顶层:

alt text

关于matlab - 在图形线的顶部绘制带有框架、刻度的 Matlab 图形,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3655256/

相关文章:

python - 同一个图中的多个 matplotlib 图 + 到 pdf-Python

matlab - 选择正确的基本矩阵

Matlab 将标签放在簇上

MATLAB GUI 缩放多个绘图

matlab - 上采样和下采样图像的最佳方法

matlab - 在 MATLAB 中总结 Dice

python - 如何在 Python 中将 x 刻度调整为字符串值

python - seaborn : plotting graph from dataframe in loop not working as expected

plot - 使用副标题覆盖 ('visible' , 'off' ) matlab 中的图形属性

python - 在 matplotlib 线图上向 x 轴和图例添加月份