当前位置:网站首页>Matlab map with color representation module value size arrow
Matlab map with color representation module value size arrow
2022-08-05 02:18:00 【zdlwhereyougo】
The quiver function that comes with matlab can draw arrow graphs. The length of the arrow corresponds to the magnitude of the modulus value of the vector.If you want to achieve the same length of arrows, first normalize the arrows, calculate the magnitude of the modulus of all arrows, calculate the scaling factor of each arrow, and then scale the vertical and horizontal components so that the modulus of all arrows are equal.Then divide the modulus value into 256 values from large to small, and use the colormap matrix that comes with matlab to color the arrows in turn.
Look directly at the image: the left is the original image, the right is the adjusted image
Source code:
clc;close all;clear ;% construct dataload('wind','x','y','u','v')X = x(11:22,11:22,1);Y = y(11:22,11:22,1);U = u(11:22,11:22,1);V = v(11:22,11:22,1);%% default drawingfigurequiver(X,Y,U,V,'r')%% adjust drawingM=sqrt(U.^2+V.^2);% Calculated moduluscolorlist=jet;% load the color bar, you can also replace other, cool, winter, etc.Mdown=min(M(:));Mup=max(M(:));Mlist=linspace(Mdown,Mup,256);scaler1=Mup./M;% length adjustment factorU=U.*scaler1;% Adjust each componentV=V.*scaler1;% Adjust each componentscaler2=0.05;% rescale the length to fit the drawingU=U*scaler2;V=V*scaler2;figure[m,n]=size(X);for i=1:mfor j=1:nMtemp=abs(M(i,j)-Mlist);index=find(Mtemp==min(Mtemp));colorarrow=colorlist(index,:);q =quiver(X(i,j),Y(i,j),U(i,j),V(i,j),'MaxHeadSize',100);% Draw each one separately and adjust the size of the arrowq.LineWidth=1;q.Color=colorarrow;hold onendendhc=colorbar;colormap(jet)hc.TickLabels=linspace(Mdown,Mup,11);
边栏推荐
- 《.NET物联网从零开始》系列
- 如何看待自己的羞愧感
- 【存储】曙光存储DS800-G35 ISCSI各映射LUN给服务器
- 关于#sql shell#的问题,如何解决?
- “配置”是把双刃剑,带你了解各种配置方法
- Understand the recommendation system in one article: Recall 06: Two-tower model - model structure, training method, the recall model is a late fusion feature, and the sorting model is an early fusion
- SuperMap支持的国产环境汇总
- 【PyQT5 绑定函数的传参】
- 迅睿cms网站搬迁换了服务器后网站不能正常显示
- Amazon Cloud Technology joins hands with Thundersoft to build an AIoT platform for industry customers
猜你喜欢
Programmer's list of sheep counting when insomnia | Daily anecdote
Simple implementation of YOLOv7 pre-training model deployment based on OpenVINO toolkit
编译预处理等细节
ExcelPatternTool: Excel表格-数据库互导工具
1349. 参加考试的最大学生数 状态压缩
英特尔 XDC 2022 精彩回顾:共建开放生态,释放“基建”潜能
01 【前言 基础使用 核心概念】
".NET IoT from scratch" series
LPQ (local phase quantization) study notes
线性表的查找
随机推荐
PHP Skills Assessment
使用SuperMap iDesktopX数据迁移工具迁移ArcGIS数据
C语言基础知识 -- 指针
Transfer Learning - Distant Domain Transfer Learning
Greenplum数据库故障分析——能对数据库base文件夹进行软连接嘛?
网络安全与元宇宙:找出薄弱环节
DAY23:命令执行&代码执行漏洞
多线程(2)
【LeetCode刷题】-数之和专题(待补充更多题目)
MySQL3
js中try...catch和finally的用法
Hypervisor related knowledge points
用@Mapper查询oracle的分区情况报错
为什么他们选择和AI恋爱?
MySQL3
力扣-二叉树的最大的深度
The difference between a process in user mode and kernel mode [exclusive analysis]
没有对象的程序员如何过七夕
Oracle encapsulates restful interfaces into views
Greenplum Database Fault Analysis - Can a Soft Connection Be Made to the Database Base Folder?