0

Data:

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

data = pd.DataFrame(np.random.normal(size=(15,3)))

#Rename columns
data.set_axis(['Column A', 'Column B', 'Column C'], axis=1, inplace=True)
#Scale up 'Column C' by multiplying by 10
data['Column C'] = 10*data['Column C'] 

data

     Column A    Column B     Column C
0    0.533343   -0.850148   -13.540220
1   -1.017046   -0.251639     9.696086
2   -1.105660    0.847643     6.630310
3   -0.602264    0.453270     3.240231
4   -0.647184    1.980553    -3.133974
5    0.220081   -1.284932    -0.672163
6   -0.345261    0.323423    11.084272
7   -1.399270   -0.865116    10.093674
8    1.707021    0.997670    15.910471
9    1.734208    0.923476    11.496254
10  -0.839492    0.443219     0.417114
11  -1.177682   -0.076711    17.012328
12   0.663747    1.411722    -0.849140
13  -0.033935    1.646990     8.737031
14  -0.294897   -1.376758    -3.813244

data.plot(figsize=(15,10), secondary_y='Column C')

enter image description here

How can I add a y-axis label to the secondary y-axis on the right? Also, say I want to change the colors of all three lines, how do I do this?

Thank you!

user603535
  • 55
  • 5
  • 1
    Does this answer your question? [How to label y-axis when using a secondary y-axis?](https://stackoverflow.com/questions/32999619/how-to-label-y-axis-when-using-a-secondary-y-axis) – Hamzah Nov 11 '22 at 20:53

0 Answers0