Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
multimedia-retrieval
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
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
Show more breadcrumbs
Bakhtali,T.I. (Tariq)
multimedia-retrieval
Commits
8cf612db
Unverified
Commit
8cf612db
authored
2 years ago
by
Tariq Uake
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Delete test.py
parent
1a220db8
No related branches found
Branches containing commit
Tags
mmr
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/test.py
+0
-46
0 additions, 46 deletions
python/test.py
with
0 additions
and
46 deletions
python/test.py
deleted
100644 → 0
+
0
−
46
View file @
1a220db8
import
matplotlib.pyplot
as
plt
import
numpy
as
np
;
np
.
random
.
seed
(
1
)
x
=
np
.
random
.
rand
(
15
)
y
=
np
.
random
.
rand
(
15
)
names
=
np
.
array
(
list
(
"
ABCDEFGHIJKLMNO
"
))
c
=
np
.
random
.
randint
(
1
,
5
,
size
=
15
)
norm
=
plt
.
Normalize
(
1
,
4
)
cmap
=
plt
.
cm
.
RdYlGn
fig
,
ax
=
plt
.
subplots
()
sc
=
plt
.
scatter
(
x
,
y
,
c
=
c
,
s
=
100
,
cmap
=
cmap
,
norm
=
norm
)
annot
=
ax
.
annotate
(
""
,
xy
=
(
0
,
0
),
xytext
=
(
20
,
20
),
textcoords
=
"
offset points
"
,
bbox
=
dict
(
boxstyle
=
"
round
"
,
fc
=
"
w
"
),
arrowprops
=
dict
(
arrowstyle
=
"
->
"
))
annot
.
set_visible
(
False
)
def
update_annot
(
ind
):
pos
=
sc
.
get_offsets
()[
ind
[
"
ind
"
][
0
]]
annot
.
xy
=
pos
text
=
"
{}, {}
"
.
format
(
"
"
.
join
(
list
(
map
(
str
,
ind
[
"
ind
"
]))),
"
"
.
join
(
names
[
ind
[
"
ind
"
]]))
annot
.
set_text
(
text
)
annot
.
get_bbox_patch
().
set_facecolor
(
cmap
(
norm
(
c
[
ind
[
"
ind
"
][
0
]])))
annot
.
get_bbox_patch
().
set_alpha
(
0.4
)
def
hover
(
event
):
vis
=
annot
.
get_visible
()
if
event
.
inaxes
==
ax
:
cont
,
ind
=
sc
.
contains
(
event
)
if
cont
:
update_annot
(
ind
)
annot
.
set_visible
(
True
)
fig
.
canvas
.
draw_idle
()
else
:
if
vis
:
annot
.
set_visible
(
False
)
fig
.
canvas
.
draw_idle
()
fig
.
canvas
.
mpl_connect
(
"
motion_notify_event
"
,
hover
)
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