Try   HackMD

.nc.csv時,
使用Matplotlib-Basemap作圖,遇到Error Code:
ValueError: At least one value in the dash list must be positive when using Basemap to transfer .nc file into .csv

個人開發環境:

  • Python version: 3.10.9
  • Matplotlib version: 3.6.2
  • IDE: VS Code

爬了Stackoverflow,可能的原因兩個:

  1. 屬性dashes不能為零,但是預設值是零,所以要自行assign
    *會用到dashes的函式有兩個:m.drawparallels and m.drawmeridians.
  2. 檢查有沒有任何函式的linewidth屬性=0 (線條寬度是零當然畫不出來!)
    *我碰到的也是m.drawparallels and m.drawmeridians裡的lw,但其他函式如果有lw也要注意。

Reference:
matplotlib basemap toolkit
plt.savefig(): ValueError: All values in the dash list must be positive