Sara-Iftikhar / easy_mpl

One stop-shop for matplotlib based visualizations
https://easy-mpl.readthedocs.io/
Other
10 stars 2 forks source link

colors does not describe how to use it, what should be contained in the array when changing colors on Taylor plot #9

Closed hlg211 closed 7 months ago

hlg211 commented 1 year ago

None of examples change colors and I would like to set colour points, please give an example of how to change it

AtrCheema commented 1 year ago

Hey, you can change the color of markers as below

import numpy as np
from easy_mpl import taylor_plot

# The desired covariance matrix.
cov = np.array(
       [[1,  0.8, 0.6, 0.4, 0.2],
       [0.8, 1.2, 0.8, 0.6, 0.4],
       [0.6, 0.8, 0.8, 0.8, 0.6],
       [0.4, 0.6, 0.8, 1.4, 0.8],
       [0.2, 0.4, 0.6, 0.8, 0.6]]
)

# Generate the random samples.
rng = np.random.default_rng(313)
data = rng.multivariate_normal(np.zeros(5), cov, size=100)
print(data.shape)

observations =  data[:, 0]
simulations =  {"LSTM": data[:, 1],
            "CNN": data[:, 2],
            "TCN": data[:, 3],
            "CNN-LSTM": data[:, 4]}
_ = taylor_plot(observations=observations,
            simulations=simulations,
            title="Taylor Plot",
                colors=["red", "blue", "green", 'yellow'],
                ref_color="purple"
                )