Answers for "add color to plot matlab based on x-axis label python"

2

change axis and axis label color matplotlib

import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.add_subplot(111)

ax.plot(range(10))
ax.set_xlabel('X-axis')
ax.set_ylabel('Y-axis')

ax.spines['bottom'].set_color('red')
ax.spines['top'].set_color('red')
ax.xaxis.label.set_color('red')
ax.tick_params(axis='x', colors='red')

plt.show()
Posted by: Guest on October-16-2020
5

matlab plot colors

'y' yellow
'm' magenta
'c' cyan
'r' red
'g' green
'b' blue
'w' white
'k' black
Posted by: Guest on May-12-2021

Python Answers by Framework

Browse Popular Code Answers by Language