[R] Question on plotting with googleVis

Christofer Bogaso bogaso.christofer at gmail.com
Wed Jul 17 17:48:01 CEST 2013


Hi Arnaud,

Thanks for your answer.

However I prefer to have Horizontal bar chart, because length of the
strings for x-axis are quite large, therefore it would be better to
put them vertically one-below-another instead horizontally.

Therefore I would really appreciate if someone points me how to
control the max and min values for x-axis.

Thanks and regards,

On 7/17/13, Arnaud Michel <michel.arnaud at cirad.fr> wrote:
> Hi
> You can do a rotation and use gvisColumnChart instead gvisBarChart
> plot(gvisColumnChart(MyData, xvar="Names1", yvar=c("Values1",
> "Values2"),options=list(width=2500,height=1000)))
> Michel
>
>
>
> Le 17/07/2013 15:57, Christofer Bogaso a écrit :
>> Hello Arnaud,
>>
>> Thank you for your pointer. However I need to more clarification.
>>
>> I want to control the max. and min. values for the x-axis, as well as
>> number of vertical gridlines to be displayed. I tried the following:
>>
>>
>> MyData <- data.frame(Names1 = paste("XXX", 1:150), Values1 = 1:150 +
>> 10, Values2 = 1:150)
>> library(googleVis)
>> plot(gvisBarChart(MyData, xvar="Names1", yvar=c("Values1",
>> "Values2"),options=list(width=1200,height=1500,hAxis.gridlines =
>> "{count: 10}",hAxis.minValue = 0, hAxis.maxValue = 100)))
>>
>> However this is not clearly working. Can someone point me what went
>> wrong?
>>
>> Thanks and regards,
>>
>>
>>
>>
>> On 7/16/13, Arnaud Michel <michel.arnaud at cirad.fr> wrote:
>>> You can try with list options :
>>>
>>> plot(gvisBarChart(MyData, xvar="Names1", yvar=c("Values1", "Values2"),
>>> options=list(width=1200,height=1500)))
>>>
>>>
>>>
>>> Le 15/07/2013 20:00, Christofer Bogaso a écrit :
>>>> Hello again,
>>>>
>>>> Let say I have following data-frame:
>>>>
>>>> MyData <- data.frame(Names1 = paste("XXX", 1:150), Values1 = 1:150 +
>>>> 10,
>>>> Values2 = 1:150)
>>>>
>>>> Now I want to plot this data-frame with googleVis. Therefore I run
>>>> following codes:
>>>>
>>>> library(googleVis)
>>>> plot(gvisBarChart(MyData, xvar="Names1", yvar=c("Values1", "Values2")))
>>>>
>>>> However the problem is that, hardly this plot can be read. However if I
>>>> plot a fraction of my data-frame then the underlying plot is clearly
>>>> visible:
>>>>
>>>> plot(gvisBarChart(MyData[1:15,], xvar="Names1", yvar=c("Values1",
>>>> "Values2")))  ## This is clearly visible.
>>>>
>>>>
>>>> I would really appreciate if someone gives me some pointer how I can
>>>> clearly plot my data-frame with googleVis. I understand that there are
>>>> many
>>>> other plotting methods available with R like ggplot, however here I
>>>> want
>>>> to
>>>> use googleVis because of its strength in showing the values within the
>>>> plot
>>>> area itself if you hover your mouse.
>>>>
>>>> Thanks and regards,
>>>>
>>>> 	[[alternative HTML version deleted]]
>>>>
>>>> ______________________________________________
>>>> R-help at r-project.org mailing list
>>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>>> PLEASE do read the posting guide
>>>> http://www.R-project.org/posting-guide.html
>>>> and provide commented, minimal, self-contained, reproducible code.
>>>>
>>> --
>>> Michel ARNAUD
>>> Chargé de mission auprès du DRH
>>> DGDRD-Drh - TA 174/04
>>> Av Agropolis 34398 Montpellier cedex 5
>>> tel : 04.67.61.75.38
>>> fax : 04.67.61.57.87
>>> port: 06.47.43.55.31
>>>
>>>
>
> --
> Michel ARNAUD
> Chargé de mission auprès du DRH
> DGDRD-Drh - TA 174/04
> Av Agropolis 34398 Montpellier cedex 5
> tel : 04.67.61.75.38
> fax : 04.67.61.57.87
> port: 06.47.43.55.31
>
>



More information about the R-help mailing list