Thanks a lot Duncan, Jim and Marc!
2017-05-11 22:59 GMT-03:00 Marc Schwartz :
>
> Bingo.
>
> The 'inset' argument is what I was missing. That allows this to be done
> with one step, rather than the two that I had.
>
> Thanks Duncan.
>
> Mar
[[alternative HTML version deleted]]
_
> On May 11, 2017, at 7:01 PM, Duncan Murdoch wrote:
>
> On 11/05/2017 2:36 PM, Antonio Silva wrote:
>> Hello r-users
>>
>> I want to plot some barplots inside a looping with the legend placed
>> outside the plotting area.
>>
>> No matter the number of bars I want the legend to be placed cente
On 11/05/2017 2:36 PM, Antonio Silva wrote:
Hello r-users
I want to plot some barplots inside a looping with the legend placed
outside the plotting area.
No matter the number of bars I want the legend to be placed centered on the
x-axis.
See the example below
for(i in 1:10) {
var_1 <- sample(
Hi Antonio,
First you want the center of the plot:
xylim<-par("usr")
x_center<-sum(xylim[1:2])/2
Then as you want to have you legend above the plot:
# you will probably want to change the "20" to your preference
y_bottom<-xylim[4]+diff(xylim[3:4])/20
then:
legend(x_center,ybottom,...xjust=0.5,
Thanks for you attention Mark. Your approach is really very interesting. I
will try to apply it in my code.
All the best
Antonio
2017-05-11 16:19 GMT-03:00 Marc Schwartz :
>
> > On May 11, 2017, at 1:36 PM, Antonio Silva
> wrote:
> >
> > Hello r-users
> >
> > I want to plot some barplots insid
> On May 11, 2017, at 1:36 PM, Antonio Silva wrote:
>
> Hello r-users
>
> I want to plot some barplots inside a looping with the legend placed
> outside the plotting area.
>
> No matter the number of bars I want the legend to be placed centered on the
> x-axis.
>
> See the example below
>
>
Hello r-users
I want to plot some barplots inside a looping with the legend placed
outside the plotting area.
No matter the number of bars I want the legend to be placed centered on the
x-axis.
See the example below
for(i in 1:10) {
var_1 <- sample(1000:10,sample(3:8,1))
ymax <- max(var_1)
7 matches
Mail list logo