小编Ben*_*n25的帖子

在 MATLAB 中绘图后的轴恢复

从文本文件绘制多种方法的输出后,未显示轴的右侧和上侧。我需要拥有它们并像当前轴一样将它们加粗。

绘制的数据来自存储了每种方法数据的文件。每个数据文件都是一个 256x2 的文件,其中包含 [0,1] 之间的值。第一列是精度,第二列是召回率。

figure
hold on
for m = 1:length(methods)
  prFileName = strcat(readpath,dataset, '_', methods{m}, '_PRCurve.txt');
  R = load(prFileName);
  precision = R(:, 1);
  recall = R(:, 2);
  plot(recall, precision,'color',methods_colors(m,:),'linewidth',2);    
end
axis([0 1 0 1]);
hold off
grid on;
legend('methode one','method two')
xlabel('Recall','fontsize',12);
ylabel('Precision','fontsize',12);
set(gcf,'color','w');  %Background color
ax = gca;  % current axes
ax.GridLineStyle='-';
ax.GridAlpha=0.7;
ax.XAxis.LineWidth=4;
ax.YAxis.LineWidth=4;
Grid.LineWidth = 3;
set(gca,'FontName','Arial','FontWeight','bold');
Run Code Online (Sandbox Code Playgroud)

我的输出:

绘制的图形

原始数据:

[0.201612 1.000000;0.473895 0.813213;0.509366 0.775938;0.524163 0.756849;0.536319 0.744732;0.544424 0.734892;0.552313 0.727097;0.557654 0.719293;0.561069 0.713474;0.565138 0.708002;0.568720 0.705004;0.572685 0.702411;0.574115 0.698205;0.576529 0.697134;0.579346 …
Run Code Online (Sandbox Code Playgroud)

matlab plot matlab-figure

2
推荐指数
1
解决办法
61
查看次数

标签 统计

matlab ×1

matlab-figure ×1

plot ×1