Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making a chart bigger in size

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?

like image 857
vsoler Avatar asked Jul 10 '16 17:07

vsoler


People also ask

How do I make Excel chart bigger?

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.

Why can't I resize a chart in Excel?

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.

How do you increase the width of a chart title?

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?


1 Answers

You can skip the first plt.figure() and just use the argument figsize:

df2.plot(figsize=(20,10)) 

See docs.

like image 115
Stefan Avatar answered Oct 27 '22 21:10

Stefan