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

相关推荐
叶智辽2 天前
Three.js多视口渲染:如何在一个屏幕上同时展示三个视角
webgl·three.js·数据可视化
mCell4 天前
分享一个常用的文生图提示词
人工智能·llm·数据可视化
玄魂4 天前
Coze+ VisActor Skill:智能图表,触手可及
ai编程·数据可视化·coze
柳杉7 天前
使用Ai从零开发智慧水利态势感知大屏(开源)
前端·javascript·数据可视化
ANQH9 天前
Manim三大核心类详解
数据可视化
feifeigo12311 天前
matlab画图工具
开发语言·matlab
Gofarlic_oms111 天前
避免Kisssoft高级分析模块过度采购的科学评估方法
大数据·linux·运维·人工智能·matlab
rit843249911 天前
全变分正则化图像去噪的MATLAB实现
开发语言·matlab
Evand J11 天前
通过matlab实现机器学习的小项目示例(鸢尾花分类)
机器学习·支持向量机·matlab
bu_shuo11 天前
MATLAB命令行窗口中的字体放大操作
matlab·命令行