美文网首页
python proplot ax.format不同参数

python proplot ax.format不同参数

作者: 晨阳ouc | 来源:发表于2021-02-12 19:26 被阅读0次

    #----学习proplot format不同参数

    from matplotlib import pyplot as plt

    import proplot as plot

    import matplotlib

    matplotlib.rcParams['font.sans-serif'] = ['SimHei']  #设置简黑字体

    matplotlib.rcParams['axes.unicode_minus'] = False

    fig, ax = plot.subplots(nrows=2,ncols=2)

    #不同函数的format内容有所不同

    ax.format(suptitle='suptitle',  #figtitle='figtitle',

              title = 'titleA',

              titleloc = 'c',

              titlecolor = 'r',

              #titleweight = 'bold',

              ltitle='left title',  #ltitle, ctitle, rtitle, ultitle,

                                    #uctitle, urtitle, lltitle, lctitle, lrtitle

              rowlabels=['行1','行2'], #每行图标签,与leftlabels冲突,只选一个

              collabels=['列1','列2'], #每列图标签  与leftlabels冲突,只选一个

              #leftlabels='leftlabels', #leftlabels, rightlabels, toplabels, bottomlabels

              #llabels='llabels', #llabels, rlabels, tlabels, blabels等同于leftlabels等

              #xlabel='xlabel', 

              #ylabel='ylabel',

              ticklabelweight='bold',    #加粗

              yreverse=True,  #y轴反向

              alpha=0.8,        #透明度

              abc=True,

              abcstyle='(a)',  #a.  a)  (a) a) A.等等

              abcloc = 'ul',  #位置'c''l''r''lc''uc''ur''ul''ll''lr'。

              linewidth=2,    #坐标轴线宽

              ticklen=5,      #坐标轴数值刻度伸出的长度

              xticks = 0.2,  #x轴间隔

              yticks = 0.1,  #y轴间隔

              xlim = (0,0.8),

              ylim = (0,0.9),

              xtickloc = 'top',  #上下坐标轴'both''neither''top''bottom'(默认)

              ytickloc = 'both', #左右坐标轴'both''neither''right''left'(默认)

              )

    相关文章

      网友评论

          本文标题:python proplot ax.format不同参数

          本文链接:https://www.haomeiwen.com/subject/jtxexltx.html