Informatics Practices
Compare bar() and barh() functions.
PyPlot
4 Likes
Answer
bar() function | barh() function |
---|---|
This function is used to create vertical bar charts. | This function is used to create horizontal bar charts. |
In a vertical bar chart, the bars are plotted along the vertical axis (y-axis) with their lengths representing the values being plotted. | In a horizontal bar chart, the bars are plotted along the horizontal axis (x-axis) with their lengths representing the values being plotted. |
The first sequence given in the bar() forms the x-axis and the second sequence values are plotted on y-axis. | The first sequence given in the barh() forms the y-axis and the second sequence values are plotted on x-axis. |
Answered By
1 Like