2017-02-27 59 views
0

我想問一下,如果有人知道關於r格式包中的軸格式的答案ggvis。 我正在使用%軸格式,但是我想根據CVaR的擴展添加som小數位。 image here 這裏是我的代碼:r ggvis軸的百分比和小數位格式

Datovka %>% ggvis(x = ~yShort,y = ~xShort,strokeWidth:=1, stroke:="blue", strokeWidth.hover := 3) %>% layer_paths() %>% layer_paths(x = ~yNoShort, y = ~xNoShort, data = DatovkaNoShort , stroke :="green",strokeWidth:=1, strokeWidth.hover := 3) %>% 
    layer_points(~vol,~r,data = vynosyR, fill := ~isinP, key := ~id , size := 60, size.hover :=120) %>% 
    # hide_legend("fill") %>% 
    add_tooltip(all_values, "hover") %>% 
    add_axis("x", title = "CVaR",format = "%" , title_offset = 50) %>% 
    add_axis("y", title = "Expected return", format = "%" , title_offset = 50) %>% 
    scale_numeric("y", nice = FALSE, clamp = TRUE) %>% 
    scale_numeric("x", nice = FALSE, clamp = TRUE) } 

謝謝

+0

要求繪製的幫助是特別有用的包括[重複的例子,當(http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example)與樣本輸入數據,所以我們可以複製/粘貼代碼來運行它並測試可能的解決方案。 – MrFlick

回答