Answers for "matplotlib x axis at the top"

0

matplotlib x axis at the top

import matplotlib.pyplot as plt
import matplotlib

fig = plt.figure()
ax = fig.add_axes([0.12,0.15,0.75,0.8])
ax.set_xlabel("X")
#Set axis to top
ax.xaxis.tick_top()
#Set x axis lable to top
ax.xaxis.set_label_position('top')
Posted by: Guest on September-02-2021

Python Answers by Framework

Browse Popular Code Answers by Language