当前位置:网站首页>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);
边栏推荐
- 使用SuperMap iDesktopX数据迁移工具迁移ArcGIS数据
- Intel XDC 2022 Wonderful Review: Build an Open Ecosystem and Unleash the Potential of "Infrastructure"
- Greenplum Database Fault Analysis - Can a Soft Connection Be Made to the Database Base Folder?
- Exploding the circle of friends, Alibaba produced billion-level concurrent design quick notes are too fragrant
- “配置”是把双刃剑,带你了解各种配置方法
- PHP Skills Assessment
- leetcode-另一棵树的子树
- DAY22:sqli-labs 靶场通关wp(Less01~~Less20)
- 一文看懂推荐系统:召回06:双塔模型——模型结构、训练方法,召回模型是后期融合特征,排序模型是前期融合特征
- fragment可见性判断
猜你喜欢
KingbaseES V8 GIS数据迁移方案(2. Kingbase GIS能力介绍)
.Net C# Console Create a window using Win32 API
HOG特征学习笔记
开篇-开启全新的.NET现代应用开发体验
LPQ (local phase quantization) study notes
直播预告|30分钟快速入门!来看可信分布式AI链桨的架构设计
ExcelPatternTool: Excel table-database mutual import tool
Leetcode刷题——22. 括号生成
DAY22:sqli-labs 靶场通关wp(Less01~~Less20)
Pisanix v0.2.0 发布|新增动态读写分离支持
随机推荐
C语言基础知识 -- 指针
继承关系下构造方法的访问特点
刷爆朋友圈,Alibaba出品亿级并发设计速成笔记太香了
LPQ(局部相位量化)学习笔记
Optimizing the feed flow encountered obstacles, who helped Baidu break the "memory wall"?
Greenplum Database Fault Analysis - Why Does gpstart -a Return Failure After Version Upgrade?
KingbaseES V8 GIS data migration solution (2. Introduction to the capabilities of Kingbase GIS)
【MySQL系列】- LIKE查询 以%开头一定会让索引失效吗
AI+PROTAC|dx/tx完成500万美元种子轮融资
第09章 性能分析工具的使用【2.索引及调优篇】【MySQL高级】
迁移学习——Distant Domain Transfer Learning
Transfer Learning - Distant Domain Transfer Learning
How do programmers without objects spend the Chinese Valentine's Day
在这个超连接的世界里,你的数据安全吗
EBS uses virtual columns and hint hints to optimize sql case
2022了你还不会『低代码』?数据科学也能玩转Low-Code啦!
重新审视分布式系统:永远不会有完美的一致性方案……
C language basics -- pointers
[Endnote] Word inserts a custom form of Endnote document format
[ROS](10)ROS通信 —— 服务(Service)通信