Answers for "matplotlib python remove oarameter labels from x axis"

1

python remove x and y values on plots

# Basic syntax:
ax.set_yticklabels([])
ax.set_xticklabels([])

# Example usage:
import matplotlib.pyplot as plt

# Create Figure and Axes instances
fig,ax = plt.subplots(1)

# Make your plot, set your axes labels
ax.plot(range(1, 10),range(10, 1, -1))
ax.set_ylabel('Y Label')
ax.set_xlabel('X Label')

# Turn off tick labels — tick marks remain but values are removed
ax.set_yticklabels([])
ax.set_xticklabels([])

plt.show()
Posted by: Guest on December-15-2020
-1

plt hide axis ticks

pythonCopyimport matplotlib.pyplot as plt

plt.plot([0, 10], [0, 10])
plt.xlabel("X Label")
plt.ylabel("Y Label")

ax = plt.gca()
ax.axes.xaxis.set_visible(False)
ax.axes.yaxis.set_visible(False)

plt.grid(True)
plt.show()
Posted by: Guest on August-06-2020

Code answers related to "matplotlib python remove oarameter labels from x axis"

Python Answers by Framework

Browse Popular Code Answers by Language