Making a figure longer in Python [duplicate]
This question already has an answer here:
Making a chart bigger in size
1 answer
How do you change the size of figures drawn with matplotlib?
13 answers
I have a dataframe with one column and 80 rows, and I want to visualize it as a horizontal bar chart. I use pandas plot() function like this:
df.plot(kind='barh')
plt.show()
But, because my dataframe has too many rows, the result is
How I can make the figure longer? Becasue I think if the figure becomes longer, all the row information will fit into the vertical axis.
python-3.x pandas matplotlib data-visualization
marked as duplicate by ImportanceOfBeingErnest
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 12 '18 at 17:31
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Making a chart bigger in size
1 answer
How do you change the size of figures drawn with matplotlib?
13 answers
I have a dataframe with one column and 80 rows, and I want to visualize it as a horizontal bar chart. I use pandas plot() function like this:
df.plot(kind='barh')
plt.show()
But, because my dataframe has too many rows, the result is
How I can make the figure longer? Becasue I think if the figure becomes longer, all the row information will fit into the vertical axis.
python-3.x pandas matplotlib data-visualization
marked as duplicate by ImportanceOfBeingErnest
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 12 '18 at 17:31
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
1
Have you tried the previous SO question? How to change the size of figures in Matplotlib?
– Alex_P
Nov 12 '18 at 17:09
you can useax.set_position
– Chris
Nov 12 '18 at 17:11
add a comment |
This question already has an answer here:
Making a chart bigger in size
1 answer
How do you change the size of figures drawn with matplotlib?
13 answers
I have a dataframe with one column and 80 rows, and I want to visualize it as a horizontal bar chart. I use pandas plot() function like this:
df.plot(kind='barh')
plt.show()
But, because my dataframe has too many rows, the result is
How I can make the figure longer? Becasue I think if the figure becomes longer, all the row information will fit into the vertical axis.
python-3.x pandas matplotlib data-visualization
This question already has an answer here:
Making a chart bigger in size
1 answer
How do you change the size of figures drawn with matplotlib?
13 answers
I have a dataframe with one column and 80 rows, and I want to visualize it as a horizontal bar chart. I use pandas plot() function like this:
df.plot(kind='barh')
plt.show()
But, because my dataframe has too many rows, the result is
How I can make the figure longer? Becasue I think if the figure becomes longer, all the row information will fit into the vertical axis.
This question already has an answer here:
Making a chart bigger in size
1 answer
How do you change the size of figures drawn with matplotlib?
13 answers
python-3.x pandas matplotlib data-visualization
python-3.x pandas matplotlib data-visualization
edited Nov 14 '18 at 10:58
asked Nov 12 '18 at 17:03
woody
85031329
85031329
marked as duplicate by ImportanceOfBeingErnest
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 12 '18 at 17:31
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by ImportanceOfBeingErnest
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 12 '18 at 17:31
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
1
Have you tried the previous SO question? How to change the size of figures in Matplotlib?
– Alex_P
Nov 12 '18 at 17:09
you can useax.set_position
– Chris
Nov 12 '18 at 17:11
add a comment |
1
Have you tried the previous SO question? How to change the size of figures in Matplotlib?
– Alex_P
Nov 12 '18 at 17:09
you can useax.set_position
– Chris
Nov 12 '18 at 17:11
1
1
Have you tried the previous SO question? How to change the size of figures in Matplotlib?
– Alex_P
Nov 12 '18 at 17:09
Have you tried the previous SO question? How to change the size of figures in Matplotlib?
– Alex_P
Nov 12 '18 at 17:09
you can use
ax.set_position– Chris
Nov 12 '18 at 17:11
you can use
ax.set_position– Chris
Nov 12 '18 at 17:11
add a comment |
2 Answers
2
active
oldest
votes
use figsize parameter of plot function
figsize=(length, height)
df.plot(figsize=(20,20), kind='barh')
plt.show()
add a comment |
Give the figure more height:
fig, ax = plt.subplots(figsize=(15,15))
ax.plot(kind='barh')
plt.show()
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
use figsize parameter of plot function
figsize=(length, height)
df.plot(figsize=(20,20), kind='barh')
plt.show()
add a comment |
use figsize parameter of plot function
figsize=(length, height)
df.plot(figsize=(20,20), kind='barh')
plt.show()
add a comment |
use figsize parameter of plot function
figsize=(length, height)
df.plot(figsize=(20,20), kind='barh')
plt.show()
use figsize parameter of plot function
figsize=(length, height)
df.plot(figsize=(20,20), kind='barh')
plt.show()
answered Nov 12 '18 at 17:24
t-prisar
6971619
6971619
add a comment |
add a comment |
Give the figure more height:
fig, ax = plt.subplots(figsize=(15,15))
ax.plot(kind='barh')
plt.show()
add a comment |
Give the figure more height:
fig, ax = plt.subplots(figsize=(15,15))
ax.plot(kind='barh')
plt.show()
add a comment |
Give the figure more height:
fig, ax = plt.subplots(figsize=(15,15))
ax.plot(kind='barh')
plt.show()
Give the figure more height:
fig, ax = plt.subplots(figsize=(15,15))
ax.plot(kind='barh')
plt.show()
answered Nov 12 '18 at 17:13
yatu
4,6521423
4,6521423
add a comment |
add a comment |
1
Have you tried the previous SO question? How to change the size of figures in Matplotlib?
– Alex_P
Nov 12 '18 at 17:09
you can use
ax.set_position– Chris
Nov 12 '18 at 17:11