def save_fig(fignum, fname, formats=['png','svg','eps']): """Save figure fignum to multiple files with different formats and extensions given by the formats argument. These are platform-dependent and are specific to matplotlib's support. """ for f in formats: plt.figure(fignum).savefig(fname+'.'+f)
def save_fig(fignum, fname, formats=["png", "svg", "eps"]): """Save figure fignum to multiple files with different formats and extensions given by the formats argument. These are platform-dependent and are specific to matplotlib's support. """ for f in formats: plt.figure(fignum).savefig(fname + "." + f)
So for your example, if a is your axes object, you can do a.set_xticklabels([]) a.set_yticklabels([]) a.set_xticks([]) a.set_yticks([]) """ from matplotlib.matlab import figure, close, axes, subplot, show from matplotlib.numerix import arange, sin, pi t = arange(0.0, 1.0, 0.01) fig = figure(1) ax1 = fig.add_subplot(211) ax1.plot(t, sin(2*pi*t)) ax1.grid(True) ax1.set_ylim( (-2,2) ) ax1.set_ylabel('1 Hz') ax1.set_title('A sine wave or two') for label in ax1.get_xticklabels(): label.set_color('r') ax2 = fig.add_subplot(212) ax2.plot(t, sin(2*2*pi*t)) ax2.grid(True)
object.set_somestring(attribute) So for your example, if a is your axes object, you can do a.set_xticklabels([]) a.set_yticklabels([]) a.set_xticks([]) a.set_yticks([]) """ from matplotlib.matlab import figure, close, axes, subplot, show from matplotlib.numerix import arange, sin, pi t = arange(0.0, 1.0, 0.01) fig = figure(1) ax1 = fig.add_subplot(211) ax1.plot(t, sin(2 * pi * t)) ax1.grid(True) ax1.set_ylim((-2, 2)) ax1.set_ylabel('1 Hz') ax1.set_title('A sine wave or two') for label in ax1.get_xticklabels(): label.set_color('r') ax2 = fig.add_subplot(212) ax2.plot(t, sin(2 * 2 * pi * t)) ax2.grid(True) ax2.set_ylim((-2, 2))
labelc = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'] labelr = ['00', '10', '20', '30', '40', '50', '60', '70', '80', '90', 'A0', 'B0', 'C0', 'D0', 'E0', 'F0'] fontname = sys.argv[1] font = FT2Font(fontname) codes = font.get_charmap().items() codes.sort() # a 16,16 array of character strings chars = [ ['' for c in range(16)] for r in range(16)] colors = [ [0.95 for c in range(16)] for r in range(16)] figure(figsize=(8,4),dpi=120) for glyphind, ccode in codes: if ccode>=256: continue r,c = divmod(ccode,16) s = chr(ccode) chars[r][c] = s lightgrn = (0.5,0.8,0.5) title(fontname) tab = table(cellText=chars, rowLabels=labelr, colLabels=labelc, rowColours=[lightgrn]*16, colColours=[lightgrn]*16,