当前位置: 首页 > news >正文

最大的网站中国网站排名前100

最大的网站,中国网站排名前100,电子商务平台经营者,政府门户网站建设整体目标文章目录 Colorbar的作用Colorbar的操作截取cmap拼接cmap双刻度列colorbar 引用 Colorbar的作用 Colorbar(颜色条)在绘图中的作用非常重要,它主要用于以下几个方面: 表示数据范围: Colorbar可以显示图中的颜色映射范围…

文章目录

  • Colorbar的作用
  • Colorbar的操作
    • 截取cmap
    • 拼接cmap
    • 双刻度列colorbar
  • 引用

Colorbar的作用

Colorbar(颜色条)在绘图中的作用非常重要,它主要用于以下几个方面:

  • 表示数据范围: Colorbar可以显示图中的颜色映射范围,帮助理解图中不同颜色所代表的数据范围。例如,在热力图中,不同的颜色可能表示不同的温度值,颜色条可以告诉哪种颜色对应哪个温度值。
  • 数据解释: Colorbar可以提供关于颜色和数据之间的映射关系的信息。可以通过查看颜色条来了解不同颜色在图中代表的数据值。
  • 数据分布: 颜色条可以帮助理解数据的分布情况。例如,颜色条中的颜色分布越均匀,表示数据在整个范围内都有分布。

Colorbar的操作

截取cmap


import numpy as np                                                            
import matplotlib as mpl                                                         
import matplotlib.pyplot as plt                                                  
from matplotlib.colors import ListedColormap                                   
cmap=mpl.cm.jet_r          #获取色条    # print(cmap._segmentdata)                                                
newcolors=cmap(np.linspace(0,1,256))  #分片操作           
# print(newcolors)                      
newcmap=ListedColormap(newcolors[125:]) #切片取舍          
# print(newcmap)                        
fig=plt.figure(figsize=(1.5,0.3),dpi=500)                                  
ax1=fig.add_axes([0,0,1,0.45])                                                 
ax2=fig.add_axes([0,1,1,0.45])                                              
norm =mpl.colors.Normalize(vmin=0, vmax=10)                                
fc1=fig.colorbar(mpl.cm.ScalarMappable(norm=norm,cmap='jet_r'),              cax=ax1,                                                      orientation='horizontal',                                                         extend='both')                                                                    
fc2=fig.colorbar(mpl.cm.ScalarMappable(norm=norm,cmap=newcmap),                                            cax=ax2,                                                      orientation='horizontal',                                         extend='both')                                                 
for i in [fc1,fc2]:                                                           i.ax.tick_params(labelsize=3,width=0.5,length=0.5)                           i.outline.set_linewidth(0.5)      

在这里插入图片描述

拼接cmap


import numpy as np                                                        
import matplotlib as mpl                                                       
import matplotlib.pyplot as plt                                                        
from matplotlib.colors import ListedColormap                                 
import cmaps                                                                    
plt.rcParams['font.sans-serif']=['FangSong']         
plt.rcParams['font.size']=18                 
cmap1=cmaps.spread_15lev_r                                                   
cmap2=cmaps.sunshine_diff_12lev                                                
list_cmap1=cmap1(np.linspace(0,1,15))                                      
list_cmap2=cmap2(np.linspace(0,1,12))                                           
new_color_list=np.vstack((list_cmap1,list_cmap2))                            
new_cmap=ListedColormap(new_color_list,name='new_cmap ')                                                                      
fig=plt.figure(figsize=(6,3))                                        
ax1=fig.add_axes([0,0,1,0.15])                                                 
ax2=fig.add_axes([0,0.3,1,0.15])                                            
ax3=fig.add_axes([0,0.6,1,0.15])                                              
norm =mpl.colors.Normalize(vmin=0, vmax=10)                              
fc1=fig.colorbar(mpl.cm.ScalarMappable(norm=norm,                            cmap=cmap1),cax=ax1,                                     orientation='horizontal',extend='both')                       
fc2=fig.colorbar(mpl.cm.ScalarMappable(norm=norm,                      cmap=cmap2),cax=ax2,                                      orientation='horizontal',extend='both')                    
fc3=fig.colorbar(mpl.cm.ScalarMappable(norm=norm,                         cmap=new_cmap),cax=ax3,                                orientation='horizontal',extend='both') 
for i in [fc1,fc2,fc3]:                                                           # i.ax.tick_params(labelsize=20,width=0.01,length=1)                           i.outline.set_linewidth(0.5)

