fromstarplotimportMapPlot,LambertAzEqArea,_fromstarplot.stylesimportPlotStyle,extensionsstyle=PlotStyle().extend(extensions.BLUE_MEDIUM,extensions.MAP,)p=MapPlot(projection=LambertAzEqArea(center_ra=0.5*15,center_dec=90),ra_min=23.21*15,ra_max=26.6*15,dec_min=49.5,dec_max=68,style=style,resolution=4000*1,scale=1.2,)p.constellations(where=[_.iau_id=="cas"])# only plot the lines of Cassiopeiap.stars(where=[_.magnitude<9,],bayer_labels=True,flamsteed_labels=True,)defdso_label(d):ifd.ngc:returnd.ngcifd.ic:returnf"IC{d.ic}"returnd.namep.nebula(where=[(_.magnitude.isnull())|(_.magnitude<8),],true_size=True,label_fn=dso_label,)p.open_clusters(where=[(_.magnitude.isnull())|(_.magnitude<8),],true_size=False,label_fn=lambdad:d.ngc,)p.constellation_labels()p.gridlines(dec_locations=[dfordinrange(0,90,5)],)p.export("map_cas.png",padding=0.5)