Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RSE 23 Group Assignment Shervud Pitawanik Franz
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Niklas Franz
RSE 23 Group Assignment Shervud Pitawanik Franz
Commits
4f7ff36b
Commit
4f7ff36b
authored
1 year ago
by
Alexander Shervud
Browse files
Options
Downloads
Patches
Plain Diff
Plotter customization
parent
0314f101
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Narrative.ipynb
+86
-151
86 additions, 151 deletions
Narrative.ipynb
config.yaml
+8
-8
8 additions, 8 deletions
config.yaml
src/Plotter.py
+8
-0
8 additions, 0 deletions
src/Plotter.py
with
102 additions
and
159 deletions
Narrative.ipynb
+
86
−
151
View file @
4f7ff36b
Source diff could not be displayed: it is too large. Options to address this:
view the blob
.
This diff is collapsed.
Click to expand it.
config.yaml
+
8
−
8
View file @
4f7ff36b
...
...
@@ -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
This diff is collapsed.
Click to expand it.
src/Plotter.py
+
8
−
0
View file @
4f7ff36b
...
...
@@ -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
])
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment