当前位置:网站首页>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);边栏推荐
- 浅谈数据安全治理与隐私计算
- 英特尔 XDC 2022 精彩回顾:共建开放生态,释放“基建”潜能
- 迁移学习——Distant Domain Transfer Learning
- Log an error encountered when compiling google gn "I could not find a ".gn" file ..."
- dotnet 6 为什么网络请求不跟随系统网络代理变化而动态切换代理
- 1349. Maximum number of students taking the exam Status Compression
- Greenplum Database Fault Analysis - Can a Soft Connection Be Made to the Database Base Folder?
- 树形查找(二叉查找树)
- fragment可见性判断
- 如何基于OpenVINO POT工具简单实现对模型的量化压缩
猜你喜欢

Tree search (bintree)

Programmer's list of sheep counting when insomnia | Daily anecdote

How to simply implement the quantization and compression of the model based on the OpenVINO POT tool

2022 EdgeX中国挑战赛8月3日即将盛大开幕

树表的查找

nodeJs--封装路由
![Chapter 09 Use of Performance Analysis Tools [2. Index and Tuning] [MySQL Advanced]](/img/e7/61863c356e4c7bb03ba27865ee7be0.png)
Chapter 09 Use of Performance Analysis Tools [2. Index and Tuning] [MySQL Advanced]

IJCAI2022 | DictBert:采用对比学习的字典描述知识增强的预训练语言模型

多线程(2)

编译预处理等细节
随机推荐
js中try...catch和finally的用法
EBS uses virtual columns and hint hints to optimize sql case
ARM Mailbox
Intel XDC 2022 Wonderful Review: Build an Open Ecosystem and Unleash the Potential of "Infrastructure"
直播回放含 PPT 下载|基于 Flink & DeepRec 构建 Online Deep Learning
多线程(2)
1349. Maximum number of students taking the exam Status Compression
SuperMap iDesktop.Net之布尔运算求交——修复含拓扑错误复杂模型
关于#sql shell#的问题,如何解决?
海量服务实例动态化管理
短域名绕过及xss相关知识
【Endnote】Word插入自定义形式的Endnote文献格式
the mechanism of ideology
Greenplum Database Fault Analysis - Can a Soft Connection Be Made to the Database Base Folder?
Simple implementation of YOLOv7 pre-training model deployment based on OpenVINO toolkit
2022了你还不会『低代码』?数据科学也能玩转Low-Code啦!
如何创建rpm包
重新审视分布式系统:永远不会有完美的一致性方案……
开篇-开启全新的.NET现代应用开发体验
如何看待自己的羞愧感