About 76,300 results
Open links in new tab
  1. Plot a bar using matplotlib using a dictionary - Stack Overflow

    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.

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

    from matplotlib import pyplot as plt def bar_plot(ax, data, colors=None, total_width=0.8, single_width=1, legend=True): """Draws a bar plot with multiple bars per data point. …

  3. python - how to show values on top of bar plot - Stack Overflow

    Oct 30, 2018 · plt.text() will allow you to add text to your chart. It only enables you to add text to one set of coordinates at a time, so you'll need to loop through the data to add text for each bar.

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

    import numpy as np import pandas as pd import matplotlib.pyplot as plt # Bring some raw data. frequencies = [6, -16, 75, 160, 244, 260, 145, 73, 16, 4, 1] # In my original code I create a …

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

    import matplotlib.pyplot as plt N = 5 menMeans = (20, 35, 30, 35, 27) ind = np.arange(N) #Creating a figure with some fig size fig, ax = plt.subplots(figsize = (10,5)) …

  6. 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

  7. How to sort bars in a bar plot in ascending order

    Jul 3, 2017 · I created a bar plot using matplotlib.pyplot and seaborn libraries. How can I sort bars in increasing order according to Speed? I want to see the bars with the lowest speed on the …

  8. Trying to plot a line plot on a bar plot using Matplotlib

    Sep 9, 2015 · I'm trying to plot a line plot over a bar plot using MatPlotLib. So far I have both the plots showing but I can't get a secondary y-axis with a different scale to work. When I try and …

  9. matplotlib bar plot add legend from categories dataframe column

    Aug 3, 2019 · I try to add the legend which should, according to my example, output: a red square with the word fruit and a green square with the word veggie. I tried several things (the example …

  10. How to change the color of a single bar in a bar plot

    Sep 24, 2013 · What that means is that when you specify the kind argument for Series.plot() as bar, Series.plot() will actually call matplotlib.pyplot.bar(), and matplotlib.pyplot.bar() will be sent …