Ejemplo n.º 1
0
def addNewAxes(rect=None, frameon=True, patchcolor='none'):
	""" addNewAxes(pos=None, frameon=True): Add new axes to plot, setting it as active one.\n rect = Axes area, None to copy last axes data.\n frameon = True to show frame, False otherwise.\n patchcolor = Patch color, 'none' for transparent plot. """
	plt = getPlot()
	if not plt:
		return None
	fig = plt.fig
	if rect == None:
		rect = plt.axes.get_position()
	ax = fig.add_axes(rect, frameon=frameon)
	ax.xaxis.set_ticks_position('bottom')
	ax.spines['top'].set_color('none')
	ax.yaxis.set_ticks_position('left')
	ax.spines['right'].set_color('none')
	ax.patch.set_facecolor(patchcolor)
	plt.axesList.append(ax)
	plt.setActiveAxes(-1)
	plt.update()
	return ax
Ejemplo n.º 2
0
def addNewAxes(rect=None, frameon=True, patchcolor='none'):
    """ addNewAxes(pos=None, frameon=True): Add new axes to plot, setting it as active one.\n rect = Axes area, None to copy last axes data.\n frameon = True to show frame, False otherwise.\n patchcolor = Patch color, 'none' for transparent plot. """
    plt = getPlot()
    if not plt:
        return None
    fig = plt.fig
    if rect == None:
        rect = plt.axes.get_position()
    ax = fig.add_axes(rect, frameon=frameon)
    ax.xaxis.set_ticks_position('bottom')
    ax.spines['top'].set_color('none')
    ax.yaxis.set_ticks_position('left')
    ax.spines['right'].set_color('none')
    ax.patch.set_facecolor(patchcolor)
    plt.axesList.append(ax)
    plt.setActiveAxes(-1)
    plt.update()
    return ax