You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I think it might be nice if we slightly change plot.sfnetwork to include the possibility of defining different args to plot nodes and edges. Currently, we simply pass the same dots argument to both plotting routines
which implies that, for example, in the following situation the nodes are coloured in a "weird" way (since the vector 1:3 is recycled to c(1:3, 1) to match the number of nodes. That also explains why two nodes are coloured as black):
Describe the solution you'd like
Add the possibility to specify certain arguments just for the nodes or just for the edges (or maybe it's already possible but I'm not sure how...). I'm also not sure about the interface but I was thinking about something like
plot.sfnetwork=function(x, draw_lines=TRUE, node_args=list(), edge_args=list(), ...) {
# TODO
}
where c(node_args, dots) are the arguments passed to the plotting routine for the nodes and c(edge_args, dots) are the arguments passed to the plotting routine for the edges.
Describe alternatives you've considered
Just build the plot manually layer by layer.
The text was updated successfully, but these errors were encountered:
Another idea in this regard would be to copy the approach adopted by plot.igraph:
The first method is to supply named arguments to the plotting commands: plot.igraph, tkplot or rglplot. Parameters for vertices start with prefix ‘vertex.’, parameters for edges have prefix ‘edge.’, and global parameters have no prefix. Eg. the color of the vertices can be given via argument vertex.color, whereas edge.color sets the color of the edges. layout gives the layout of the graphs.
Is your feature request related to a problem? Please describe.
I think it might be nice if we slightly change
plot.sfnetwork
to include the possibility of defining different args to plot nodes and edges. Currently, we simply pass the samedots
argument to both plotting routinessfnetworks/R/plot.R
Lines 48 to 61 in 23a4125
which implies that, for example, in the following situation the nodes are coloured in a "weird" way (since the vector 1:3 is recycled to c(1:3, 1) to match the number of nodes. That also explains why two nodes are coloured as black):
Created on 2023-07-28 with reprex v2.0.2
Describe the solution you'd like
Add the possibility to specify certain arguments just for the nodes or just for the edges (or maybe it's already possible but I'm not sure how...). I'm also not sure about the interface but I was thinking about something like
where
c(node_args, dots)
are the arguments passed to the plotting routine for the nodes andc(edge_args, dots)
are the arguments passed to the plotting routine for the edges.Describe alternatives you've considered
Just build the plot manually layer by layer.
The text was updated successfully, but these errors were encountered: