[AstroPy] how to mark spectral lines in matplotlib?

gonghang.naoc ghang.naoc at gmail.com
Sun Dec 15 10:52:24 EST 2013


Hi,
Thank you. The method 'annotate' works.
I tried pip to install  module lineid_plot but failed.
My python environment is messed up now. I downloaded the  tar.gz file
lineid_plot-0.2.tar.gz ,then
$python setup.py
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: no commands supplied

However since 'annotate' works well, I will use  this general way.

cheers,
hang


On Sun, Dec 15, 2013 at 7:33 AM, Thøger Emil Rivera-Thorsen <
trive at astro.su.se> wrote:

>  On 14-12-2013 17:14, gonghang.naoc wrote:
>
>    Hi astropyers,
>  I have a ready made spectral line atlas. Is there a direct way to mark
> the spectral lines in one spectrum plot?
> I have found  a module called lineid_plot. However,I can not install it.
>
> The images below are three examples.
>  http://www.cv.nrao.edu/course/astr534/images/bandscan.gif
>
> http://skyserver.sdss3.org/dr8/en/tools/quicklook/quickobj.asp?id=1237662661600608302
>  http://inspirehep.net/record/878108/files/plot_mean_spec1.png
>
>  Thank you.
>
>  hang
>
>   I usually do this by reading my lines into a dict of the form {'Line
> Name': wavelength} and then using a code snippet like this:
>
> for theline in MWlines.keys():
>     ax.axvline(
>         x=MWlines[theline], ymin=.5, ymax=.99,
>         lw=1.5, color='grey', ls=':')
>     ax.annotate(
>         theline+' MW', (MWlines[theline]-.0, 2.2),
>         backgroundcolor='white', rotation='vertical',
>         horizontalalignment='center', color='grey')
>
> This will of course be varied slightly depending on the context, but
> that’s the basic idea.
>
>
>
> _______________________________________________
> AstroPy mailing listAstroPy at scipy.orghttp://mail.scipy.org/mailman/listinfo/astropy
>
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20131215/d0904aa8/attachment.html>


More information about the AstroPy mailing list