How can I correct the mouse click position in Rstudio's plot window when using classify() of pavo package?

https://www.researchgate.net/publication/331649615_pavo_2_new_tools_for_the_spectral_and_spatial_analysis_of_colour_in_R
Hello everyone, I am learning the analysis method in the above paper, installing the pavo package, and running Rstudio with the data and code provided in the article (the data provided in the article: pavo2_data (figshare.com), in article 6.2, there is a problem when using the classify() function to select the color of the image, the code is as follows:

> heli_images <- getimg("heliconius_plates")
28 files found; importing images.
> plot(heli_images)
Press [enter] for next plot #There are 28 images in the data, so this line appears 28 times
> heli_class <- classify(heli_images, interactive = TRUE)
Select the focal colours in image mimic_01, and press [esc] to continue.
Duplicate colours specified. Try again.
Select the focal colours in image mimic_01, and press [esc] to continue.
Duplicate colours specified. Try again.
Select the focal colours in image mimic_01, and press [esc] to continue.

I noticed that when using the classify() function with the pavo package, the plot window shows the selection location differently from where I clicked with my mouse (as shown in the screenshot, the black cross is where I clicked as I operated, and the small red circle is where the selection is displayed in the plot window).

So I get the above error saying that I've chosen a duplicate color in the space of the plot window, asking me to choose again, but the mouse offset seems to be variable, and I have no way of estimating where I should click.

I later tried using this method directly with R 4.3.1, where the mouse click doesn't shift, but the problem was that you couldn't handle multiple images consecutively, and when I select the color of the first image in the plot window and press the esc key on prompt, the classify function stops directly instead of moving on to the next image.

How can I correct the mouse click position in Rstudio's plot window? Or finish running the classify() function in R 4.3.1?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.