Thanks Jerzy. It works fine. I may return to this topic for more discussion later.
chao Jerzy Karczmarczuk-2 wrote: > > Benjamin Root : >> Colorbars are a bit tricky. They are actually a subplot axes separate >> from your plotting axes. And I don't think they are very easy to >> remove. You could do a "cbar.axes.cla()", but that would still leave >> the "ticks", tick labels and the colorbar label. >> >> I am sure that there is a way to get to what you want, but it isn't >> immediately obvious. > Well, I tried with some success the following. Suppose the programme is: > > from pylab import * > fig = figure() > ax = fig.add_subplot(111) > data = rand(250, 250) > cax = ax.imshow(data) > cbar = fig.colorbar(cax) > show() > > Now, fig has two axes, the main, and the bar. The command > > fig.delaxes(fig.axes[1]) > > gets rid of the bar and the ticks. > Is there anything wrong with that? Of course, I knew that fig.axes[1] > was the bar, but finding it in a more complicated case should not be > difficult. > > All the best. > > Jerzy Karczmarczuk > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://old.nabble.com/how-to-remove-colorbar--tp33882320p33892056.html Sent from the matplotlib - users mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users