-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
53818c9
commit 415d6f1
Showing
64 changed files
with
1,359 additions
and
10,430 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,17 @@ | ||
import os | ||
|
||
import matplotlib.pyplot as plt | ||
import maidr | ||
import seaborn as sns | ||
|
||
# Load dataset | ||
tips = sns.load_dataset("tips") | ||
|
||
def get_filepath(filename: str) -> str: | ||
current_file_path = os.path.abspath(__file__) | ||
directory = os.path.dirname(current_file_path) | ||
return os.path.join(directory, filename) | ||
|
||
|
||
def plot(): | ||
# Load dataset | ||
tips = sns.load_dataset("tips") | ||
|
||
# Create a bar plot | ||
cut_counts = tips["day"].value_counts() | ||
plt.figure(figsize=(10, 6)) | ||
b_plot = plt.bar(cut_counts.index, list(cut_counts.values), color="skyblue") | ||
plt.title("The Number of Tips by Day") | ||
plt.xlabel("Day") | ||
plt.ylabel("Count") | ||
|
||
return b_plot | ||
|
||
|
||
def main(): | ||
bar_plot = plot() | ||
bar_maidr = maidr.bar(bar_plot) | ||
bar_maidr.save_html(get_filepath("example_mpl_bar_plot.html")) | ||
bar_maidr.show() | ||
|
||
# Create a bar plot | ||
cut_counts = tips["day"].value_counts() | ||
plt.figure(figsize=(10, 6)) | ||
b_plot = plt.bar(cut_counts.index, list(cut_counts.values), color="skyblue") | ||
plt.title("The Number of Tips by Day") | ||
plt.xlabel("Day") | ||
plt.ylabel("Count") | ||
|
||
if __name__ == "__main__": | ||
main() | ||
plt.show() | ||
maidr.show(b_plot) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,24 @@ | ||
import os | ||
|
||
import matplotlib.pyplot as plt | ||
import maidr | ||
import seaborn as sns | ||
|
||
|
||
def get_filepath(filename: str) -> str: | ||
current_file_path = os.path.abspath(__file__) | ||
directory = os.path.dirname(current_file_path) | ||
return os.path.join(directory, filename) | ||
|
||
|
||
def plot(): | ||
# Load the penguins dataset | ||
penguins = sns.load_dataset("penguins") | ||
|
||
# Create a bar plot showing the average body mass of penguins by species | ||
plt.figure(figsize=(10, 6)) | ||
b_plot = sns.barplot( | ||
x="species", y="body_mass_g", data=penguins, errorbar="sd", palette="Blues_d" | ||
) | ||
plt.title("Average Body Mass of Penguins by Species") | ||
plt.xlabel("Species") | ||
plt.ylabel("Body Mass (g)") | ||
|
||
return b_plot | ||
|
||
|
||
def main(): | ||
bar_plot = plot() | ||
bar_maidr = maidr.bar(bar_plot) | ||
bar_maidr.save_html(get_filepath("example_sns_bar_plot.html")) | ||
bar_maidr.show() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() | ||
# Load the penguins dataset | ||
penguins = sns.load_dataset("penguins") | ||
|
||
# Create a bar plot showing the average body mass of penguins by species | ||
plt.figure(figsize=(10, 6)) | ||
b_plot = sns.barplot( | ||
x="species", | ||
y="body_mass_g", | ||
data=penguins, | ||
errorbar="sd", | ||
palette="Blues_d", | ||
library="seaborn z", | ||
) | ||
plt.title("Average Body Mass of Penguins by Species") | ||
plt.xlabel("Species") | ||
plt.ylabel("Body Mass (g)") | ||
|
||
plt.show() | ||
maidr.show(b_plot) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,33 @@ | ||
import os | ||
|
||
import matplotlib.pyplot as plt | ||
import maidr | ||
import numpy as np | ||
|
||
|
||
def get_filepath(filename: str) -> str: | ||
current_file_path = os.path.abspath(__file__) | ||
directory = os.path.dirname(current_file_path) | ||
return os.path.join(directory, filename) | ||
|
||
|
||
def plot(): | ||
# Generating random data for three different groups | ||
data_group1 = np.random.normal(100, 10, 200) | ||
data_group2 = np.random.normal(90, 20, 200) | ||
data_group3 = np.random.normal(80, 30, 200) | ||
|
||
# Combine these different datasets into a list | ||
data_to_plot = [data_group1, data_group2, data_group3] | ||
|
||
# Create a figure instance | ||
fig, ax = plt.subplots() | ||
|
||
# Create the boxplot | ||
bp = ax.boxplot(data_to_plot, patch_artist=True) | ||
|
||
# Customize the boxplot colors | ||
colors = ["lightblue", "lightgreen", "tan"] | ||
for patch, color in zip(bp["boxes"], colors): | ||
patch.set_facecolor(color) | ||
|
||
# Adding labels and title | ||
ax.set_xticklabels(["Group 1", "Group 2", "Group 3"]) | ||
ax.set_title("Box Plot Example") | ||
ax.set_xlabel("Group") | ||
ax.set_ylabel("Values") | ||
# Generating random data for three different groups | ||
data_group1 = np.random.normal(100, 10, 200) | ||
data_group2 = np.random.normal(90, 20, 200) | ||
data_group3 = np.random.normal(80, 30, 200) | ||
|
||
# Show the plot | ||
plt.show() | ||
# Combine these different datasets into a list | ||
data_to_plot = [data_group1, data_group2, data_group3] | ||
|
||
return bp | ||
# Create a figure instance | ||
fig, ax = plt.subplots() | ||
|
||
# Create the boxplot | ||
bp = ax.boxplot(data_to_plot, patch_artist=True) | ||
|
||
def main(): | ||
box_plot = plot() | ||
box_maidr = maidr.box(box_plot) | ||
box_maidr.save_html(get_filepath("example_mpl_box.html")) | ||
box_maidr.show() | ||
# Customize the boxplot colors | ||
colors = ["lightblue", "lightgreen", "tan"] | ||
for patch, color in zip(bp["boxes"], colors): | ||
patch.set_facecolor(color) | ||
|
||
# Adding labels and title | ||
ax.set_xticklabels(["Group 1", "Group 2", "Group 3"]) | ||
ax.set_title("Box Plot Example") | ||
ax.set_xlabel("Group") | ||
ax.set_ylabel("Values") | ||
|
||
if __name__ == "__main__": | ||
main() | ||
# Show the plot | ||
plt.show() | ||
maidr.show(bp) |
Oops, something went wrong.