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

相关推荐
敲敲敲敲暴你脑袋9 小时前
Cesium绘制3D热力山丘图
数据可视化·canvas·cesium
德育处主任16 小时前
p5.js 四边形(quad)的基础用法
前端·数据可视化·canvas
简简单单做算法17 小时前
基于LSTM深度学习网络的视频类型分类算法matlab仿真
深度学习·matlab·分类·lstm·视频类型分类
小关会打代码19 小时前
Python编程进阶知识之第四课处理数据(pandas)
python·机器学习·pandas·数据处理
叫我:松哥1 天前
基于网络爬虫的在线医疗咨询数据爬取与医疗服务分析系统,技术采用django+朴素贝叶斯算法+boostrap+echart可视化
人工智能·爬虫·python·算法·django·数据可视化·朴素贝叶斯
Watermelo6171 天前
极致的灵活度满足工程美学:用Vue Flow绘制一个完美流程图
前端·javascript·vue.js·数据挖掘·数据分析·流程图·数据可视化
山烛1 天前
Python 数据可视化之 Matplotlib 库
开发语言·python·matplotlib·数据可视化
德育处主任2 天前
p5.js 线段的用法
javascript·数据可视化·canvas
2zcode2 天前
基于Matlab图像处理的水果分级系统
图像处理·人工智能·matlab
云天徽上2 天前
【数据可视化-70】奶茶店销量数据可视化:打造炫酷黑金风格的可视化大屏
python·信息可视化·数据分析·数据可视化·pyecharts