当前位置:网站首页>Matlab | drawing of three ordinate diagram based on block diagram layout
Matlab | drawing of three ordinate diagram based on block diagram layout
2022-06-27 03:48:00 【slandarer】
About the code
This picture is on the official account 「 Marine and Atmospheric Sciences 」 What you see , Brother official account has given the drawing method of this kind of diagram , But it is found in the relatively new version (R2021a And after ), have access to tiledlayout The block diagram layout is more natural , So I got this push . For the old version, you can click the following jump link : Jump
Complete code and effect
% Generate a random set of data
x=0:.05:3*pi;
noise=(rand([1,length(x)])-0.5);
y1=sin(x-2)-5+noise.*.1;
y2=6.*cos(0.5*x)+noise.*.1;
y3=1.5.*sin(x)+0.5.*cos(x)+noise.*.3;
% Create a layout
tdl=tiledlayout(1,10);
% Reduce the blank area , Delete
tdl.TileSpacing='tight';
tdl.Padding='compact';
% The coordinate region of the first curve ==============================
ax1=axes(tdl);hold on
ax1.LineWidth=1.5; % Shaft thickness
ax1.YColor='k'; % Axis color (k: black )
ax1.XLabel.String='x'; % x Axis labels :'x'
ax1.YLabel.String='var1'; % y Axis labels :'var1'
ax1.Layout.TileSpan=[1 9];% The coordinate area accounts for 9/10 Width , Third y Axle occupation 1/10 Width
% Here is the first 1 Group data plot - - - - - - - - - - - - -
plot(ax1,x,y1,'k','LineWidth',2)
% The second curve coordinate area ==============================
% Other properties are similar to the previous coordinate region
% Set up Color by 'none'
% The coordinate area background can be set to transparent
% Let the previous drawing not be blocked
ax2=axes(tdl);hold on
ax2.LineWidth=1.5;
ax2.YAxisLocation='right';
ax2.Color='none';
ax2.YColor='r';
ax2.YLabel.String='var2';
ax2.Layout.TileSpan=[1 9];
% Here is the first 2 Group data plot - - - - - - - - - - - - -
plot(ax2,x,y2,'r','LineWidth',2)
% The coordinate area of the third curve ==============================
ax3=axes(tdl);hold on
ax3.Color='none';
ax3.YColor='none';
ax3.Layout.TileSpan=[1 9];
% Here is the first 3 Group data plot - - - - - - - - - - - - -
plot(ax3,x,y3,'b','LineWidth',2)
% Let the coordinate region x Axis Association
linkaxes(tdl.Children,'x')
% Draw the third y Axis , Occupy 1/10 Width , The color is b: Blue
ax4=axes(tdl,'LineWidth',1.5,'YAxisLocation','right',...
'Color','none','XColor','none');
ax4.YColor='b';
ax4.YLabel.String='var3';
ax4.Layout.Tile='east';
ax4.Layout.Tile=10;
linkaxes([ax3,ax4],'y')

边栏推荐
- Quickly master asp Net authentication framework identity - reset password by mail
- Mobilenet series (4): mobilenetv3 network details
- Promise [II. Promise source code] [detailed code comments / complete test cases]
- LDR6028 手机设备一边充电一边OTG传输数据方案
- Knowledge of iPhone certificate structure
- MATLAB | 三个趣的圆相关的数理性质可视化
- 真xx相来了?测试/开发程序员为什么不愿意加班,这是个疯狂的状态......
- 乐得瑞LDR6035 USB-C接口设备支持可充电可OTG传输数据方案。
- 2020:MUTANT: A Training Paradigm for Out-of-Distribution Generalizationin Visual Question Answering
- Il manque beaucoup de fichiers et de répertoires tels que scripts pendant et après l'installation d'anaconda3
猜你喜欢

QIngScan使用

2019LXMERT:Learning Cross-Modality Encoder Representations from Transformers

基于MobileNet-Yolov4搭建轻量化目标检测

PAT甲级 1021 Deepest Root
![Basic functions of promise [IV. promise source code]](/img/a0/8f28ec8951088b8e66e7079432f326.png)
Basic functions of promise [IV. promise source code]

事业观、金钱观与幸福观

promise源码-class版本【三、Promise源码】【代码详细注释/测试案例完整】

Record the method of reading excel provided by unity and the solution to some pits encountered

2021:passage retrieval for outside knowledgevisual question answering

PAT甲级 1023 Have Fun with Numbers
随机推荐
2019LXMERT:Learning Cross-Modality Encoder Representations from Transformers
使用promise的基本功能【四、Promise源码】
MySql的开发环境
Quickly master asp Net authentication framework identity - reset password by mail
真xx相来了?测试/开发程序员为什么不愿意加班,这是个疯狂的状态......
MobileNet系列(4):MobileNetv3网络详解
Logarithm
苹果唯一图谱架构常识
PAT甲级 1021 Deepest Root
Qingscan use
解码苹果手机证书文件方法
Knowledge of iPhone certificate structure
卷积神经网络(CNN)网络结构及模型原理介绍
Career outlook, money outlook and happiness outlook
resnet152 辣椒病虫害图像识别1.0
Anaconda3安装过程及安装后缺失大量文件,没有scripts等目录
手机新领域用法知识
ESP8266
Questions and answers of chlor alkali electrolysis process in 2022
iOS开发:对于动态库共享缓存(dyld)的了解