Answers for "plot x and y axis in matplotlib"

1

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
0

add y axis label matplotlib

plt.ylabel("Y axis label", fontsize=18)
Posted by: Guest on July-17-2021

Code answers related to "plot x and y axis in matplotlib"

Python Answers by Framework

Browse Popular Code Answers by Language