matplotlib ---- python plotting library

转换 绘制结果成 np.ndarray

https://stackoverflow.com/questions/7821518/matplotlib-save-plot-to-numpy-array

字符串方式

  1. fig.canvas.tostring_rgb
  2. np.fromstring

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    
    import matplotlib.pyplot as plt
    import numpy as np
    
    # Make a random plot...
    fig = plt.figure()
    fig.add_subplot(111)
    
    # If we haven't already shown or saved the plot, then we need to
    # draw the figure first...
    fig.canvas.draw()
    
    # Now we can save it to a numpy array.
    data = np.fromstring(fig.canvas.tostring_rgb(), dtype=np.uint8, sep='')
    data = data.reshape(fig.canvas.get_width_height()[::-1] + (3,))

ByteIO 方式

  1. fig.savefig(byteioObj, format='png', dpi=180)
  2. byteioObj.seek(0)
  3. numpy.frombuffer(byteioObj)
  4. cv2.cvtColor

Emacs Editing Commands

M-z zap-to-char

  • 剪切到后面第一次出现给定的字符

M-c capitalize-word

  • 给定单词,首字母大写

M-l downcase-word

  • 注意

    • 光标生效位置

      • 单词的开头
    • 完成操作后,光标位置

      • 单词尾部

M-u upcase-word

C-x C-l downcase-region

  • 全部转成小写

C-x C-u upcase-region

  • 全部转成大写

M-s isearch prefix 搜索

M-s .

  • isearch 光标下的 symbol(单词)

M-s _

  • isearch symbol

M-s w isearch

  • 搜索单词 word

M-s o search occured symbol

  • 右侧弹出搜索结果

M-s h highlight prefix 高亮

M-s h .

  • 高亮当前 symbol

M-s h u

  • 取消高亮

M-h M-w eww search

M-r 在 top, middle, bottom 三个位置移动光标

  • 类似 vim 命令 H, M, L

M-y yank pop

  • 删除上一次 yank 存储的内容

markdown ---- a simplified notes making markup language

链接和图片

链接

1
2
3
4
5
6
7
8
  链接
  [text](real path link)
  [text][reference link]


  图片
  ![text](real path link)
  ![text](reference link)

引用类型 reference link

用来简化输入,具体的链接,在文末或者某个地方说明即可