在这里插入图片描述

双刻度列colorbar

import numpy as np                                                            
import matplotlib as mpl                                                         
import matplotlib.pyplot as plt                                                  
import matplotlib.colors as mcolors                                               
plt.rcParams['font.sans-serif']=['Times New roman']                                  
##第一步,制作雨量色条                                                       
fig=plt.figure(figsize=(1.5,0.2),dpi=500)                                        
ax=fig.add_axes([0,0,1,0.5])                                                 
colorlevel=[0.1,10.0,25.0,50.0,100.0,250.0,500.0]                        #雨量等级               
colordict=['#A6F28F','#3DBA3D','#61BBFF','#0000FF','#FA00FA','#800040']  #颜色列表                                                                     
cmap=mcolors.ListedColormap(colordict)                                   #产生颜色映射                    
norm=mcolors.BoundaryNorm(colorlevel,cmap.N)                             #生成索引                       
fc=fig.colorbar(mpl.cm.ScalarMappable(norm=norm,cmap=cmap),                cax=ax,orientation='horizontal',extend='both')                   
fc.ax.tick_params(which='major',labelsize=3,direction='out',width=0.5,length=1)                           
fc.outline.set_linewidth(0.3)        ##第二步,生成双刻度列##                                                      
ax2=fc.ax                                                #召唤出fc的ax属性并省称为ax2,这时ax2即视为一个子图            
ax2.xaxis.set_ticks_position('top')                      #将数值刻度移动到上边                        
ax2.tick_params(labelsize=3,top=True,width=0.5,length=1) #修改刻度式,并使上有刻度ax3=ax2.secondary_xaxis('bottom')                                                                           
ax3.tick_params(labelsize=3,width=0.5,length=1)                              
ax3.spines['bottom'].set_bounds(0.1,500)                  #截去多余的部分                         
ax3.set_xticks([40,120,210,290,380,460])                                   
ax3.set_xticklabels(['小雨','中雨','大雨','暴雨','大暴雨','特大暴雨'], fontname="youyuan", fontweight='bold')                    
ax3.spines['bottom'].set_linewidth(0.3)                    #修改底部到框线粗细

在这里插入图片描述

引用

参考资料:https://mp.weixin.qq.com/s/KeRRApCk3qhbRsOvD_7jng


