Skip to content
Snippets Groups Projects
Commit 4f7ff36b authored by Alexander Shervud's avatar Alexander Shervud
Browse files

Plotter customization

parent 0314f101
No related branches found
No related tags found
No related merge requests found
Source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -16,20 +16,20 @@ plotter_title_fontsize: 18
plotter_title_fontweight: 600
# Plotter fig configuration
plotter_fig_height: 6
# Plotter fig configuration
plotter_fig_width: 16
#----------------------------------------
# TO DO
# IDEAS
# Plotter fig configuration
plotter_fig_height: 8
# Plotter fig configuration
plotter_fig_width: 18
# Plotter font configuration
plotter_font: Sand
#---------------------------------------------
# NOT WORKING YET
# Plotter font configuration
plotter_font: Sand
\ No newline at end of file
......@@ -42,6 +42,8 @@ class Plotter:
fontsize=parameters["plotter_title_fontsize"],
fontweight=parameters["plotter_title_fontweight"],
)
fig.set_figheight(parameters["plotter_fig_height"])
fig.set_figwidth(parameters["plotter_fig_width"])
def distribution_plot(self, target, styling_params={}) -> None:
"""plot a distribution plot.
......@@ -129,6 +131,7 @@ class Plotter:
# Calculate percentages by row
ct_percent = ct.apply(lambda r: r / r.sum() * 100, axis=0)
fig, ax = plt.subplots()
ax.set_ylabel("Percent")
self.customize_plot(fig, ax, styling_params)
ct_percent.plot(kind="bar", ax=ax)
......@@ -148,6 +151,7 @@ class Plotter:
"""
fig, ax = plt.subplots()
ax.set_ylabel("Percent")
self.customize_plot(fig, ax, styling_params)
sns.boxplot(x=category, y=target, data=self.df, palette="rainbow")
......@@ -192,6 +196,8 @@ class Plotter:
uniques = self.ds.get_unique_column_values(category)
fig, ax = plt.subplots()
ax.set_xlabel(target)
ax.set_ylabel("Percent")
self.customize_plot(fig, ax, styling_params)
label_list = []
for val in uniques:
......@@ -243,5 +249,7 @@ class Plotter:
# plotting the plot
fig, ax = plt.subplots()
ax.set_xlabel(target1)
ax.set_ylabel(target2)
self.customize_plot(fig, ax, styling_params)
ax.scatter(self.df[target1], self.df[target2])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment