Skip to content

Commit

Permalink
feat: generate single box plot using seaborn and matplotlib
Browse files Browse the repository at this point in the history
  • Loading branch information
Rebekah-Chuang committed Apr 19, 2024
1 parent c90c3a0 commit 91c7ee4
Showing 1 changed file with 18 additions and 34 deletions.
52 changes: 18 additions & 34 deletions VizAble/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,29 +608,14 @@ def get_output_plot():
x_axis_title=input.line_x_axis_title()
y_axis_title=input.line_y_axis_title()
markers = input.markers()
# color_by = input.color_by()

# line_plot = px.line(
# data_frame = data_frame,
# x = input.line_x_axis(),
# y = input.line_y_axis(),
# markers = markers,
# # color = color_by,
# ).update_layout(
# template="seaborn",
# title={"text": plot_title, "x": 0.5},
# ).update_xaxes(
# title_text = x_axis_title,
# ).update_yaxes(
# title_text = y_axis_title,
# )

sns.set_theme()
plt.figure(figsize=(10, 6))
line_plot = sns.lineplot(
data = data_frame,
x = input.line_x_axis(),
y = input.line_y_axis(),
markers = input.markers(),
markers = markers,
)
plt.title(plot_title)
plt.xlabel(x_axis_title)
Expand Down Expand Up @@ -667,23 +652,22 @@ def get_output_plot():
# )
# return_plot = bar_plot

# # Box Plot:
# if input.plot_types() == "Box Plot":
# req(input.box_y_axis())
# # y_axis = input.box_y_axis()
# plot_title = input.box_plot_title()
# y_axis_title = input.box_y_axis_title()

# box_plot = px.box(
# data_frame = data_frame,
# y = input.box_y_axis(),
# ).update_layout(
# template="seaborn",
# title={"text": plot_title, "x": 0.5},
# ).update_yaxes(
# title_text = y_axis_title,
# )
# return_plot = box_plot
# Box Plot:
if input.plot_types() == "Box Plot":
req(input.box_y_axis())
y_axis = input.box_y_axis()
plot_title = input.box_plot_title()
y_axis_title = input.box_y_axis_title()

sns.set_theme()
plt.figure(figsize=(10, 6))
box_plot = sns.boxplot(
y = data_frame[y_axis],
)
plt.title(plot_title)
plt.ylabel(y_axis_title)
# plt.show()
return_plot = box_plot

# # Grouped_Box Plot:
# if input.plot_types() == "Grouped_Box Plot":
Expand Down

0 comments on commit 91c7ee4

Please sign in to comment.