Skip to content

Commit

Permalink
added cex argument to tip labels in plot with RCall
Browse files Browse the repository at this point in the history
  • Loading branch information
crsl4 committed May 10, 2019
1 parent 3a2764d commit 180b22e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/plotRCall.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function plot(net::HybridNetwork, method::Symbol; useEdgeLength=false::Bool,
showEdgeNumber=false::Bool, showIntNodeLabel=false::Bool,
edgeLabel=DataFrame()::DataFrame, nodeLabel=DataFrame()::DataFrame,
xlim=Float64[]::Array{Float64,1}, ylim=Float64[]::Array{Float64,1},
tipOffset=0.0::Float64)
tipOffset=0.0::Float64, tipcex=1.0::Float64)

(edge_xB, edge_xE, edge_yB, edge_yE, node_x, node_y, node_yB, node_yE,
xmin, xmax, ymin, ymax) = getEdgeNodeCoordinates(net, useEdgeLength)
Expand All @@ -73,17 +73,19 @@ function plot(net::HybridNetwork, method::Symbol; useEdgeLength=false::Bool,
eCol[ [ e.hybrid for e in net.edge] ] .= majorHybridEdgeColor
eCol[ [!e.isMajor for e in net.edge] ] .= minorHybridEdgeColor


R"""
plot($(node_x[leaves]), $(node_y[leaves]), type='n',
xlim=c($xmin,$xmax), ylim=c($ymin,$ymax),
axes=FALSE, xlab='', ylab='')
segments($edge_xB, $edge_yB, $edge_xE, $edge_yE, col=$eCol)
segments($node_x, $node_yB, $node_x, $node_yE, col=$edgeColor)
"""
@rput tipcex

This comment has been minimized.

Copy link
@cecileane

cecileane May 12, 2019

Member

an easier way (which does not need @rput tipcex) would be

text(..., cex=$tipcex)

instead of

@rput tipcex
text(..., cex=tipcex)

Also, it would be great to add tipcex to the documentation (docstring)!

if showTipLabel
R"""
text($(node_x[leaves])+$tipOffset, $(node_y[leaves]),
$(tipLabels(net)), adj=0, font=3)
$(tipLabels(net)), adj=0, font=3, cex=tipcex)
"""
end
if showIntNodeLabel
Expand Down

0 comments on commit 180b22e

Please sign in to comment.