3

I'm trying to plot igraph objects for which I have set the xy coordinates.

It's been working fine, but when the plot is produced it is stretched in either the x or y so the network looks distorted.

Does anyone know a way that I can define the plotting area (i.e. tell igraph that I want it to plot on a square of set dimensions)? Or any other way of avoiding this problem?

zx8754
  • 52,746
  • 12
  • 114
  • 209
unknown
  • 853
  • 1
  • 10
  • 23
  • 1
    Have you tried setting the aspect ratio? From `?igraph.plotting`: "asp: A numeric constant, it gives the asp parameter for plot, the aspect ratio. Supply 0 here if you don't want to give an aspect ratio. It is ignored by tkplot and rglplot." – lukeA Nov 16 '16 at 15:06
  • @lukeA Thanks for your reply. I've just tried supplying it with 0 and it produces the same graph. 1:1 is the same and 0.5:1 is more or less right, but still a bit out. Do you have any idea why that might be? – unknown Nov 16 '16 at 15:17
  • 1
    It's easier to help you if you provide some sort of [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) that demonstrates the problem you are having clearly. We have no idea what you are looking at. – MrFlick Nov 16 '16 at 15:47
  • 2
    You might also need `rescale=FALSE`, but then you need to set the plotting window properly. – Gabor Csardi Nov 16 '16 at 20:46
  • agreeing with Gabor, for me `rescale=FALSE` always resolved these positioning problems. e.g. see here for exact node coordinates: https://stackoverflow.com/questions/30647537/using-geo-coordinates-as-vertex-coordinates-in-the-igraph-r-package/30671830#30671830 – deeenes Nov 17 '16 at 07:31
  • Thanks to all! I managed to fix this by using rescale=FALSE and reading the question shared by deeenes. – unknown Dec 05 '16 at 14:24
  • 1
    @DomBurns please post your comment as answer, and accept it. – zx8754 Oct 12 '18 at 07:13
  • @GaborCsardi `rescale=FALSE` looks like worked for OP, please post as answer. – zx8754 Oct 12 '18 at 07:14

0 Answers0