python - matplotlib how to correctly plot text in subplot -


enter image description here

this image plot using:

subplot(1,2,1) hist(...) subplot(1,2,2) text(...) 

but don't want border of second plot , want text on upper left of plot. how can make it?

try this:

subplot(1,2,1) hist(...) ax2 = subplot(1,2,2) ax2.set_xticks([]) ax2.set_yticks([]) spine in ax2.spines.values():     spine.set_visible(false) ax2.invert_yaxis() ax2.text(..., verticalalignment="top") 

update:

as pointed out in comments, can do:

subplot(1,2,1) hist(...) ax2 = subplot(1,2,2) ax2.axis("off") ax2.invert_yaxis() ax2.text(..., verticalalignment="top") 

although remove default axis background (depending on settings , matplotlib version, may leave gray background color).


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -