安装 matplotlib,python怎么安装matplotlib.pyplot

  安装 matplotlib,python怎么安装matplotlib.pyplot

  iamakingacolormapofa 2d numpymeshgrid:

  x,y=NP.meshgrid(场,频率)))))))))).

  cs=ax.contourf(x,y,fields_freqs_abs_grid,cmap=viridis ,N=256))。

  用颜色绘制的valuesinfields _ freqs _ ABS _ grid已经过对数标度。

  由python smatplotlibiscase-其cales over 8 color seventhunhouse n=256 为for thenumberofrgbp pixels生成的颜色映射gthematlablanguageonthesamediaproducesacolormap with significant highlorcolorresolution。具有显著性水平的彩色地图或坎特利赫尔克或科罗索伦

  结果是:

  但我希望结果是:

  汉克你!

  解决方案

  在关于使用contourf(,I mnotsurifthisisaversiondependentissue,但在最新版本中,

  容器(不承认).

  在文档中可以看到,youwanttusenarag(语法:conto URF)x,y,z,n)来指定homany级别。你的n=256不会做任何事,URF(

  下面的代码是根据效率示例修改的,比较不同的解决方案

  将数组作为铭牌导入

  将matplotlib.pyplot作为血小板计数导入

  德尔塔=0.025

  x=y=NP.arange (-3.0,3.01,delta)))))))))。

  x,y=NP.meshgrid(x,y))。

  z=10*(jqDBL))。

  图,(ax1,ax2),(ax3,ax4 ) )=PLT.subplots ) 2,2)。

  fig.set _ size _ inches (8,6))。

  #您的代码示例

  ax1.set_title(yourcodesample))。

  ax1.set _ xlabel(字长异常) )。

  ax1。set _ y标签(句子长度异常))。

  CBAR1=fig.colorbar(cs1,ax=ax1))。

  # contourupton=7自动-选择的级别,

  #它应该给出sameasyourcode。

  N=7

  ax2.set_title(n=7)))))))。

  ax2.set _ xlabel(字长异常) )。

  ax2。set _ y标签(句子长度异常))。

  cbar2=fig.colorbar(cs2,ax=ax2))))))))))))))))。

  # contourupton=100自动级别。

  # theresolutionisstillnotashighasusingimshow(。

  N=100

  CS3=ax3.contourf(x,y,z,n,cmap=viridis )

  ax3.set_title(n=100 )。

  ax3.set _ xlabel(字长异常) )。

  ax3。set _ y标签(句子长度异常))。

  cbar3=fig.colorbar(cs3,ax=ax3))))))))))))))))。

  im=ax4.imshow(z,cmap=viridis ,origin=lower ,extent=(-3,-3,-3,3))

  ax4.set_title(atgdxxm))。

  ax4.set _ xlabel(字长异常) )。

  ax4。set _ y标签(句子长度异常))。

  CBAR4=fig.colorbar(im,ax=ax4))。

  图。紧密布局(

  plt.show())

郑重声明:本文由网友发布,不代表盛行IT的观点,版权归原作者所有,仅为传播更多信息之目的,如有侵权请联系,我们将第一时间修改或删除,多谢。

留言与评论(共有 条评论)
   
验证码: