Skip to content

Commit

Permalink
Figs S4 and S10 made color blind safe
Browse files Browse the repository at this point in the history
  • Loading branch information
hsseung committed Aug 19, 2024
1 parent de91141 commit d4b4656
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
7 changes: 4 additions & 3 deletions PartsListPaper/Dendrogram.jl
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ default(; # Plots defaults
)

# %%
c12 = distinguishable_colors(12, [RGB(1,1,1), RGB(0,0,0)], dropseed=true)
# c12 = distinguishable_colors(12, [RGB(1,1,1), RGB(0,0,0)], dropseed=true)
c12 = collect(palette(:mk_12)) # https://mk.bcgsc.ca/colorblind/

# %%
cmap = OffsetArray(vcat([RGB(0, 0, 0)], c12, c12, c12), 0:36)
Expand All @@ -331,7 +332,7 @@ plot(tree, treetype = :fan, linecolor = cmap[colorings], linewidth=2)

# %%
println("saving dendrogram with finer flat clustering")
StatsPlots.savefig("Fig S10a TypePolarDendrogramFiner.svg")
StatsPlots.savefig("Fig S10a TypePolarDendrogramFiner.pdf")

# %% [markdown]
# ## dendrogram with finest clusters
Expand Down Expand Up @@ -394,4 +395,4 @@ plot(tree, treetype = :fan, linecolor = cmap[colorings], linewidth=2)

# %%
println("saving dendrogram with finest flat clustering")
StatsPlots.savefig("Fig S10b TypePolarDendrogramFinest.svg")
StatsPlots.savefig("Fig S10b TypePolarDendrogramFinest.pdf")
24 changes: 13 additions & 11 deletions PartsListPaper/Fig S4 Type-to-type connectivity as a matrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ dotsizes = min.(sqrt.(vals), 60)/15 # nonlinear scaling to make weaker connecti
# %%
default(
fontfamily = "Helvetica",
label = ""
)
label = "",
)

cmap = palette(:tol_bright) # a Tol color scheme that is color blind safe

# %%
ntypes = length(orderedtypes)
Expand All @@ -62,28 +64,28 @@ even = 2:2:ntypes
#p = scatter(J[visible], I[visible], markersize = dotsizes[visible],
p = scatter(J, I, markersize = dotsizes,
size = (1500, 1500), yflip = true, msc = :auto,
yticks = (1:2:length(orderedtypes), orderedtypes[1:2:end]), tickfontcolor = :red,
yticks = (1:2:length(orderedtypes), orderedtypes[1:2:end]), tickfontcolor = cmap[2],
xticks = (1:2:length(orderedtypes), orderedtypes[1:2:end]),
xrotation = 90,
xlim = (0, ntypes) .+ 0.5,
ylim = (0, ntypes) .+ 0.5,
grid = false,
ylabel = "presynaptic",
xlabel = "postsynaptic",
ylabel = "Presynaptic",
xlabel = "Postsynaptic",
left_margin = 5mm,
guidefontsize = 14
)
scatter!(twinx(), [], [], yflip=true, ylim = (0, ntypes) .+ 0.5,
yticks = (2:2:length(orderedtypes), orderedtypes[2:2:end]), tickfontcolor = :green,
yticks = (2:2:length(orderedtypes), orderedtypes[2:2:end]), tickfontcolor = cmap[3],
)
scatter!(twiny(), [], [], xlim = (0, ntypes) .+ 0.5,
xticks = (2:2:length(orderedtypes), orderedtypes[2:2:end]), tickfontcolor = :green,
xticks = (2:2:length(orderedtypes), orderedtypes[2:2:end]), tickfontcolor = cmap[3],
xrotation = 90
)
hline!(p, odd, linealpha = 0.3, linecolor=:red)
hline!(p, even, linealpha = 0.3, linecolor=:green)
vline!(p, odd, linealpha = 0.3, linecolor=:red)
vline!(p, even, linealpha = 0.3, linecolor=:green)
hline!(p, odd, linealpha = 0.3, linecolor=cmap[2])
hline!(p, even, linealpha = 0.3, linecolor=cmap[3])
vline!(p, odd, linealpha = 0.3, linecolor=cmap[2])
vline!(p, even, linealpha = 0.3, linecolor=cmap[3])

# %%
savefig("Fig S4.pdf")

0 comments on commit d4b4656

Please sign in to comment.