MATLAB制图代码【第二版】

MATLAB制图代码【第二版】

文档描述

Code describtion: This code is version 2 used for processing the data from the simulation and experiment.

Time : 2023.9.3

Author: PEZHANG

这是在第一版基础上,迭代出的第二版MATLAB制图代码,第二版的特点是以handle 的形式控制图窗的properties,此种形式更加贴近MATLAB的内在。

前置知识

figure图窗分为曲线、坐标轴、图窗背景三部分,这三个部分可以通过handle的形式对其properties进行操纵。

源代码

c 复制代码
clc;clear
close all

% get x、y data
x = 0:pi/20:2*pi;
y = sin(x);

% get the properties of line
l = plot(x,y);
l.LineWidth = 1;

% get the properties of figure
h = gcf;
h.Color = 'w';
h.Units = 'centimeters';
h.Position = [25 10 15 9];

% get the properties of axes
ax = gca;
ax.YGrid = 'on';
ax.FontSize = 13;
ax.XLabel.String = '时间 (s)';
ax.YLabel.String = '振幅 (m)';
ax.Title.String = '示例-正弦曲线';
ax.GridLineStyle = '--';
ax.Box = 'off';
print('-djpeg','-r600','示例-正弦曲线')

代码运行结果图

参考资料

【1】https://www.youtube.com/watch?v=CNayChYLAV8

【2】https://www.youtube.com/watch?v=sPC1-7K6qNU

【3】https://blog.csdn.net/qq_50632468/article/details/129691250

相关推荐
CodeCraft Studio12 小时前
空间天气监测,TeeChart助力实现太阳活动数据的可视化分析
信息可视化·数据挖掘·数据分析·数据可视化·teechart·科研图表·图表库
科研面壁者14 小时前
SPSS——独立样本T检验
数据库·人工智能·机器学习·信息可视化·数据分析·spss·数据处理
FIT2CLOUD飞致云1 天前
安全漏洞修复,API数据源支持添加时间戳参数,DataEase开源BI工具v2.10.17 LTS版本发布
开源·数据可视化·dataease·bi·数据大屏
RaLi和夕1 天前
Matlab创建传递函数,绘制零极点图1
matlab
wuk9982 天前
基于Matlab的彩色图像特征提取实现
人工智能·计算机视觉·matlab
yong99902 天前
基于互信息的Matlab多模态医学图像配准实现
开发语言·matlab
Evand J2 天前
【TCN与LSTM例程】TCN(时间卷积网络)与LSTM(长短期记忆)训练单输入单输出,用于拟合一段信号,便于降噪。MATLAB
网络·人工智能·matlab·lstm
图扑可视化2 天前
图扑 HT 智慧汽车展示平台全自研技术方案
汽车·数据可视化·组态监控·汽车展示
bubiyoushang8882 天前
基于MATLAB的自然图像梯度分布重尾特性验证方案
开发语言·matlab
CappuccinoRose3 天前
MATLAB学习文档(二十八)
开发语言·学习·算法·matlab