How to assign two colors in NumPy arrays

Viewed 25

I would appreciate if you can help me to change the color of my plots. I will be generating the same plot for another dataset and I want to assign two different color for the second plot. But I do not understand how to assign two different colors to the two arrays inside 'x'. I am new for programming and I think this is a basic programming question. I really appreciate any help.

from matplotlib import pyplot as plt
import numpy as np
from brokenaxes import brokenaxes

x = np.loadtxt('path_to_file/PLOT_WT,WTKD.txt', skiprows=1)
fig = plt.figure(figsize=(20,15))
bax = brokenaxes(xlims=((0,2204),(2205,4643),(4644,7146),(7147,8314),(8315,11244)), ylims=((0,4500),(10000,12000),(20000,22000),(48000,50000),(58000,60000)))
bax.plot(x)

following is how x looks like

array([[  4.07881833, 322.9688323 ],
       [164.6783962 , 380.974622  ],
       [220.0012743 , 494.9119062 ],
       ...,
       [122.5334251 , 127.8413985 ],
       [122.5334251 , 127.8413985 ],
       [122.5334251 , 127.8413985 ]])
0 Answers
Related