{"action":"created","issue":{"url":"https://api.github.com/repos/hadley/ggplot2/issues/1666","repository_url":"https://api.github.com/repos/hadley/ggplot2","labels_url":"https://api.github.com/repos/hadley/ggplot2/issues/1666/labels{/name}","comments_url":"https://api.github.com/repos/hadley/ggplot2/issues/1666/comments","events_url":"https://api.github.com/repos/hadley/ggplot2/issues/1666/events","html_url":"https://github.com/hadley/ggplot2/issues/1666","id":165546120,"number":1666,"title":"geom_point smallest point size is not in proportion","user":{"login":"muranyia","id":7562080,"avatar_url":"https://avatars.githubusercontent.com/u/7562080?v=3","gravatar_id":"","url":"https://api.github.com/users/muranyia","html_url":"https://github.com/muranyia","followers_url":"https://api.github.com/users/muranyia/followers","following_url":"https://api.github.com/users/muranyia/following{/other_user}","gists_url":"https://api.github.com/users/muranyia/gists{/gist_id}","starred_url":"https://api.github.com/users/muranyia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muranyia/subscriptions","organizations_url":"https://api.github.com/users/muranyia/orgs","repos_url":"https://api.github.com/users/muranyia/repos","events_url":"https://api.github.com/users/muranyia/events{/privacy}","received_events_url":"https://api.github.com/users/muranyia/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-14T12:05:51Z","updated_at":"2016-07-28T21:16:03Z","closed_at":"2016-07-28T21:16:03Z","body":"When visualizing a variable using point size, the smallest point size is sometimes significantly (not proportionally) smaller than the rest.\r\nIt seems that this occurs when the data has a categorical character (not class). Adding a little bit of jitter to the data normalizes the point sizes in the legend, but still not on the plot.\r\n\r\n```Rscript\r\nrequire(ggplot2)\r\n\r\n# Test 1. Legend for 70 and corresponding point size on the graph are small.\r\nID <- c(\"C1\", \"C2\", \"C3\", \"C4\", \"C1\", \"C2\", \"C3\", \"C4\", \"C1\", \"C2\", \"C3\", \"C4\", \"C1\", \"C2\", \"C3\", \"C4\")\r\nCP <- c(70, 95, 100, NA, 70, 95, 100, NA, 70, 95, 100, NA, 70, 95, 100, NA)\r\nvariable <- c(\"A\", \"A\", \"A\", \"A\", \"B\", \"B\", \"B\", \"B\", \"C\", \"C\", \"C\", \"C\", \"D\", \"D\", \"D\", \"D\")\r\nvalue <- c(76, 20, 30, 17, 36, 10, 51, 41, 89, 1, 94, 6, 100, 98, 16, 33)\r\ntestdata <- data.frame(ID, CP, variable, value)\r\nggplot(data=testdata, aes(x=variable, y=value, group=ID, size=CP)) + geom_point()\r\n\r\n\r\n# Test 2. Legend is good, point size for 70 on the graph is small.\r\nID <- c(\"C1\", \"C2\", \"C3\", \"C4\", \"C1\", \"C2\", \"C3\", \"C4\", \"C1\", \"C2\", \"C3\", \"C4\", \"C1\", \"C2\", \"C3\", \"C4\")\r\nCP <- c(71, 95, 97, NA, 71, 95, 97, NA, 71, 95, 97, NA, 71, 95, 97, NA) # \"Jittered\" a bit\r\nvariable <- c(\"A\", \"A\", \"A\", \"A\", \"B\", \"B\", \"B\", \"B\", \"C\", \"C\", \"C\", \"C\", \"D\", \"D\", \"D\", \"D\")\r\nvalue <- c(76, 20, 30, 17, 36, 10, 51, 41, 89, 1, 94, 6, 100, 98, 16, 33)\r\ntestdata <- data.frame(ID, CP, variable, value)\r\nggplot(data=testdata, aes(x=variable, y=value, group=ID, size=CP)) + geom_point()\r\n```"},"comment":{"url":"https://api.github.com/repos/hadley/ggplot2/issues/comments/236027737","html_url":"https://github.com/hadley/ggplot2/issues/1666#issuecomment-236027737","issue_url":"https://api.github.com/repos/hadley/ggplot2/issues/1666","id":236027737,"user":{"login":"hadley","id":4196,"avatar_url":"https://avatars.githubusercontent.com/u/4196?v=3","gravatar_id":"","url":"https://api.github.com/users/hadley","html_url":"https://github.com/hadley","followers_url":"https://api.github.com/users/hadley/followers","following_url":"https://api.github.com/users/hadley/following{/other_user}","gists_url":"https://api.github.com/users/hadley/gists{/gist_id}","starred_url":"https://api.github.com/users/hadley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hadley/subscriptions","organizations_url":"https://api.github.com/users/hadley/orgs","repos_url":"https://api.github.com/users/hadley/repos","events_url":"https://api.github.com/users/hadley/events{/privacy}","received_events_url":"https://api.github.com/users/hadley/received_events","type":"User","site_admin":false},"created_at":"2016-07-28T21:16:03Z","updated_at":"2016-07-28T21:16:03Z","body":"I think this is just an artefact of human perception\r\n\r\n```R\r\nlibrary(ggplot2)\r\n\r\ndf <- data.frame(\r\n  a = 1,\r\n  b = seq(70, 100, length = 10)\r\n)\r\n\r\nggplot(df, aes(b, 1, size = b)) + \r\n  geom_point()\r\n```\r\n\r\nMaybe you want `scale_size_area()`?\r\n\r\n```R\r\nggplot(df, aes(b, 1, size = b)) + \r\n  geom_point() +\r\n  scale_size_area()\r\n```"}}
{"actor":{"display_login":"hadley"}}