How to reproduce a figure?

6 次查看(过去 30 天)
Tomaszzz
Tomaszzz 2022-3-22
评论: Tomaszzz 2022-3-28
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?

采纳的回答

Voss
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 个评论
Tomaszzz
Tomaszzz 2022-3-28
Hi @_. I was trying to modify the code for my data but I am failing. I have posted a similar question here https://uk.mathworks.com/matlabcentral/answers/1682344-how-to-produce-a-grouped-errorbars just in case you would like to have a look.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Object Properties 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by