Issue
I'm currently trying to change the secondary y-axis values in a matplot graph to ymin = -1
and ymax = 2
. I can't find anything on how to change the values though. I am using the secondary_y = True
argument in .plot()
, so I am not sure if changing the secondary y-axis values is possible for this. I've included my current code for creating the plot.
df.plot()
df.plot(secondary_y = "Market")
Solution
From your example code, it seems you're using Pandas built in ploting capabilities. One option to add a second layer is by using matplotlib directly like in the example "two_scales.py".
It uses
import matplotlib.pyplot as plt
fig, ax1 = plt.subplots()
ax1.plot(df["..."])
# ...
ax2 = ax1.twinx()
ax2.plot(df["Market"])
ax2.set_ylim([0, 5])
where you can change the y-limits.
Answered By - Lageos
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.