Skip to contents

This function plots a captcha object on the screen. It is a S3 method for the graphics::plot() function.

Usage

# S3 method for captcha
plot(x, y, ...)

Arguments

x

Captcha object read with read_captcha()

y

Not used

...

Other arguments passed on to graphics::plot()

Details

The plot() function is a method of class S3 from base R. The function facilitates the visualization of Captchas. The function receives a list of images (obtained with the read_captcha() function) and displays the Captcha visually.

An interesting aspect of the plot() function is that it deals with a list of Captchas. It is useful when the goal is to view several Captchas in the image simultaneously. The next image shows an example.

By default, the plot() function arranges the images into four columns. To change the default, one can modify the options using options(captcha.print.cols = N), where N is the desired number of columns. The next image shows an example with two columns.

When the list of Captchas is too long, the plot() function displays a maximum number of images accompanied by a message. By default, this number is 100, with 25 rows and four columns. One can override the option by combining the captcha.print.cols= and captcha.print.rows= options.

It is possible to create subsets of captcha objects using the [ operator. One can also use the length() function to measure the number of images.

Finally, when the image has a label, the plot() function shows the label on the corner of the image.