Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
formula student elo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GET racing FOSS
formula student elo
Commits
e87ccee2
"...locale/git@gitlab.fachschaften.org:kif/akplanning.git" did not exist on "664c37e6a25ad6d225eed380da7f646e1ce4bcaf"
Commit
e87ccee2
authored
1 month ago
by
Marius Heidenreich
Browse files
Options
Downloads
Patches
Plain Diff
Delete test2.py
parent
38c41fc3
No related branches found
No related tags found
No related merge requests found
Pipeline
#277542
passed
1 month ago
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test2.py
+0
-51
0 additions, 51 deletions
test2.py
with
0 additions
and
51 deletions
test2.py
deleted
100644 → 0
+
0
−
51
View file @
38c41fc3
import
matplotlib.pyplot
as
plt
import
numpy
as
np
from
matplotlib.colors
import
LinearSegmentedColormap
import
matplotlib.patches
as
patches
# Create custom colormap
colors
=
[(
255
/
255
,
255
/
255
,
30
/
255
),
(
255
/
255
,
196
/
255
,
0
/
255
)]
# RGB values for #ffff1e and #ffc400
custom_yellow_cmap
=
LinearSegmentedColormap
.
from_list
(
'
custom_yellow
'
,
colors
)
np
.
random
.
seed
(
19680801
)
# Create figure directly without subplot
fig
=
plt
.
figure
(
figsize
=
(
8
,
6
))
ax
=
fig
.
add_axes
([
0.1
,
0.1
,
0.8
,
0.8
])
# [left, bottom, width, height]
N
=
10
y
=
np
.
arange
(
N
)
x
=
np
.
random
.
rand
(
N
)
# Create horizontal bars
bars
=
ax
.
barh
(
y
,
x
,
height
=
0.7
)
# Apply gradient to each bar
for
bar
in
bars
:
# Get the coordinates of the bar
x0
,
y0
=
bar
.
get_xy
()
width
=
bar
.
get_width
()
height
=
bar
.
get_height
()
# Set the bar's face color to none (remove default color)
bar
.
set_facecolor
(
'
none
'
)
# Create multiple thin rectangles to simulate a gradient
steps
=
50
for
i
in
range
(
steps
):
left
=
x0
+
(
i
/
steps
)
*
width
rect_width
=
width
/
steps
color
=
custom_yellow_cmap
(
i
/
steps
)
rect
=
patches
.
Rectangle
((
left
,
y0
),
rect_width
,
height
,
linewidth
=
0
,
color
=
color
)
ax
.
add_patch
(
rect
)
# Set limits and labels
ax
.
set_xlim
(
0
,
1
)
ax
.
set_ylim
(
-
0.5
,
N
-
0.5
)
ax
.
set_title
(
'
Horizontal Bar Chart with Yellow Gradient
'
)
ax
.
set_xlabel
(
'
Values
'
)
ax
.
set_ylabel
(
'
Categories
'
)
plt
.
show
()
\ No newline at end of file
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