ggvis
ggvis copied to clipboard
Label of y axis is overlapping with the axis tick labels
The label of y axis overlaps the y axis tick labels:
data.frame(x=rnorm(100),reallylongvariable=rnorm(100)*100000) %>% ggvis(~x,~reallylongvariable) %>% layer_points()
The label reallylongvariable
should be left of the all the y
axis labels, but it is not.
Here is my sessionInfo()
output:
R version 3.1.1 (2014-07-10)
Platform: x86_64-apple-darwin13.1.0 (64-bit)
locale:
[1] fr_FR.UTF-8/fr_FR.UTF-8/fr_FR.UTF-8/C/fr_FR.UTF-8/C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggplot2_1.0.0 tidyr_0.1 data.table_1.9.2
[4] shiny_0.10.0 ggvis_0.3.0.1 reshape2_1.4
[7] testthat_0.8.1 RSQLite.extfuns_0.0.1 magrittr_1.0.1
[10] RMySQL_0.9-3 RPostgreSQL_0.4 RSQLite_0.11.4
[13] DBI_0.2-7 dplyr_0.2
loaded via a namespace (and not attached):
[1] assertthat_0.1 bitops_1.0-6 caTools_1.17 colorspace_1.2-4
[5] compiler_3.1.1 digest_0.6.4 grid_3.1.1 gtable_0.1.2
[9] htmltools_0.2.4 httpuv_1.3.0 labeling_0.2 MASS_7.3-33
[13] munsell_0.4.2 parallel_3.1.1 plyr_1.8.1 proto_0.3-10
[17] Rcpp_0.11.2 RJSONIO_1.2-0.2 scales_0.2.4 stringr_0.6.2
[21] tools_3.1.1 xtable_1.7-3
I've come across this before. It would be nice if ggvis/vega figured out the correct offset automatically - in the meantime I usually use the dy
parameter as in here:
add_axis('y', title='Really Long Variable', properties=axis_props(labels=list(fontSize=12), title=list(fontSize=16,dy=-25)))
-25 didn't do the job for me so I used:
add_axis("y", title = 'yaxis title name', properties=axis_props(title=list(dy=-50)))
Would be nice if we knew what the x axis offset was and could have it more symmetric if you know what I mean.