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

相关推荐
躺柒8 小时前
读数据可视化16大规模多变量空间数据(下)
人工智能·信息可视化·可视化·数据可视化·空间·大数据分析
百年੭ ᐕ)੭*⁾⁾8 小时前
Redash部署指南(Windows docker部署)
大数据·windows·docker·数据可视化·redash
玄魂9 小时前
VisActor 全新图可视化开源项目:VGraph
前端·数据可视化
桃西西呀12 小时前
刷短视频越刷越窄?SVD 奇异值分解,把 10 万条电影评分拆成你的品味特征
python·数学·数据可视化
一晌小贪欢13 小时前
Python办公18:PDF 转 Word——利用 OCR 技术批量提取不可编辑的文档内容
开发语言·python·pdf·word·excel·数据可视化·python办公
一晌小贪欢14 小时前
Python办公17:暴力拆分——按页数或指定范围提取 PDF 核心页面
java·开发语言·python·pdf·excel·数据可视化·python办公
matlab代码1 天前
基于matlab的玉米种子计数设计(GUI界面)【源码58期】
开发语言·matlab
十三画者1 天前
【文献分享】abCRISPR:基于深度学习的脱碱基gRNA理性设计框架
人工智能·深度学习·数据挖掘·数据分析·数据可视化
蚂蚁集团数据体验技术1 天前
推荐免费工具,AntV 开源社区出品数据可视化产品 Sive
github·agent·数据可视化
吃好睡好便好1 天前
转换函数的使用
学习·matlab·生活·转换函数