How to reproduce a figure?
6 ビュー (過去 30 日間)
古いコメントを表示
Hi all,
The below figure is a copy from a journal and I would like to use such a figure to present my own data.
I would like to write a code that will reproduce the below figure or at least have an advice for a methodology to do this so that I can develop it myself. For example, how to make shading between 0.8 and 1 or how to split the graph in three columns.
The points are circle, square and diamond and error bars are std.
Could you help please?
0 件のコメント
採用された回答
Voss
2022 年 3 月 22 日
編集済み: Voss
2022 年 3 月 22 日
f = figure();
ax = axes( ...
'Parent',f, ...
'NextPlot','add');
% grey shading on top:
p = patch( ...
'Parent',ax, ...
'XData',[0 1 1 0], ...
'YData',[0.75 0.75 1 1], ...
'FaceColor',[0.8 0.8 0.8], ...
'EdgeColor','none');
% line separating axes into 3 parts:
gl = line( ...
'Parent',ax, ...
'XData',[1 1 NaN 2 2]/3, ...
'YData',[0 1 NaN 0 1]);
% boxplot() some random data, for instance:
random_data = rand(10,3);
bp = boxplot(random_data);
% rescale the XData of the boxplot objects to be
% centered at 1/6, 1/2, 5/6 instead of 1, 2, 3:
for ii = 1:numel(bp)
set(bp(ii),'XData',(get(bp(ii),'XData')*2-1)/6);
end
% tick labels, etc.:
set(ax, ...
'XLim',[0 1], ...
'YLim',[0 1], ...
'XTick',[1 3 5]/6, ...
'XTickLabel',{'Sag','Frnt','Tran'}, ...
'Layer','top', ...
'FontSize',14);
title('Hip: : LFM R^2');
3 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!