hi every body.my question is how can i plot subplot like this picture in Matlab. i want draw dotted line cross the subplots like red dotted line and write on it like blue circle.
2 次查看(过去 30 天)
显示 更早的评论
采纳的回答
jonas
2018-5-24
(1) learn how to use subplots
MATLAB has a function subplots() which is really easy to use. Personally I prefer the function tight_subplot() which is available on FileExchange ( link ), as it is a bit more convenient to specify the exact location of the axes.
(2) Once your plots are finished, you will want to make each axis invisible (except for the ones to the right):
set(gca,'ycolor','none','xcolor','none')
(3) learn about annotations
MATLAB can create a few default shapes, such as lines and circles, by the function annotation.
Try and see what happens, then post your results here and ask for more help if needed!
2 个评论
jonas
2018-5-24
编辑:jonas
2018-5-24
Then I'm going to recommend using tight_subplot() from fileexchange. I have given you something to start from,
%create 8x2 axes
[ha,pos]=tight_subplot(8,2,0.01,0.1,0.2)
%access one axes and plot something
axes(ha(1))
area([sin(0:0.01:2*pi)])
set(ha,'xcolor','none','ycolor','none')
%change properties of a single axes
set(ha(2),'ycolor',[0 0 0],...
'YAxisLocation','right')
%create lines (not connected to any axes)
l=annotation('line',[0.7 0.7],[0 1],...
'linestyle',':',...
'color',[1 0 0],...
'linewidth',3)
%create some text
t=annotation('textbox',[0.1 0.1 0.1 0.1],...
'string','hello!',...
'edgecolor','none')
This should give you an idea of what to do
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Subplots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!