4

I am trying to follow the racket documentation on how to use 2D plotting. Unfortunately, I can't seem to be able to get it to work (probably something simple)

My code is:

#lang racket
(require plot)
(plot (function sin (-pi) pi #:label "y = sin(x)"))

and the error is:

compile: unbound identifier in module in: function

I am a racket/lisp newbie, so if it is obvious, I just don't realize it. I have also tried inserting (require racket/gui/base) as well as (plot-new-window? #t) but those don't seem to do the trick either.

I'm using racket v5.1.3 on Ubuntu 12.04. I am not using Dr. Racket.

1 Answer 1

5

The problem is that you are reading the documentation for 5.3.3, but has 5.1.3 installed.

In version 5.3.3 the program:

#lang racket
(require plot)
(plot (function sin (- pi) pi #:label "y = sin(x)"))

works as expected.

Either grab a new version from http://racket-lang.org/download/ or take a look at the old documentation: http://download.racket-lang.org/docs/5.1.3/html/plot/plot.html?q=plot

Sign up to request clarification or add additional context in comments.

1 Comment

aha. I just assumed the versions wouldn't be so different (but it looks like they are. Thanks alot!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.