Created
August 20, 2016 05:01
-
-
Save endobson/3c98c71575f3fc937644b98dcfc7e2a7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env racket | |
| #lang racket/base | |
| (require | |
| file/convertible | |
| net/base64 | |
| plot/no-gui | |
| ) | |
| (define (write-image img port) | |
| (write-bytes #"\x1b]1337;File=inline=1:" port) | |
| (write-bytes (base64-encode (convert img 'png-bytes) #"") port) | |
| (write-bytes #"\x07\n" port) | |
| (void)) | |
| (define cool-plot | |
| (plot3d-pict (vector-field3d (λ (x y z) (vector x z y)) -2 2 -2 2 -2 2))) | |
| (write-image cool-plot (current-output-port)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment