I'm trying to get a bigger chart. However, the figure method from matplotlib does not seem to be working properly.
I get a message, which is not an error:
import pandas.io.data as web import pandas as pd import matplotlib.pyplot as plt %matplotlib inline ... plt.figure(figsize=(20,10)) df2['media']= df2['SPY']*.6 + df2['TLT']*.4 df2.plot() plt.show()
What's wrong with my code?
Click the chart, and then drag the sizing handles to the size that you want. Click the chart, and then on the Format tab, in the Size group, enter the size in the Shape Height and Shape Width boxes.
By default you cannot resize the chart by dragging the edges, you have to change the page borders in page setup. But another page setup trick is on the chart tab off the dialog, select the Custom size option. The chart sheet is still linked to the margins of the page, but you can resize the chart within the sheet.
To do this, leave the chart title box blank (or delete it), then click anywhere on the chart, then click the Layout tab under Chart tools, then click Text Box under Insert, then drag open a text box on the chart and type your chart title into it. This text box can be resized, formatted etc. Was this reply helpful?
You can skip the first plt.figure()
and just use the argument figsize:
df2.plot(figsize=(20,10))
See docs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With