python - matplotlib x axis on top interference with the title -


in following post (number 23) : moving x-axis top of plot in matplotlib, answer move x-axis on top given. not title.

i have plot x-axis on top , title, x label interfers title. how can separate xlabel title ?

thank

you can use y kwarg ax.set_title. experiment value of y suit needs.

import matplotlib.pyplot plt  fig, (ax1,ax2) = plt.subplots(1,2)  ax1.xaxis.tick_top() ax2.xaxis.tick_top()  ax1.set_title('title1') ax2.set_title('title2',y=1.05)  fig.savefig('title.png') 

enter image description here


Comments

Popular posts from this blog

apache - setting document root in antoher partition on ubuntu -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -

php - laravel retrieving profile firstname from model returns Object of class Illuminate\Database\Eloquent\Builder could not be converted to string -