Esempio n. 1
0
def plot_yield(ax, element, study, MH, vrot, marker, color):
    """
	Plots a single IMF-averaged CCSN yield of Sr on the axis

	Parameters
	==========
	ax :: subplot
		The matplotlib axis object to plot on
	element :: str
		The element to plot the yield of
	study :: str
		The study to adopt the yields from
	MH :: real number
		The value of [M/H] to calculate the yield for
	vrot :: real number
		The rotational velocity of the stars in km/s
	marker :: str
		The name of the marker to plot the point in
	color :: str
		The name of the color to plot the yield in
	"""
    y = vice.yields.ccsne.fractional(element,
                                     study=study,
                                     MoverH=MH,
                                     rotation=vrot)[0]
    ax.scatter(MH,
               y,
               c=visuals.colors()[color],
               marker=visuals.markers()[marker],
               s=100)
Esempio n. 2
0
def plot_data(ax, data, dwarf):
    """
	Plots an individual dwarf galaxy's abundance data on the subplot.

	Parameters
	==========
	ax :: matplotlib subplot
		The axis to plot the abundance data on
	data :: 2D-list
		The raw data itself
	dwarf :: str
		A key denoting which dwarf is being plotted. These appear in the first
		column of the argument data.
	"""
    FeH_column = 12
    MgFe_column = 14
    fltrd = list(filter(lambda x: x[0] == dwarf, data))
    kwargs = {
        "c": visuals.colors()[_COLORS_[dwarf]],
        "marker": visuals.markers()[_MARKERS_[dwarf]],
        "linestyle": "None",
        "label": _NAMES_[dwarf],
        "s": _SIZES_[dwarf]
    }
    if dwarf == "LeoI": kwargs["zorder"] = 0
    ax.scatter([row[FeH_column] for row in fltrd],
               [row[MgFe_column] for row in fltrd], **kwargs)
Esempio n. 3
0
def plot_AGB_yields_fixed_Z(ax, m, y, color):
	"""
	Plots AGB star yields as a function of mass on a given subplot 

	Parameters 
	========== 
	ax :: subplot 
		The matplotlib axis object to plot on 
	m :: list 
		The stellar masses 
	y :: list 
		The fractional yields 
	color :: str 
		The name of the color to plot the yields in 
	"""
	ax.scatter(m, y, c = visuals.colors()[color], 
		marker = visuals.markers()["circle"])
	ax.plot(m, y, c = visuals.colors()[color])
Esempio n. 4
0
def plot_legend(ax):
    """
	Draws the legend on the axis

	Parameters
	==========
	ax :: subplot
		The matplotlib axis object to put the legend on
	"""

    # First label the studies ...
    lines = len(_STUDIES_) * [None]
    for i in range(len(lines)):
        lines[i] = ax.plot([-1, -2], [1.e-8, 1.e-6],
                           c=visuals.colors()["white"],
                           label=_NAMES_[_STUDIES_[i]])[0]
    leg = ax.legend(loc=visuals.mpl_loc()["lower right"],
                    ncol=1,
                    bbox_to_anchor=(0.99, 0.01),
                    frameon=False,
                    handlelength=0,
                    fontsize=18)
    for i in range(len(lines)):
        lines[i].remove()
        leg.get_texts()[i].set_color(_COLORS_[_STUDIES_[i]])
    ax.add_artist(leg)

    # ... then label the rotational velocities
    points = 3 * [None]
    for i in range(len(points)):
        points[i] = ax.scatter(
            [-1, -2], [1.e-8, 1.e-6],
            c=visuals.colors()["black"],
            s=50,
            marker=visuals.markers()[_MARKERS_[[0, 150, 300][i]]],
            label=r"$v_\text{rot}$ = %g km s$^{-1}$" % ([0, 150, 300][i]))
    ax.legend(loc=visuals.mpl_loc()["upper left"],
              ncol=1,
              bbox_to_anchor=(0.01, 0.99),
              frameon=False,
              fontsize=18,
              handlelength=1)
    for i in range(len(points)):
        points[i].remove()