ax_mg.minorticks_on()
mb_ylims = [2.37, 2.84]
mg_ylims = [2.09, 2.55]
xlims = [5, 11]
if eosName == "HShenEOS":
    eosName = "HShen"
    mb_ylims = [2.401, 3.1]
    mg_ylims = [2.21, 2.9]
    xlims = [2, 9]

ax_mb.set_ylim(mb_ylims)
ax_mb.set_xlim(xlims)
ax_mg.set_ylim(mg_ylims)
textPos = (0.45, 0.06)
plt.annotate(
    "$\\rho_\mathrm{b, max}=\,$%s $\,$ g cm$^{-3}$" % fixScientificNotation(rhob),
    textPos,
    xytext=textPos,
    xycoords="axes fraction",
    textcoords="axes fraction",
    fontsize=22,
)
textPos = (0.66, 0.16)
plt.annotate(
    eosName + "  $\,\,\\tilde{A}=%s\,\,$" % a,
    textPos,
    xytext=textPos,
    xycoords="axes fraction",
    textcoords="axes fraction",
    fontsize=22,
)
Exemple #2
0
                 c=colors[script],
                 marker=symbols[script],
                 ms=6,
                 lw=lineWidths[script],
                 dashes=dashList[i],
                 markeredgecolor=colors[script],
                 **labelKwarg)
        # plt.plot(*mbToroid, c=colors[script], marker=symbols[script], ms=6, lw=lineWidths[script],
        #          dashes=(20, 5), markeredgecolor=colors[script]
        # )
        del thisSet

    textPos = (0.7, 0.9 - 0.08 * i)
    dashPlotLeg.append(plert)
    dashLeg.append(r"$\rho_\mathrm{b, max}=\,$%s$\,$g cm$^{-3}$" %
                   fixScientificNotation(rhob))
    # plt.annotate(r"$\rho_\mathrm{b, max}=$%s" % fixScientificNotation(rhob), textPos, xytext=textPos,
    #                  xycoords='axes fraction', textcoords='axes fraction', fontsize=20)

plt.xlabel(r"$\Omega_c$ [$10^3$ rad s$^{-1}$]", labelpad=10)
#plt.axes().yaxis.set_minor_formatter(matplotlib.pyplot.FormatStrFormatter('%.0f'))
#plt.axes().yaxis.set_major_formatter(matplotlib.pyplot.FormatStrFormatter('%.0f'))
plt.ylabel("$\sim \\bar{E}$ [$10^{15}$ g cm$^{-3}$]", labelpad=5)
plt.ylabel("$r_e$  [km]", labelpad=5)
#plt.ylabel("$M_\mathrm{g}$ [$M_\odot$$]")
#removeExponentialNotationOnAxis('y')
legend1 = plt.legend(loc=2, handletextpad=0.2)
plt.minorticks_on()
if eosName == "HShenEOS":
    eosName = "HShen"
        thisSeq = cstSequence(thisSet, theSlice, filters)
        #mbToroid = thisSeq.getSeqPlot([xVar], ['baryMass'], ('RedMax>0.0',), xcolFunc=lambda x: x/1000.0)
        mgToroid = thisSeq.getSeqPlot([xVar], yVar, ('RedMax>0.0',), xcolFunc=xFunc, ycolFunc=yFunc)
        #if script == 'c30p10':

        plt.plot(*mgToroid, c=colors[script], marker=symbols[script], ms=6, lw=lineWidths[script],
        dashes=dashList[i], markeredgecolor=colors[script],
        **labelKwarg )
        # plt.plot(*mbToroid, c=colors[script], marker=symbols[script], ms=6, lw=lineWidths[script],
        #          dashes=(20, 5), markeredgecolor=colors[script]
        # )
        del thisSet

    textPos = (0.7, 0.9 - 0.08 * i)
    dashPlotLeg.append(plert)
    dashLeg.append(r"$\rho_\mathrm{b, max}=\,$%s$\,$g cm$^{-3}$" % fixScientificNotation(rhob))
    # plt.annotate(r"$\rho_\mathrm{b, max}=$%s" % fixScientificNotation(rhob), textPos, xytext=textPos,
    #                  xycoords='axes fraction', textcoords='axes fraction', fontsize=20)

