Bar-29283

Sat 17 May 2025

import pandas as pd;
import numpy as np;
from datetime import date
import matplotlib.pyplot as plt; plt.rcdefaults()



sizes = np.full((10), 7, dtype=int);    
print(sizes);

from functools import reduce
product = reduce((lambda x, y: x * y), [1, 2, 3, 4])
[7 7 7 7 7 7 7 7 7 7]


Score: 0

Category: barchart


Bubble-1

Sat 17 May 2025

import matplotlib.pyplot as plt
import collections
import numpy as np

# Generate random data
data = [tuple(pair)
        for pair in np.random.uniform(5, size=(20, 2))
        for c in range(np.random.randint(1, 50))]  # Replaced random_integers

# Count occurrences of each point
count = collections.Counter(data)

# Print the count …

Category: barchart

Read More

Bubble-2

Sat 17 May 2025
import matplotlib.pyplot as plt
import collections
import numpy as np

# Generate random data
data = [tuple(pair)
        for pair in np.random.uniform(5, size=(20, 2))
        for _ in range(np.random.randint(1, 50))]  # Replaced random_integers

# Count occurrences of each point
count = collections.Counter(data)

# Print the count …

Category: barchart

Read More

Horizontal-Bar

Sat 17 May 2025
# http://matplotlib.org/1.2.1/examples/pylab_examples/barh_demo.html
import numpy as np
import pylab as pl
import matplotlib.pyplot as plt


val = [4, 6, 21]
pos = np.arange(len(val)) + .5    # the bar centers on the y axis

pl.figure(1)
plt.barh(pos, val, align='center')
plt …

Category: barchart

Read More

Male-Vs-Female

Sat 17 May 2025
import matplotlib.pyplot as plt; plt.rcdefaults()
import numpy as np
import matplotlib.pyplot as plt

objects = ('Male', 'Female')
y_pos = np.arange(2)
values = [10,8]

plt.bar(y_pos, values, width=0.12, align='center', alpha=0.2)
plt.xticks(y_pos, objects)
plt.ylabel('Usage')
plt.title('Male vs Female …

Category: barchart

Read More

Months-And-Counts

Sat 17 May 2025

import numpy as np
import matplotlib.pyplot as plt

N = 12
medalists_mob = (2, 7, 8, 12, 3, 8, 78, 1, 8, 44, 55, 12)

ind = np.arange(N)  # the x locations for the groups
width = 0.15       # the width of the bars

fig, ax = plt.subplots()
rects1 = ax.bar(ind …

Category: barchart

Read More

Named-Colors

Sat 17 May 2025
import six

import numpy as np
import matplotlib.pyplot as plt
from matplotlib import colors


colors_ = list(six.iteritems(colors.cnames))

# Add the single letter colors.
for name, rgb in six.iteritems(colors.ColorConverter.colors):
    hex_ = colors.rgb2hex(rgb)
    colors_.append((name, hex_))

# Transform to hex color values.
hex_ = [color …

Category: barchart

Read More

Simple-Bar

Sat 17 May 2025

import matplotlib.pyplot as plt; plt.rcdefaults()
import numpy as np
import matplotlib.pyplot as plt

objects = ('Python', 'C++', 'Java', 'Perl', 'Scala', 'Lisp')
y_pos = np.arange(len(objects))
performance = [10,8,6,4,2,1]

plt.bar(y_pos, performance, align='center', alpha=0.5)
plt.xticks(y_pos, objects)
plt.ylabel …

Category: barchart

Read More

Simple-Bar-Chart

Sat 17 May 2025
import pylab as pl
import datetime

data = """0 14-11-2003
1 15-03-1999
12 04-12-2012
33 09-05-2007
44 16-08-1998
55 25-07-2001
76 31-12-2011
87 25-06-1993
118 16-02-1995
119 10-02-1981
145 03-05-2014"""

values = []
dates = []

for line in data.split("\n"):
    x, y = line.split()
    values.append(int(x))
    dates.append(datetime.datetime.strptime …

Category: barchart

Read More

Simple-Bar-Chart-2

Sat 17 May 2025
import matplotlib.pyplot as plt; plt.rcdefaults()
import numpy as np
import matplotlib.pyplot as plt

objects = ('Python', 'C++', 'Java', 'Perl', 'Scala', 'Lisp')
y_pos = np.arange(len(objects))
performance = [10,8,6,4,2,1]

plt.bar(y_pos, performance, align='center', alpha=0.5)
plt.xticks(y_pos, objects)
plt.ylabel …

Category: barchart

Read More
Page 1 of 2

Next »