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

相关推荐
FIT2CLOUD飞致云6 小时前
新增多种图表类型,新增插件管理模块,DataEase开源数据可视化分析工具v2.8.0发布
开源·嵌入式·数据可视化
passion更好10 小时前
【matlab】【python】爬虫实战
爬虫·算法·matlab
FIT2CLOUD飞致云18 小时前
行业模板|DataEase旅游行业大屏模板推荐
开源·数据可视化·dataease·数据大屏·模板市场
小孟的CDN18 小时前
KL级数展开法随机场生成matlab代码——三维随机场
matlab·kl级数展开·三维随机场
逼子格19 小时前
20、matlab信号波形生成:狄利克雷函数、高斯脉冲和高斯脉冲序列
开发语言·matlab
FL1717131419 小时前
MATLAB中的SDPT3、LMILab、SeDuMi工具箱
开发语言·matlab
无敌海苔咪19 小时前
实验六 图像的傅立叶变换
图像处理·算法·计算机视觉·matlab·数字图像处理
Silver_7771 天前
WIFI信号状态信息 CSI 深度学习篇之CNN(Matlab)
深度学习·神经网络·机器学习·matlab
K-Liberty1 天前
VTK- 面绘制&体绘制
c++·图像处理·数据可视化
哥廷根数学学派1 天前
基于自编码器的时间序列异常检测方法(以传感器数据为例,MATLAB R2021b)
开发语言·人工智能·rnn·matlab·cnn