python - Adding a titled color bar and generally getting a colored scatter plot to look good -


i'm creating scatter plot colored according 2-d array, having trouble getting color bar set correctly alongside it. have far is:

self.fig1 = plt.figure('blahblahblah', (10.0,10.0))) ax2=plt.subplot(111) ax2.set_ylabel('blah') ax2.set_xlabel('blah') ax2.set_title.... ... ... cmap, norm = mpl.colors.from_levels_and_colors9[0.9, 0.975, 1.025, 1.1],['green', 'red', 'blue']) ax2.scatter(firstarray,secondarray,c=colordefiningarray,marker="o",cmap=cmap,norm=norm, vmin=0.9,vmax=1.1) cax=self.fig1.add_axes([0.95, 0.2, 0.02, 0.6]) #pulled these #s question, no idea mean cb = mpl.colorbar.colorbarbase(cax, cmap=cmap, norm=norm, spacing='poportional') cb.set_label('moreblah') #saving fig 

the color bar showing up, except doesn't have title. also, feel if there easier way this, can't seem figure out other questions.

edit: know it's issue saved image scaling. don't know how scale image without scaling figure. help?

thank in advance help!


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -