Attributeerror: 'Axessubplot' Object Has No Attribute 'Set_Color_Cycle'

I am trying to set colour cycle by the following code:

fig, axes = plt.subplots(1, 2, figsize=(20, 8.5))
plt.subplots_adjust(wspace=0.09, hspace=0.09)
axes[0].set_color_cycle(['#00FFFF','#0000FF','#DC143C' , '#A52A2A','#7FFF00','#8A2BE2','#000000','#D2691E',\
                           '#008B8B','#B8860B', '#006400', '#FF8C00','#8B0000','#2F4F4F','#FF1493','#FFD700',\
                           '#00FF00','#BA55D3', '#FF4500', '#800080'])

However, it pops up with

"AttributeError: 'AxesSubplot' object has no attribute 'set_color_cycle'"

import matplotlib as mpl, matplotlib.pyplot as plt
print(mpl.__version__)

gives the output: 3.1.1 Python Version- 3.7.4

2
Robert Thorne

Robert Thorne

Automotive & Future Transportation Editor

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.

Share this article