Exemplo n.º 1
0
        sAx.set_position(nuiAx.get_position())

        fig.delaxes(lnAx)
        fig.delaxes(omDAx)
        fig.delaxes(nuiAx)

        # Modify title position
        t = fig.texts[0]
        pos = list(t.get_position())
        pos[1] = 0.75
        t.set_position(pos)
        t.set_va("bottom")

        # Color adjust
        axes = (nAx, phiAx, jParAx, omAx, uiAx, sAx, ueAx)
        colors = seqCMap3(np.linspace(0, 1, len(axes)))

        # Recolor the lines
        for ax, color in zip(axes, colors):
            line = ax.get_lines()[0]
            line.set_color(color)
            # NOTE: Using the designated setter gives a comparion error
            line._markerfacecolor = color
            line._markeredgecolor = color

        # Set the colors
        sD[scan]["n"]["color"] = colors[0]
        sD[scan]["phi"]["color"] = colors[1]
        sD[scan]["jPar"]["color"] = colors[2]
        sD[scan]["om"]["color"] = colors[3]
        sD[scan]["ui"]["color"] = colors[4]
Exemplo n.º 2
0
# If we add to sys.path, then it must be an absolute path
commonDir = os.path.abspath("./../../../common")
# Sys path is a list of system paths
sys.path.append(commonDir)

from CELMAPy.plotHelpers import SizeMaker, PlotHelper, seqCMap3

scans = ("B0_0.1", "B0_0.08", "B0_0.06")
markers = ("*", "o", "s")
ls = (\
      (0, ()),\
      (0, (5, 5)),\
      (0, (3, 1, 1, 1)),\
     )

colors = seqCMap3(np.linspace(2 / 5, 1, len(scans))[::-1])
sD = {s:{"ls":l,"marker":m,"color":c}\
        for s, m, l, c in zip(scans, markers, ls, colors)}

for scan in scans:
    folder = "../../CSDXMagFieldScanAr/visualizationPhysical/{}/radialProfiles".format(
        scan)
    picklePath = os.path.join(folder, "n-phi-posOfFluct.pickle")
    with open(picklePath, "rb") as f:
        fig = pickle.load(f)

    ax = fig.get_axes()[2]

    # Get the line
    sD[scan]["line"] = ax.get_lines()[0].get_data()[1]
    xAxis = ax.get_lines()[0].get_data()[0]