In this article, we will create bar charts with the help for vincent. Which is a library in python which does python to vega translation? It has the data capabilities of python and the visualization capabilities of javascript. It is built specifically for plotting Dataframes and series quickly.
Requirement : install vincent
Python3
Output :
Example 2: Bar chart with axis labels
Python3
$pip install vincentwarning : requires Pandas which requires numpy Example 1: Simple bar chart
# import the vincent library
import vincent
# To initialize vincent in the notebook
vincent.core.initialize_notebook()
# pass the parameters to the bar method
bar = vincent.Bar([30, 10, 20, 15, 45, 30, 5])
# Display the bar chart
bar.display()
Example 2: Bar chart with axis labels
# import the vincent library
import vincent
# To initialize vincent in the notebook
vincent.core.initialize_notebook()
# pass the parameters to the bar method
bar = vincent.Bar([30, 10, 20, 15, 45, 30, 5])
# give axis names
bar.axis_titles(x ='X-axis', y ='Y-axis')
# Display the bar chart
bar.display()
Output :
For more information on vincent bar charts and vincent visit this link
For more information on vincent bar charts and vincent visit this link