About 181,000 results
Open links in new tab
  1. python - Plot a bar plot from a Pandas DataFrame - Stack Overflow

    Assuming I have a DataFrame that looks like this: Hour V1 V2 A1 A2 0 15 13 25 37 1 26 52 21 45 2 18 45 45 25 3 65 38 98 14 I'm trying to create a bar plot to compare

  2. python - How to plot multiple bars grouped - Stack Overflow

    The trouble with using dates as x-values, is that if you want a bar chart like in your second picture, they are going to be wrong. You should either use a stacked bar chart (colours on top of each other) or group by date (a "fake" date on the x-axis, basically just grouping the data points).

  3. python - Plot a bar using matplotlib using a dictionary - Stack …

    The best way to implement it using matplotlib.pyplot.bar(range, height, tick_label) where the range provides scalar values for the positioning of the corresponding bar in the graph. tick_label does the same work as xticks(). One can replace it with an integer also and use multiple plt.bar(integer, height, tick_label).

  4. python - How to add value labels on a bar chart - Stack Overflow

    Stacked Bar Chart with Centered Labels: How to create and annotate a stacked proportional bar chart: How to calculate percent by row and annotate 100 percent stacked bars: Stacked bars are unexpectedly annotated with the sum of bar heights: How to plot a stacked bar with annotations for multiple groups: How to annotate only one category of a ...

  5. python - How to display the value on horizontal bars - Stack …

    I generated a bar plot, how can I display the value of the bar on each bar? Current plot: What I am trying to get: My code: import os import numpy as np import matplotlib.pyplot as plt x...

  6. python - Bar-Plot with two bars and two y-axis - Stack Overflow

    Now I'd like to plot a bar-plot with the age on the x-axis as labels. For each x-tick there should be two bars, one bar for the amount, and one for the price. I can get this working by using simply: df.plot(kind='bar') The problem is the scaling. The prices are so much higher that I can not really identify the amount in that graph, see:

  7. python - Sorting the order of bars in pandas/matplotlib bar plots ...

    What is the Pythonic/pandas way of sorting 'levels' within a column in pandas to give a specific ordering of bars in bar plot. For example, given: import pandas as pd df = pd.DataFrame({ 'gro...

  8. Python Create Bar Chart Comparing 2 sets of data

    Nov 7, 2018 · I have a notebook with 2* bar charts, one is winter data & one is summer data. I have counted the total of all the crimes and plotted them in a bar chart, using code: ax = summer["crime_type"].value_counts().plot(kind='bar') plt.show() Which shows a graph like: I have another chart nearly identical, but for winter:

  9. python - Pandas bar plot with binned range - Stack Overflow

    Mar 25, 2017 · I need to create a bar plot, where each bar will count a number of instances within a predefined range. For example, the following plot should have three bars with the number of points which fall into: [0 0.35], [0.35 0.7] [0.7 1.0] EDIT. Many thanks for your answers. Another question, how to order bins? For example, I get the following result:

  10. How to plot a superimposed bar chart using matplotlib in python?

    Jul 8, 2016 · You can produce a superimposed bar chart using plt.bar() with the alpha keyword as shown below. The alpha controls the transparency of the bar. N.B. when you have two overlapping bars, one with an alpha < 1, you will get a mixture of colours. As such the bar will appear purple even though the legend shows it as a light red.

Refresh