#!/usr/bin/python# -*- coding: utf8 -*-importmatplotlib.pyplotaspltimportmatplotlibasmplimportnumpyasnpfrommathimport*code_website='http://commons.wikimedia.org/wiki/User:Geek3/mplwp'try:importmplwpexceptImportError,er:print'ImportError:',erprint'You need to download mplwp.py from',code_websiteexit(1)name='mplwp_arccot_degreeaxis.svg'fig=mplwp.fig_standard(mpl)# add pi to xaxis labelsdefflabel(x,i):returnu'{}\u00B0'.format(int(180*x)).replace('-',u'\u2212')fig.gca().yaxis.set_major_formatter(mpl.ticker.FuncFormatter(flabel))# make space for labelsmplwp.move_axes(fig,3,0)fig.gca().yaxis.set_major_locator(mpl.ticker.MultipleLocator(0.25))xlim=-5,5;fig.gca().set_xlim(xlim)ylim=-0.125,1.125;fig.gca().set_ylim(ylim)mplwp.mark_axeszero(fig.gca())x=np.linspace(xlim[0],xlim[1],5001)y=[0.5-atan(xx)/piforxxinx]plt.plot(x,y,label='arccot')plt.legend(loc='upper center').get_frame().set_alpha(0.9)plt.savefig(name)mplwp.postprocess(name)