plt.xlabel(r"$\Omega_c$ [$10^3$ rad s$^{-1}$]", labelpad=10)
#plt.axes().yaxis.set_minor_formatter(matplotlib.pyplot.FormatStrFormatter('%.0f'))
#plt.axes().yaxis.set_major_formatter(matplotlib.pyplot.FormatStrFormatter('%.0f'))
plt.ylabel("$\sim \\bar{E}$ [$10^{15}$ g cm$^{-3}$]", labelpad=5)
plt.ylabel("$r_e$  [km]", labelpad=5)
#plt.ylabel("$M_\mathrm{g}$ [$M_\odot$$]")
#removeExponentialNotationOnAxis('y')
legend1 = plt.legend(loc=2, handletextpad=0.2)
plt.minorticks_on()
if eosName == "HShenEOS":
    eosName = "HShen"
    del thisSet

plt.xlabel(r"$\Omega_c$ [$10^3$ rad s$^{-1}$]", labelpad=10)
#plt.axes().yaxis.set_minor_formatter(matplotlib.pyplot.FormatStrFormatter('%.0f'))
#plt.axes().yaxis.set_major_formatter(matplotlib.pyplot.FormatStrFormatter('%.0f'))
plt.ylabel("$M_\mathrm{b,g} \,\, [M_\odot]$", labelpad=5)
#removeExponentialNotationOnAxis('y')
plt.legend(loc=2)
plt.minorticks_on()
if eosName == "HShenEOS":
    eosName = "HShen"

textPos = (0.32, 0.85)
plt.annotate(eosName, textPos, xytext=textPos, xycoords='axes fraction', textcoords='axes fraction',
             fontsize=28)
textPos = (0.32, 0.74)
plt.annotate("$\\tilde{A}=%s$" % a, textPos, xytext=textPos, xycoords='axes fraction', textcoords='axes fraction',
             fontsize=28)
textPos = (0.45, 0.075)
plt.annotate(r"$\rho_\mathrm{b, max}=\,$%s$\,$g cm$^{-3}$" % fixScientificNotation(rhob), textPos, xytext=textPos, xycoords='axes fraction', textcoords='axes fraction',
             fontsize=25)
textPos = (0.7, 0.3)
plt.annotate("$M_\mathrm{g}$",
             textPos, xytext=textPos, xycoords='axes fraction', textcoords='axes fraction',
             fontsize=26)
textPos = (0.4, 0.55)
plt.annotate("$M_\mathrm{b}$",
             textPos, xytext=textPos, xycoords='axes fraction', textcoords='axes fraction',
             fontsize=26)
#plt.xlim(2, 9)
plt.show()
if eosName == "HShenEOS":
    eosName = "HShen"

#plt.gca().xaxis.set_major_formatter(locator)
#plt.text(1.2e15, 1.5, eosName, fontsize=26) # Mg LS220
#plt.text(1.2e15, 1.8, eosName, fontsize=26)  # Mb LS220
plt.text(10**15, 2.0, eosName, fontsize=26)  # Mb Shen
#plt.text(10 **15, 1.8, eosName, fontsize=26)  # Mg Shen
matplotlib.rc('xtick', labelsize=20)
matplotlib.rc('xtick.major', pad=6)
matplotlib.rc('ytick', labelsize=20)
inset = plt.axes([0.53, 0.22, 0.41, 0.32])  # OTHER
#inset = plt.axes([0.52, 0.22, 0.42, 0.31])  # Mg Shen
for thePlot in plotList:
    #print thePlot
    plt.plot(*thePlot[0], c=thePlot[1], ls=thePlot[2], dashes=thePlot[3])
plt.minorticks_on()
locator = matplotlib.ticker.MaxNLocator(3)
locator = matplotlib.ticker.MultipleLocator(3e14)
formatter = matplotlib.ticker.FuncFormatter(
    lambda x, y: fixScientificNotation(x, 2))
inset.xaxis.set_major_locator(locator)
inset.xaxis.set_major_formatter(formatter)
#inset.xaxis.set_label_text(fontsize=20)
plt.xlim([10e14, 2.0e15])  # Mb/Mg LS220
plt.xlim([8e14, 1.6e15])  # Mg/Mb Shen
#plt.ylim([2.25, 2.43])  # Mg LS220
plt.ylim([2.25, 2.79])  # Mb LS220
plt.ylim([2.51, 3.05])  # Mb Shen
#plt.ylim([2.53, 2.675])  # Mg Shen
plt.show()