[R] Hello R user!

Sarah Goslee sarah.goslee at gmail.com
Tue Dec 17 19:24:16 CET 2013


On Tue, Dec 17, 2013 at 1:04 PM, bibek sharma <mbhpathak at gmail.com> wrote:
> Hi Sarah,
> It is not about mfrow or mfcol.  I would like to see both sets of data in
> one figure.
> All I want was combining these two plots  to one.
> Any suggestions?
> Bibek

Suggestions? Yes. Read the link I and others provided about
reproducible questions.

Then there's the suggestion I already provided, using points() or
lines() to add more data, possibly with xlim or ylim specified (see
?par for details). Without a reproducible example, I can't give
specific details.

> Also, size of the circle in the plots represents  rates and so should be
> shown in different sizes.
> I tried using plots and points but this did  not give me different sizes.

If you want to use base graphics, then cex is what you need (see, you
guessed it, ?par). You can pass a vector of sizes for your plotting
character.

For more sophisticated approaches, you might google "bubble plot R" for ideas.

Sarah

>
>
> On Tue, Dec 17, 2013 at 9:45 AM, Sarah Goslee <sarah.goslee at gmail.com>
> wrote:
>>
>> What do you mean by "merge these figures in one"? If you want two
>> figures on one page, see ?par - specifically mfrow and mfcol.
>>
>> If you want both sets of data in one figure, maybe ?points or ?lines
>> though I see you're already familiar with at least ?lines.
>>
>> The list doesn't take most attachments, and you might also take a look at:
>>
>> http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
>>
>> Asking intelligible questions is the best strategy for receiving
>> intelligible answers.
>>
>> Sarah
>>
>> On Tue, Dec 17, 2013 at 12:33 PM, bibek sharma <mbhpathak at gmail.com>
>> wrote:
>> > Hello R user,
>> >
>> > I have created two plots (attached!) using the codes below
>> > and would like to merge these figures in one. any suggestions are highly
>> > appreciated!
>> > Thanks,
>> >
>> > plot(graph1$yod,graph1$xod,data=graph1)
>> > dfx = data.frame(ev1=graph1$xod, ev2=graph1$yod, ev3=abs(graph1$dif))
>> > symbols(x=dfx$ev1, y=dfx$ev2, circles=dfx$ev3,inches=1/8, ann=F,
>> > bg="black", fg=NULL,xlim=c(-35,35),ylim=c(-35,35))
>> > abline(h=0,v=0)
>> >
>> > plot(graph2$yod,graph2$xod,data=graph2)
>> > dfx = data.frame(ev1=graph2$xod, ev2=graph2$yod, ev3=abs(graph2$dif))
>> > lines(symbols(x=dfx$ev1, y=dfx$ev2, circles=dfx$ev3,inches=1/8, ann=F,
>> > bg="blue", fg=NULL,xlim=c(-35,35),ylim=c(-35,35)))
>> > abline(h=0,v=0)
>> >
>> > Best,
>> > Bibek
>>
>>



-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list