Reputation: 2724
I'm trying to put label an axis, and I seem to be getting an error. I want to call the names of the strings I set earlier in the code.
ticker = 'RY', 'CM'
Then later on I call the names when naming the graph.
plt.ylabel('Price Spread between %s and %s') % (ticker[0], ticker[1])
But, I get this error:
TypeError: unsupported operand type(s) for %: 'Text' and 'tuple'
What am I doing wrong here?
Upvotes: 0
Views: 55
Reputation: 174696
Change the formatting line present on your code to,
plt.ylabel('Price Spread between %s and %s' % (ticker[0], ticker[1]))
Upvotes: 2