当前位置:网站首页>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);
边栏推荐
- Greenplum数据库故障分析——能对数据库base文件夹进行软连接嘛?
- SDC简介
- Live playback including PPT download | Build Online Deep Learning based on Flink & DeepRec
- hypervisor相关的知识点
- C学生管理系统 据学号查找学生节点
- 特殊矩阵的压缩存储
- The difference between a process in user mode and kernel mode [exclusive analysis]
- oracle将restful接口封装到视图中
- 使用SuperMap iDesktopX数据迁移工具迁移地图文档和符号
- [ROS](10)ROS通信 —— 服务(Service)通信
猜你喜欢
第09章 性能分析工具的使用【2.索引及调优篇】【MySQL高级】
Xunrui cms website cannot be displayed normally after relocation and server change
Programmer's list of sheep counting when insomnia | Daily anecdote
开篇-开启全新的.NET现代应用开发体验
MySQL learning
汇编语言之源程序
直播回放含 PPT 下载|基于 Flink & DeepRec 构建 Online Deep Learning
KingbaseES V8 GIS数据迁移方案(2. Kingbase GIS能力介绍)
".NET IoT from scratch" series
直播预告|30分钟快速入门!来看可信分布式AI链桨的架构设计
随机推荐
一文看懂推荐系统:召回06:双塔模型——模型结构、训练方法,召回模型是后期融合特征,排序模型是前期融合特征
C学生管理系统 据学号查找学生节点
Flink 1.15.1 集群搭建(StandaloneSession)
【PyQT5 绑定函数的传参】
Apache DolphinScheduler新一代分布式工作流任务调度平台实战-中
02 【开发服务器 资源模块】
金仓数据库 KingbaseES V8 GIS数据迁移方案(3. 基于ArcGIS平台的数据迁移到KES)
dotnet 6 为什么网络请求不跟随系统网络代理变化而动态切换代理
直播回放含 PPT 下载|基于 Flink & DeepRec 构建 Online Deep Learning
HOG特征学习笔记
<开发>实用工具
Programmer's list of sheep counting when insomnia | Daily anecdote
迁移学习——Distant Domain Transfer Learning
ExcelPatternTool: Excel table-database mutual import tool
继承关系下构造方法的访问特点
程序员失眠时的数羊列表 | 每日趣闻
Xunrui cms website cannot be displayed normally after relocation and server change
Short domain name bypass and xss related knowledge
SDC简介
DAY23:命令执行&代码执行漏洞