Skip to content

Commit c48d7e9

Browse files
committed
v0.3
1 parent 0c189f2 commit c48d7e9

File tree

2 files changed

+14
-19
lines changed

2 files changed

+14
-19
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ plotDSM(A,label)
7373
```
7474
then
7575

76-
![](https://user-images.githubusercontent.com/35882132/150766189-c486a062-8723-4654-8a30-1aaa2455fdad.svg)
76+
![](https://user-images.githubusercontent.com/35882132/150873248-843737c8-6619-4816-b54d-bec151d5ee69.svg)
7777

7878

7979
## Clustering DSM
@@ -97,7 +97,7 @@ plotDSM(original_DSM,original_label)
9797
```
9898
original_DSM
9999

100-
![ClusteroriginalDSM](https://user-images.githubusercontent.com/35882132/150766202-73f94b96-cef5-46df-a8f9-20ecf4175b44.svg)
100+
![ClusteroriginalDSM](https://user-images.githubusercontent.com/35882132/150873257-5ccd5a7d-76ad-41e5-a98a-505f22266146.svg)
101101

102102

103103

@@ -111,7 +111,7 @@ plotDSM(clustered_DSM,clustered_label)
111111
```
112112
then, you get clustered DSM
113113

114-
![Clustered_DSM](https://user-images.githubusercontent.com/35882132/150766197-5260e5c0-3063-4709-97a9-3a4b3415671a.svg)
114+
![Clustered_DSM](https://user-images.githubusercontent.com/35882132/150873258-69098483-9722-4b7c-ac24-cfc6e3675728.svg)
115115

116116
## Sequencing DSM
117117

@@ -142,7 +142,7 @@ plotDSM(original_DSM,original_label)
142142
```
143143
original DSM
144144

145-
![SequencingoriginalDSM](https://user-images.githubusercontent.com/35882132/150766204-9d85760c-98b4-4b59-ae11-f75ec4d199d8.svg)
145+
![SequencingoriginalDSM](https://user-images.githubusercontent.com/35882132/150873259-5f4942f8-73bd-45ee-9fa2-34d6a006a4c6.svg)
146146

147147
To get Sequenced DSM, please type
148148

@@ -154,7 +154,7 @@ plotDSM(sequenced_DSM, sequenced_label)
154154

155155
then, you get sequenced DSM
156156

157-
![SequencedDSM](https://user-images.githubusercontent.com/35882132/150766200-cb57710a-509d-48e5-acf3-450445198ca2.svg)
157+
![SequencedDSM](https://user-images.githubusercontent.com/35882132/150873260-80546e4f-040d-4485-9c43-a79c821b89ea.svg)
158158

159159

160160

src/plotDSM.jl

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,41 +34,36 @@ function plotDSM(DSM,label)
3434

3535
CellSizeRow = min(50,450/(DSMr+5));
3636
CellSizeColumn = min(50,450/(DSMc+5));
37-
t = Table(DSMr+1,DSMc+2, CellSizeRow, CellSizeColumn);
37+
t = Table(DSMr+1,DSMc+1, CellSizeRow, CellSizeColumn);
3838

3939
sethue("black")
4040

4141
for r in 2 : DSMr+1
42-
for c in 3 : DSMc+2
42+
for c in 2 : DSMc+1
4343
box(t[r,c], t.colwidths[t.currentcol], t.rowheights[t.currentrow], :stroke);
44-
if r == c-1
44+
if r == c
4545
sethue("grey")
4646
box(t[r,c], t.colwidths[t.currentcol], t.rowheights[t.currentrow], :fill);
4747
sethue("white")
48-
fontsize(CellSizeColumn/2)
49-
text(string(r-1), t[r,c] ,halign=:center, valign=:middle);
48+
textfit(label[r-1], BoundingBox(box(t[r,c],CellSizeRow, CellSizeColumn)))
5049
sethue("black")
5150
end
5251

53-
if DSM[r-1,c-2] != 0
52+
if DSM[r-1,c-1] != 0
5453
circle(t[r,c], CellSizeColumn/3, :fill)
5554
end
5655
end
5756
end
5857

59-
for r in 1 : DSMr
60-
text(string(r), t[1,r+2] ,halign=:center, valign=:middle)
61-
end
6258

63-
for c in 1 : DSMc
64-
text(string(c), t[c+1,2] ,halign=:center, valign=:middle)
59+
60+
for r in 1 : DSMr
61+
textfit(label[r], BoundingBox(box(t[r+1,1],CellSizeRow, CellSizeColumn)))
6562
end
6663

6764
for c in 1 : DSMc
68-
fontsize(min((CellSizeColumn/2)*(5/length(label[c])),CellSizeColumn/2))
69-
text(string(label[c]), t[c+1,1] ,halign=:right, valign=:middle)
65+
textfit(label[c], BoundingBox(box(t[1,c+1],CellSizeRow, CellSizeColumn)))
7066
end
7167

72-
7368
end
7469
end

0 commit comments

Comments
 (0)