Making a figure longer in Python [duplicate]










1















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
enter image description here



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.










share|improve this question















marked as duplicate by ImportanceOfBeingErnest matplotlib
Users with the  matplotlib badge can single-handedly close matplotlib questions as duplicates and reopen them as needed.

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 use ax.set_position
    – Chris
    Nov 12 '18 at 17:11















1















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
enter image description here



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.










share|improve this question















marked as duplicate by ImportanceOfBeingErnest matplotlib
Users with the  matplotlib badge can single-handedly close matplotlib questions as duplicates and reopen them as needed.

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 use ax.set_position
    – Chris
    Nov 12 '18 at 17:11













1












1








1








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
enter image description here



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.










share|improve this question
















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
enter image description here



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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 '18 at 10:58

























asked Nov 12 '18 at 17:03









woody

85031329




85031329




marked as duplicate by ImportanceOfBeingErnest matplotlib
Users with the  matplotlib badge can single-handedly close matplotlib questions as duplicates and reopen them as needed.

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 matplotlib
Users with the  matplotlib badge can single-handedly close matplotlib questions as duplicates and reopen them as needed.

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 use ax.set_position
    – Chris
    Nov 12 '18 at 17:11












  • 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







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












2 Answers
2






active

oldest

votes


















1














use figsize parameter of plot function




figsize=(length, height)




df.plot(figsize=(20,20), kind='barh')
plt.show()





share|improve this answer




























    1














    Give the figure more height:



    fig, ax = plt.subplots(figsize=(15,15))
    ax.plot(kind='barh')
    plt.show()





    share|improve this answer



























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1














      use figsize parameter of plot function




      figsize=(length, height)




      df.plot(figsize=(20,20), kind='barh')
      plt.show()





      share|improve this answer

























        1














        use figsize parameter of plot function




        figsize=(length, height)




        df.plot(figsize=(20,20), kind='barh')
        plt.show()





        share|improve this answer























          1












          1








          1






          use figsize parameter of plot function




          figsize=(length, height)




          df.plot(figsize=(20,20), kind='barh')
          plt.show()





          share|improve this answer












          use figsize parameter of plot function




          figsize=(length, height)




          df.plot(figsize=(20,20), kind='barh')
          plt.show()






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 12 '18 at 17:24









          t-prisar

          6971619




          6971619























              1














              Give the figure more height:



              fig, ax = plt.subplots(figsize=(15,15))
              ax.plot(kind='barh')
              plt.show()





              share|improve this answer

























                1














                Give the figure more height:



                fig, ax = plt.subplots(figsize=(15,15))
                ax.plot(kind='barh')
                plt.show()





                share|improve this answer























                  1












                  1








                  1






                  Give the figure more height:



                  fig, ax = plt.subplots(figsize=(15,15))
                  ax.plot(kind='barh')
                  plt.show()





                  share|improve this answer












                  Give the figure more height:



                  fig, ax = plt.subplots(figsize=(15,15))
                  ax.plot(kind='barh')
                  plt.show()






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 12 '18 at 17:13









                  yatu

                  4,6521423




                  4,6521423













                      這個網誌中的熱門文章

                      What does pagestruct do in Eviews?

                      Dutch intervention in Lombok and Karangasem

                      Channel Islands