SachaEpskamp / qgraph

Developmental version of qgraph
GNU General Public License v2.0
68 stars 21 forks source link

Get edgeConnectPoints after plotting #21

Closed westr029 closed 5 years ago

westr029 commented 5 years ago

Hi,

first of all I would like to say that I really like this package. Produces really nice plots.

However, I was wondering if it is possible to get the edgeConnectPoints when they are not specified as an argument.

The thing is that I would like to change only one edgeConnectPoint, because an arrow is overlapping. So what I would like to do is the following:

  1. get the edgeConnectPoints of the original plot
  2. Change one of the edgeConnectPoints
  3. Plot qgraph again while giving the argument for edgeConnectPoints with the new set.

When I give the edgeConnectPoints as an argument, I can find them via g$graphAttributes$Edges$edgeConnectPoints, but when I did not specify them at the beginning the output of the beforementioned code is NULL

Hope you can help me with this. Thanks

westr029 commented 5 years ago

OK, for myself I solved this problem. I can just provide a matrix of 2x2 filled with NAs. Then I just fill in the edge connection points for the arrow that I want to modify. If an NA is given qgraph will find its own connection point.

Still, I do think it would be helpful if the edgeConnectPoints will be accessible also when one did not provide these themself.

Therefore, I will not close this issue for now.

SachaEpskamp commented 5 years ago

Hi Westr029, yes the NA is the default in edgeConnectPoints. You can just provide a matrix with the same dimensions as the input with NAs is you want to later change it.