How to change the linewidth of hatch in matplotlib?

后端 未结 4 1166
执笔经年
执笔经年 2021-02-05 08:47

Is there a way to increase the width of hatch in matplotlib?

For example, the following code by specifying linewidth only changes the width of the edge. I

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-05 09:09

    As of matplotlib version 2.0, you can directly change the linewidth parameter, as follows:

    import matplotlib as mpl
    mpl.rcParams['hatch.linewidth'] = 0.1  # previous pdf hatch linewidth
    mpl.rcParams['hatch.linewidth'] = 1.0  # previous svg hatch linewidth
    

    This seems a better workaround than what folks have above. You can check the matplotlib version by:

    import matplotlib as mpl
    print(mpl.__version__) # should be 2.x.y
    

提交回复
热议问题