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

locator returns incorrect coordinates when graphics device AGG is selected #8571

Closed
3 of 4 tasks
sjmgarnier opened this issue Dec 9, 2020 · 5 comments
Closed
3 of 4 tasks
Labels
bug plots stale Issues which have been closed automatically due to inactivitiy.

Comments

@sjmgarnier
Copy link

@sjmgarnier sjmgarnier commented Dec 9, 2020

System details

RStudio Edition : Desktop
RStudio Version : 1.4.1056
OS Version      :  macOS 11.0.1
R Version       :  4.0.3

Steps to reproduce the problem

plot(c(-1, 1, 1, -1), c(-1, -1, 1, 1))
locator(4)

Click on all four points. The returned coordinates are incorrect, i.e. they do no correspond to the input coordinates of the points.

Describe the problem in detail

See above.

Describe the behavior you expected

locator should return the coordinates that correspond to that of the points in graph.

  • I have read the guide for submitting good bug reports.
  • I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • If I am reporting a RStudio crash, I have included a diagnostics report.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
@ronblum
Copy link
Contributor

@ronblum ronblum commented Dec 14, 2020

@sjmgarnier What are you getting if you run this in R outside of RStudio? I tried it out, and I got the following

$x
[1] -0.9955863  1.0019897  1.0017511 -1.0034754

$y
[1]  0.9867773  1.0001683 -0.9982052 -1.0023723

It's not returning the location of the points themselves, but where the clicks occur. So if I click in the center of the graph four times, I get

> locator(4)
$x
[1] -0.03237114 -0.03237114 -0.03237114 -0.03237114

$y
[1] 0.02967022 0.02967022 0.02967022 0.02967022

Almost (0,0) but not quite. This is the behavior of the locator function in R.

@sjmgarnier
Copy link
Author

@sjmgarnier sjmgarnier commented Dec 14, 2020

@ronblum Did you try that with the AGG device activated in RStudio Preview? The results are widely different from those you get when using the default graphics device. I guess I should have made this more clear in my explanation. The locator function returns what one expects when selecting the default graphics device but not when selecting the AGG device.

@kevinushey
Copy link
Contributor

@kevinushey kevinushey commented Dec 14, 2020

I can reproduce as well. Perhaps a more dramatic example (with me clicking on the point as displayed in the Plots window):

> plot(1)
> locator(1)
$x
[1] 0.6624613

$y
[1] 1.376489

@github-actions
Copy link

@github-actions github-actions bot commented Jun 14, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs, per https://github.com/rstudio/rstudio/wiki/Issue-Grooming. Thank you for your contributions.

@github-actions github-actions bot added the stale Issues which have been closed automatically due to inactivitiy. label Jun 14, 2021
@stale
Copy link

@stale stale bot commented Jun 28, 2021

This issue has been automatically closed due to inactivity.

@stale stale bot closed this as completed Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug plots stale Issues which have been closed automatically due to inactivitiy.
Projects
None yet
Development

No branches or pull requests

3 participants