casioplot — simplified graphics plotting

The casioplot module provides a set of basic, easy-to-use functions for drawing on the calculator’s screen. It is designed for beginners and simple graphical applications.

Functions

casioplot.show_screen()

Updates the physical display with the content that has been drawn in the video memory (VRAM). This function must be called to make any drawings or text visible.

casioplot.clear_screen()

Fills the entire screen with white, effectively erasing all existing content from the drawing buffer.

casioplot.set_pixel(x, y, color=(0, 0, 0))

Sets the color of a single pixel at a specified (x, y) coordinate.

Parameters:
  • x – The horizontal position of the pixel.

  • y – The vertical position of the pixel.

  • color – An RGB tuple where each value is between 0 and 255. Defaults to black.

Note

For better performance, especially in loops, it is recommended to store color tuples in variables instead of creating them repeatedly inside the loop.

Example:

# Define colors
RED = (255, 0, 0)
BLACK = (0, 0, 0)

# Set a red pixel at (10, 10)
set_pixel(10, 10, RED)

# Set a black pixel at (11, 10) using the default color
set_pixel(11, 10)
casioplot.get_pixel(x, y) tuple

Retrieves the color of the pixel at a specified (x, y) coordinate.

Parameters:
  • x – The horizontal position of the pixel.

  • y – The vertical position of the pixel.

Returns:

An RGB tuple (r, g, b) representing the color of the pixel.

Performance Warning

This function can be slow when called frequently inside a loop due to the creation of a new tuple for each call.

Example:

# Get the color of the pixel at (10, 10)
pixel_color = get_pixel(10, 10)
print("Color is:", pixel_color)
casioplot.draw_string(x, y, text, color=(0, 0, 0), size='medium')

Draws a string of text on the screen with its top-left corner at the specified (x, y) coordinate.

Parameters:
  • x – The horizontal position for the top-left corner of the text.

  • y – The vertical position for the top-left corner of the text.

  • text – The string of text to be drawn. Newline characters (\n) in the string will be rendered as spaces.

  • color – An RGB tuple (r, g, b) for the text color. Defaults to black.

  • size – The font size. Can be one of "small", "medium", or "large". Defaults to “medium”.

Example:

# Define a blue color
BLUE = (0, 0, 255)

# Draw "Hello, World!" in large blue text at (0, 0)
draw_string(0, 0, "Hello, World!", BLUE, "large")

# Draw smaller text in black
draw_string(0, 20, "This is a test.", size="small")