{"action":"created","issue":{"url":"https://api.github.com/repos/spatstat/spatstat/issues/24","repository_url":"https://api.github.com/repos/spatstat/spatstat","labels_url":"https://api.github.com/repos/spatstat/spatstat/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/spatstat/spatstat/issues/24/comments","events_url":"https://api.github.com/repos/spatstat/spatstat/issues/24/events","html_url":"https://github.com/spatstat/spatstat/issues/24","id":174704339,"number":24,"title":"Plot coordinates (image device) flipped on MacOSX","user":{"login":"Bio7","id":281464,"avatar_url":"https://avatars.githubusercontent.com/u/281464?v=3","gravatar_id":"","url":"https://api.github.com/users/Bio7","html_url":"https://github.com/Bio7","followers_url":"https://api.github.com/users/Bio7/followers","following_url":"https://api.github.com/users/Bio7/following{/other_user}","gists_url":"https://api.github.com/users/Bio7/gists{/gist_id}","starred_url":"https://api.github.com/users/Bio7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bio7/subscriptions","organizations_url":"https://api.github.com/users/Bio7/orgs","repos_url":"https://api.github.com/users/Bio7/repos","events_url":"https://api.github.com/users/Bio7/events{/privacy}","received_events_url":"https://api.github.com/users/Bio7/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"baddstats","id":7161794,"avatar_url":"https://avatars.githubusercontent.com/u/7161794?v=3","gravatar_id":"","url":"https://api.github.com/users/baddstats","html_url":"https://github.com/baddstats","followers_url":"https://api.github.com/users/baddstats/followers","following_url":"https://api.github.com/users/baddstats/following{/other_user}","gists_url":"https://api.github.com/users/baddstats/gists{/gist_id}","starred_url":"https://api.github.com/users/baddstats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baddstats/subscriptions","organizations_url":"https://api.github.com/users/baddstats/orgs","repos_url":"https://api.github.com/users/baddstats/repos","events_url":"https://api.github.com/users/baddstats/events{/privacy}","received_events_url":"https://api.github.com/users/baddstats/received_events","type":"User","site_admin":false},"assignees":[{"login":"baddstats","id":7161794,"avatar_url":"https://avatars.githubusercontent.com/u/7161794?v=3","gravatar_id":"","url":"https://api.github.com/users/baddstats","html_url":"https://github.com/baddstats","followers_url":"https://api.github.com/users/baddstats/followers","following_url":"https://api.github.com/users/baddstats/following{/other_user}","gists_url":"https://api.github.com/users/baddstats/gists{/gist_id}","starred_url":"https://api.github.com/users/baddstats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baddstats/subscriptions","organizations_url":"https://api.github.com/users/baddstats/orgs","repos_url":"https://api.github.com/users/baddstats/repos","events_url":"https://api.github.com/users/baddstats/events{/privacy}","received_events_url":"https://api.github.com/users/baddstats/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2016-09-02T08:12:17Z","updated_at":"2016-09-10T02:51:14Z","closed_at":null,"body":"A user of the ImageJ forum asked a question about a particle analysis and I recommended the use of spatstat:\r\n\r\nhttp://forum.imagej.net/t/number-of-particles-in-clusters/2587\r\n\r\nI flipped the y-coordinates for an ImageJ display.\r\n\r\nThis works fine on Windows. However if i apply the same command on MacOSX the flipped coordinates are not applied to the density plot. If I select a *.pdf device instead of an image device (tested with *.tiff and *.png) the density plot is flipped.\r\n\r\nHere the reproducible example whereas the density plot on MacOSX is not flipped according to the plot template:\r\n\r\nlibrary(spatstat)\r\n\r\n```\r\n#Create a spatstat point pattern from a ImageJ Particle analysis!\r\nX<- ppp(Particles$X, Particles$Y, c(0,imageSizeX), c(0,imageSizeY))\r\nW <- Window(X)\r\n#Plot is visualized in ImageJ (Java) coordinates so we need an inverted coordinate parent plot!\r\nplot(W, ylim=rev(W$yrange),main=NULL)\r\n#Add a density plot\r\nplot(density(X,adjust=0.2),add=T)\r\n#Add the points!\r\nplot(X, add=T)\r\n#Add axis and title in custom font size!\r\naxis(1,cex.axis=2)\r\naxis(2, cex.axis=2)\r\ntitle(main=\"Density\",xlab=\"Width\", ylab=\"Height\", cex.lab=1.5,cex.main=3) \r\n```\r\n\r\n\r\nSpatstat version: 1.46.1\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/spatstat/spatstat/issues/comments/246084003","html_url":"https://github.com/spatstat/spatstat/issues/24#issuecomment-246084003","issue_url":"https://api.github.com/repos/spatstat/spatstat/issues/24","id":246084003,"user":{"login":"baddstats","id":7161794,"avatar_url":"https://avatars.githubusercontent.com/u/7161794?v=3","gravatar_id":"","url":"https://api.github.com/users/baddstats","html_url":"https://github.com/baddstats","followers_url":"https://api.github.com/users/baddstats/followers","following_url":"https://api.github.com/users/baddstats/following{/other_user}","gists_url":"https://api.github.com/users/baddstats/gists{/gist_id}","starred_url":"https://api.github.com/users/baddstats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baddstats/subscriptions","organizations_url":"https://api.github.com/users/baddstats/orgs","repos_url":"https://api.github.com/users/baddstats/repos","events_url":"https://api.github.com/users/baddstats/events{/privacy}","received_events_url":"https://api.github.com/users/baddstats/received_events","type":"User","site_admin":false},"created_at":"2016-09-10T02:51:14Z","updated_at":"2016-09-10T02:51:14Z","body":"OK, thank you. So the fix is to set `useRaster=FALSE` when plotting the image.\r\n\r\nThis suggests that there is a bug in R's image display code (`graphics::rasterImage`) which I will chase up.\r\n\r\nTo get the legend in the image plot in your example, you can set `show.all=TRUE`. See `help(plot.im)`\r\n"}}
{"actor":{"display_login":"baddstats"}}