Skip to content

Commit

Permalink
docs(example): update scripts to comment out plt.show() (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
jooyoungseo authored Oct 9, 2024
1 parent 09b8f31 commit 164d6fa
Show file tree
Hide file tree
Showing 31 changed files with 33 additions and 8,400 deletions.
5 changes: 3 additions & 2 deletions example/bar/matplotlib/example_mpl_bar_plot.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import matplotlib.pyplot as plt
import maidr
import seaborn as sns

import maidr

# Load dataset
tips = sns.load_dataset("tips")

Expand All @@ -13,5 +14,5 @@
plt.xlabel("Day")
plt.ylabel("Count")

plt.show()
# plt.show()
maidr.show(b_plot)
4 changes: 2 additions & 2 deletions example/bar/seaborn/example_sns_bar_plot.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import matplotlib.pyplot as plt
import maidr
import seaborn as sns

import maidr

# Load the penguins dataset
penguins = sns.load_dataset("penguins")
Expand All @@ -15,5 +15,5 @@
plt.xlabel("Species")
plt.ylabel("Body Mass (g)")

plt.show()
# plt.show()
maidr.show(b_plot)
7 changes: 4 additions & 3 deletions example/box/matplotlib/example_mpl_box.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import matplotlib.pyplot as plt
import maidr
import numpy as np

import maidr

# Generating random data for three different groups
data_group1 = np.random.normal(100, 10, 200)
data_group2 = np.random.normal(90, 20, 200)
Expand Down Expand Up @@ -36,10 +37,10 @@ def boxplot(is_vert: bool):

# Create the vertical boxplot
vert = boxplot(is_vert=True)
plt.show()
# plt.show()
maidr.show(vert)

# Create the vertical boxplot
horz = boxplot(is_vert=False)
plt.show()
# plt.show()
maidr.show(horz)
6 changes: 3 additions & 3 deletions example/box/seaborn/example_sns_box.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import matplotlib.pyplot as plt
import maidr
import seaborn as sns

import maidr

# Load the Iris dataset
iris = sns.load_dataset("iris")
Expand Down Expand Up @@ -33,10 +33,10 @@ def boxplot(orientation: str, fig_num: int):

# Create the vertical boxplot
vert = boxplot(orientation="v", fig_num=1)
plt.show()
# plt.show()
maidr.show(vert)

# Create the vertical boxplot
horz = boxplot(orientation="h", fig_num=2)
plt.show()
# plt.show()
maidr.show(horz)
4 changes: 2 additions & 2 deletions example/count/seaborn/example_sns_count_plot.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import matplotlib.pyplot as plt
import maidr
import seaborn as sns

import maidr

# Load the Titanic dataset
titanic = sns.load_dataset("titanic")
Expand All @@ -12,5 +12,5 @@
# Set the title and show the plot
plt.title("Passenger Class Distribution on the Titanic")

plt.show()
# plt.show()
maidr.show(count_plot)
4 changes: 2 additions & 2 deletions example/heatmap/matplotlib/example_mpl_heatmap.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import maidr
import matplotlib.pyplot as plt
import numpy as np

import maidr

vegetables = [
"cucumber",
Expand Down Expand Up @@ -53,5 +53,5 @@
ax.set_title("Harvest of local farmers (in tons/year)")
fig.tight_layout()

plt.show()
# plt.show()
maidr.show(im)
4 changes: 2 additions & 2 deletions example/heatmap/seaborn/example_sns_heatmap.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import matplotlib.pyplot as plt
import maidr
import seaborn as sns

import maidr

# Load an example dataset from seaborn
glue = sns.load_dataset("glue").pivot(index="Model", columns="Task", values="Score")
Expand All @@ -12,5 +12,5 @@
plt.title("Heatmap of Model Scores by Task")

# Show the plot
plt.show()
# plt.show()
maidr.show(heatmap)
4 changes: 2 additions & 2 deletions example/histogram/matplotlib/example_mpl_hist.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import maidr
import matplotlib.pyplot as plt
import seaborn as sns

import maidr

# Load the dataset
iris = sns.load_dataset("iris")
Expand All @@ -15,5 +15,5 @@
plt.xlabel("Petal Length (cm)")
plt.ylabel("Frequency")

plt.show()
# plt.show()
maidr.show(hist_plot)
4 changes: 2 additions & 2 deletions example/histogram/seaborn/example_sns_hist.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import matplotlib.pyplot as plt
import maidr
import seaborn as sns

import maidr

# Load the Iris dataset
iris = sns.load_dataset("iris")
Expand All @@ -17,5 +17,5 @@
plt.xlabel("Petal Length (cm)")
plt.ylabel("Frequency")

plt.show()
# plt.show()
maidr.show(hist_plot)
4 changes: 2 additions & 2 deletions example/line/matplotlib/example_mpl_line.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import maidr
import matplotlib.pyplot as plt
import seaborn as sns

import maidr

# Load the flights dataset from seaborn
flights = sns.load_dataset("flights")
Expand All @@ -25,5 +25,5 @@
plt.ylabel("Total Passengers (Thousands)", fontsize=12)

# Show the plot
plt.show()
# plt.show()
maidr.show(line_plot)
4 changes: 2 additions & 2 deletions example/line/seaborn/example_sns_line.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import matplotlib.pyplot as plt
import maidr
import seaborn as sns

import maidr

# Load the 'tips' dataset from seaborn
tips = sns.load_dataset("tips")
Expand All @@ -23,5 +23,5 @@
plt.xlabel("Total Bill")
plt.ylabel("Tip")

plt.show()
# plt.show()
maidr.show(line_plot)
Loading

0 comments on commit 164d6fa

Please sign in to comment.