Just make a cutout of the arbitrary function from opaque material and tape it to the CRT, photoamp servos the vertical sweep to cutout contour : View in a fixed-width font such as Courier.
. . . . --------------------- . / | . / | . / | . / | lightproof enclosure . oscilloscope / ---------------------------- . / / | . / / | . / / / \\ | . / / / | | | | | . ---------- / / / -~~~~~~-> | | | photodetctor | . | | | | | | | | amp & ps | . | | |/ / ----- | . | | | / | | | . | | |/ | | | . | | ----- | . | | | | | . | ---------------|-|---------------- . | | | | . | y | | | . | o------- | . | o--------- . | / . | x / . | o-------< sweep . | o-------< in . | / . | / . | / . | / . | / . ------------- / . . . .