[Matplotlib-users] Any way to add figure string for subplots

谢瑾博 xiejinbo at mail.iap.ac.cn
Mon Jun 17 00:06:37 EDT 2019


Hi Vincent,
    Thanks, I have looked into this, and the labels works pretty fine!
         yours,
                Jinbo
> -----原始邮件-----
> 发件人: "vincent.adrien at gmail.com" <vincent.adrien at gmail.com>
> 发送时间: 2019-06-16 22:31:51 (星期日)
> 收件人: matplotlib-users at python.org
> 抄送: 
> 主题: Re: [Matplotlib-users] Any way to add figure string for subplots
> 
> Hi Jinbo,
> 
> You should be able to achieve this with `annotate`. Here is a small
> snippet demonstrating its basic use:
> ```python
> import matplotlib.pyplot as plt
> plt.ion()
> 
> fig, axs = plt.subplots(ncols=2, nrows=2)  # dummy 2x2 subplot grid
> 
> # NB: a better annotation tutorial is available at
> # https://matplotlib.org/tutorials/text/annotations.html
> for ax, label in zip(axs.flat, ["(a)", "(b)", "(c)", "(d)"]):
>     ax.annotate(label,
>                 (0.02, 0.03), xycoords="axes fraction",  # coordinates
>                 ha="left", va="bottom",  # horiz. & vertical alignement
>                 weight="bold", style="italic"  # font option examples
>                 )
> ```
> 
> If you need to draw a white box behind the annotations, please have a
> look at
> https://matplotlib.org/tutorials/text/annotations.html#annotating-with-text-with-box
> 
> Hopefully this helps.
> 
> Best regards,
> Adrien
> 
> Le 16/06/2019 à 10:47, 谢瑾博 a écrit :
> > Dear Users,
> > I am trying to do a subplot consist of several axes like one below. My
> > problem is that the small figure string for each subplot (a)(b)(c), if
> > there is any resource controlling this text, or I have to some other
> > configurations?
> > Jinbo
> > 
> > 
> > 
> > 
> > _______________________________________________
> > Matplotlib-users mailing list
> > Matplotlib-users at python.org
> > https://mail.python.org/mailman/listinfo/matplotlib-users
> > 
> 
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-users


--
Dr. Jinbo Xie
State Key Laboratory of Numerical Modeling for Atmospheric Sciences and Geophysical Fluid Dynamics (LASG)
Institute of Atmospheric Physics,Chinese Academy of Sciences 
e-mail: xiejinbo at mail.iap.ac.cn
Tel:86-10-8299-5419(o)


More information about the Matplotlib-users mailing list