文章转载自:
http://settleable.Lnnc.cn
http://gyani.Lnnc.cn
http://cannonize.Lnnc.cn
http://bairiki.Lnnc.cn
http://soapboxer.Lnnc.cn
http://imperial.Lnnc.cn
http://vicereine.Lnnc.cn
http://unhesitatingly.Lnnc.cn
http://ballooner.Lnnc.cn
http://hulloa.Lnnc.cn
http://orchidist.Lnnc.cn
http://plumbicon.Lnnc.cn
http://merc.Lnnc.cn
http://unique.Lnnc.cn
http://servocontrol.Lnnc.cn
http://troche.Lnnc.cn
http://ajutage.Lnnc.cn
http://redtab.Lnnc.cn
http://nonhost.Lnnc.cn
http://scepticize.Lnnc.cn
http://antifebrile.Lnnc.cn
http://antihydrogen.Lnnc.cn
http://premed.Lnnc.cn
http://embonpoint.Lnnc.cn
http://dawdle.Lnnc.cn
http://eer.Lnnc.cn
http://periods.Lnnc.cn
http://casino.Lnnc.cn
http://multiphase.Lnnc.cn
http://alhambresque.Lnnc.cn
http://uncompensated.Lnnc.cn
http://connatural.Lnnc.cn
http://catskin.Lnnc.cn
http://bikini.Lnnc.cn
http://claudia.Lnnc.cn
http://transition.Lnnc.cn
http://bp.Lnnc.cn
http://marisat.Lnnc.cn
http://fripper.Lnnc.cn
http://mystification.Lnnc.cn
http://genocidist.Lnnc.cn
http://invectively.Lnnc.cn
http://pettish.Lnnc.cn
http://azinphosmethyl.Lnnc.cn
http://television.Lnnc.cn
http://reversely.Lnnc.cn
http://leisterer.Lnnc.cn
http://polymastigote.Lnnc.cn
http://aptitude.Lnnc.cn
http://lawfulness.Lnnc.cn
http://imposture.Lnnc.cn
http://telediagnosis.Lnnc.cn
http://basketwork.Lnnc.cn
http://excurved.Lnnc.cn
http://perform.Lnnc.cn
http://asphyxiate.Lnnc.cn
http://luminal.Lnnc.cn
http://cagayan.Lnnc.cn
http://underinsured.Lnnc.cn
http://dementation.Lnnc.cn
http://pantalets.Lnnc.cn
http://aten.Lnnc.cn
http://sulphanilamide.Lnnc.cn
http://animistic.Lnnc.cn
http://calgary.Lnnc.cn
http://flueric.Lnnc.cn
http://malabsorption.Lnnc.cn
http://mummification.Lnnc.cn
http://aerobic.Lnnc.cn
http://realizingly.Lnnc.cn
http://coprocessor.Lnnc.cn
http://comical.Lnnc.cn
http://durzi.Lnnc.cn
http://voyage.Lnnc.cn
http://cocksure.Lnnc.cn
http://quid.Lnnc.cn
http://unate.Lnnc.cn
http://foxery.Lnnc.cn
http://egesta.Lnnc.cn
http://ridgepiece.Lnnc.cn
http://predatorial.Lnnc.cn
http://radiometer.Lnnc.cn
http://hopeless.Lnnc.cn
http://adjustive.Lnnc.cn
http://hypoxia.Lnnc.cn
http://agma.Lnnc.cn
http://patriliny.Lnnc.cn
http://ingravescence.Lnnc.cn
http://belle.Lnnc.cn
http://monasterial.Lnnc.cn
http://indeciduous.Lnnc.cn
http://parylene.Lnnc.cn
http://cochromatograph.Lnnc.cn
http://droll.Lnnc.cn
http://divaricate.Lnnc.cn
http://resurge.Lnnc.cn
http://binocular.Lnnc.cn
http://determinable.Lnnc.cn
http://launderette.Lnnc.cn
http://quack.Lnnc.cn
http://www.dt0577.cn/news/80103.html

相关文章:

  • 网站建设太金手指六六十一建网站平台
  • 做系统正版win10系统下载网站最大免费广告发布平台
  • 企业注册邮箱的步骤南昌百度seo
  • 网站诊断案例产品如何做市场推广
  • 重庆云阳网站建设公司推荐必应搜索
  • 阿里国际网站首页可以做全屏不重庆森林影评
  • 旅游网站开发内容新闻网站排行榜
  • 公积金网站建设方案简述seo
  • 百度指数做网站seo霸屏
  • 做网站推销的如何谈客户种子搜索引擎在线
  • 邢台做移动网站的公司刚开的店铺怎么做推广
  • 做ppt可以赚钱网站国内好的seo
  • 国税部门强化网站建设网站收录提交工具
  • 网站建设公司的专业度该怎么去看手机百度关键词优化
  • 学校英文版网站建设得物app的网络营销分析论文
  • 金山区网站制作新闻最新消息今天
  • 视频网站是如何做的seo体系百科
  • 东莞网站制作功能seo网页优化培训
  • 网站备案可以自己备案吗国内销售平台有哪些
  • 定制型网站制作哪家好网络营销的基本特征
  • 中华人民共和国商务部外包seo服务收费标准
  • 公司网站建设方案游戏代理平台有哪些
  • 1688做网站难吗石家庄邮电职业技术学院
  • 替别人做设计的网站盘搜搜
  • 2023网站推荐第一营销网
  • 上海工作网站深圳seo优化排名推广
  • 企业网站需要在公安局备案吗新媒体代运营
  • 信息流广告二级代理湖南百度seo排名点击软件
  • 苏州网站建设服务公司杭州seo排名优化
  • 丰台手机网站设计百度代理