[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] plot.igraph and x-axis
From: |
Frederik Elwert |
Subject: |
Re: [igraph] plot.igraph and x-axis |
Date: |
Tue, 26 Nov 2013 16:54:16 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 |
Just as a side note: layout.norm might be interesting for you. It
allows to scale an existing layout with given contraints. You can then
use the normalized layout to plot it.
Frederik
Am Di 26 Nov 2013 16:40:50 CET schrieb Gábor Csárdi:
> On Tue, Nov 26, 2013 at 10:26 AM, Hermann Norpois <address@hidden> wrote:
>> I am sorry I did not get it.
>> If I use rescale=FALSE my plot is empty.
>
> You also need to set the xlim and ylim parameters, because that also
> defaults to (-1,1).
>
>> Actually I would like to change the rescale parameters. Is that possible,
>> i.e.
>> rescaleparameters = V(gs)$x
>
> No, that's not possible. Rescale the layout for yourself, and then set
> these limits in xlim and ylim.
>
> Btw. if you include code this way, that is somewhat a pain to try,
> because the > prompt makes it impossible to copy and paste. It is best
> to include some code that we can just copy and paste into R, without
> needing to edit it in emacs.
>
> G.
>
>> My try:
>> plot (gs, vertex.size=2, vertex.label=NA,rescale=FALSE, edge.width=
>> (E(gs)$weight)^6, layout=cbind (V(gs)$x, V(gs)$y))
>>
>>> dput (gs)
>> structure(list(2, FALSE, 1, 0, 0, 0, c(0, 0, 1), c(0, 1, 1),
>> list(c(1, 0, 1), structure(list(), .Names = character(0)),
>> structure(list(name = c("rs744016", "rs763273"), x = c(27042106L,
>> 27043594L), y = c(0.6445235948615, 0.6229189950958)), .Names =
>> c("name",
>> "x", "y")), structure(list(weight = 0.986597, y = 0.7704755,
>> color = "red"), .Names = c("weight", "y", "color"
>> )))), class = "igraph")
>>> class (gs)
>> [1] "igraph"
>>> plot (gs, vertex.size=2, vertex.label=NA,rescale=FALSE, edge.width=
>>> (E(gs)$weight)^6, layout=cbind (V(gs)$x, V(gs)$y))
>>> axis (1, at=1:10) # Does not change anything.
>>> plot (gs, vertex.size=2, vertex.label=NA, edge.width= (E(gs)$weight)^6,
>>> layout=cbind (V(gs)$x, V(gs)$y))
>>>
>>
>>
>> 2013/11/26 Gábor Csárdi <address@hidden>
>>>
>>> Hi,
>>>
>>> no, this is an igraph thing, igraph rescales layouts to (-1, 1),
>>> unless you specify the rescale=FALSE:
>>>
>>> http://igraph.sourceforge.net/doc/R/plot.common.html
>>>
>>> Gabor
>>>
>>> On Tue, Nov 26, 2013 at 9:53 AM, Hermann Norpois <address@hidden>
>>> wrote:
>>>> Hello,
>>>>
>>>> I want to have an x-axis with x-values refering to V(g)$x.
>>>>
>>>> How does this work?
>>>>
>>>> I tried
>>>> axis (1, at=V(g)$x) without an effect.
>>>>
>>>> dput (axis (1)) has the following output:
>>>> c(-1, -0.5, 0, 0.5, 1)
>>>>
>>>> How can I change this? I guess it is more a classical R-question ...
>>>>
>>>> thanks
>>>> Hermann
>>>>
>>>>
>>>> _______________________________________________
>>>> igraph-help mailing list
>>>> address@hidden
>>>> https://lists.nongnu.org/mailman/listinfo/igraph-help
>>>>
>>>
>>> _______________________________________________
>>> igraph-help mailing list
>>> address@hidden
>>> https://lists.nongnu.org/mailman/listinfo/igraph-help
>>
>>
>>
>> _______________________________________________
>> igraph-help mailing list
>> address@hidden
>> https://lists.nongnu.org/mailman/listinfo/igraph-help
>>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help
- [igraph] plot.igraph and x-axis, Hermann Norpois, 2013/11/26
- Re: [igraph] plot.igraph and x-axis, Gábor Csárdi, 2013/11/26
- Re: [igraph] plot.igraph and x-axis, Hermann Norpois, 2013/11/26
- Re: [igraph] plot.igraph and x-axis, Gábor Csárdi, 2013/11/26
- Re: [igraph] plot.igraph and x-axis,
Frederik Elwert <=
- Re: [igraph] plot.igraph and x-axis, Hermann Norpois, 2013/11/27
- Re: [igraph] plot.igraph and x-axis, Gábor Csárdi, 2013/11/27
- Re: [igraph] plot.igraph and x-axis, Gábor Csárdi, 2013/11/28
- Re: [igraph] plot.igraph and x-axis, Hermann Norpois, 2013/11/28