Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

radiating text does not respect aspect ratio #6

Closed
corybrunson opened this issue Jun 13, 2019 · 1 comment
Closed

radiating text does not respect aspect ratio #6

corybrunson opened this issue Jun 13, 2019 · 1 comment

Comments

@corybrunson
Copy link
Owner

The following extreme case illustrates that the assignment of data$angle in GeomTextRadiate$draw_panel() fails to account for the non-1:1 aspect ratio produced by coord_cartesian().

library(ordr)
#> Loading required package: ggplot2
#> 
#> Attaching package: 'ordr'
#> The following object is masked from 'package:stats':
#> 
#>     cmdscale
#> The following objects are masked from 'package:base':
#> 
#>     eigen, svd
euro.cross %>%
  log() %>% abs() %>%
  cmdscale(k = 2) %>%
  as_tbl_ord() %>%
  augment() %>%
  print() -> euro_mds
#> # A tbl_ord of class 'cmds': (11 x 2) x (11 x 2)'
#> # 2 coordinates: PCo1 and PCo2
#> # 
#> # U: [ 11 x 2 | 1 ]
#>     PCo1     PCo2 |   .name
#>                   |   <chr>
#> 1  0.368  3.61e-8 | 1 ATS  
#> 2 -0.708  1.60e-8 | 2 BEF  
#> 3  2.32  -7.93e-9 | 3 DEM  
#> 4 -2.12   2.60e-8 | 4 ESP  
#> 5  1.21  -7.63e-9 | 5 FIM  
#> # … with 6 more rows
#> # 
#> # V: [ 11 x 2 | 1 ]
#>     PCo1     PCo2 |   .name
#>                   |   <chr>
#> 1  0.368  3.61e-8 | 1 ATS  
#> 2 -0.708  1.60e-8 | 2 BEF  
#> 3  2.32  -7.93e-9 | 3 DEM  
#> 4 -2.12   2.60e-8 | 4 ESP  
#> 5  1.21  -7.63e-9 | 5 FIM  
#> # … with 6 more rows
euro_mds %>%
  ggbiplot() +
  coord_cartesian() +
  geom_u_vector() +
  geom_u_text_radiate(aes(label = .name), hjust = .3)
#> Coordinate system already present. Adding new coordinate system, which will replace the existing one.

Created on 2019-06-13 by the reprex package (v0.2.1)

@corybrunson
Copy link
Owner Author

Oops, equivalent to #1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant