[racket] Plot silently fails for some characters in y-label

From: Kieron Hardy (kieron.hardy at gmail.com)
Date: Fri Apr 25 20:40:37 EDT 2014

I can replicate the original problem (Racket 5.3.6 32-bit on Win7 64-bit).

The new plot has problems also - see attached.

Kieron.


On Fri, Apr 25, 2014 at 4:39 PM, Neil Toronto <neil.toronto at gmail.com>wrote:

> I can't replicate this problem on my machine, so I'll need more
> information. Can you run the following program and reply with what you see?
>
>
> #lang racket
>
> (require racket/draw plot)
>
> (plot (function sin #e1e-157 #e1e-156))
>
> (define bm (make-bitmap 400 400))
> (define dc (make-object bitmap-dc% bm))
> (send dc set-smoothing 'smoothed)
> (send dc set-scale 2 2)
> (send dc set-font (make-font #:size (plot-font-size)
>                              #:family (plot-font-family)
>                              #:size-in-pixels? #t))
> (send dc get-text-extent "X (⇑∘C)" #f #t 0)
> (send dc draw-text "X (⇑∘C)" 80 180 #t 0 0)
> (send dc get-text-extent "Y (∘C)" #f #t 0)
> (send dc draw-text "Y (∘C)" 10 120 #t 0 (/ pi 2))
> (send dc draw-ellipse 30 30 140 140)
> bm
>
>
> It should produce a simple plot with tick labels on both axes with the
> superscripted exponent "-157", a collection of numbers that looks something
> like this:
>
> 110.0
> 13.5
> 3.0
> 0.0
> 34.0
> 13.5
> 3.0
> 0.0
>
> and a bitmap with a circle and the X and Y axis labels you expect, with
> approximately the placement and orientation you expect them on a plot
> (though bigger).
>
> Neil ⊥
>
> On 04/25/2014 03:39 PM, Deren Dohoda wrote:
>
>> Short story: put a \circ in the y-label and plotting fails?
>>
>> Racket 6.0 32-bit on 64-bit Windows 7. Using DrRacket. The plot frame is
>> generated, the plot title and x-label appear, the tick marks on the axes
>> appear, but the y-label doesn't appear and neither (points ...) nor
>> (function ...) appear.
>>
>> Example code (hopefully the extra characters come through email
>> correctly):
>>
>> #lang racket
>> (require plot)
>>
>> (define (make-p title y-label)
>>    (plot (function (λ(x) x))
>>          #:x-min 0 #:x-max 50
>>          #:y-min 0 #:y-max 50
>>          #:x-label "X (⇑∘C)"
>>          #:y-label y-label
>>          #:title title))
>>
>> (define-values (works doesnt-work)
>>    (values (make-p "Works (⇓∘C)" "Y (C)")
>>            (make-p "Doesn't Work (⇓∘C)" "Y (∘C)")))
>>
>> works
>> doesnt-work
>> ;;;;;;;;;;;;;;;;;;;;;
>>
>>
>> It's not just arbitrary character substitutions, for instance all the
>> \left|right|up|downarrow don't cause any problems, but
>> \Down|Up|etc.arrow causes the same problem as \circ. I threw some in the
>> title and x-label to show that they didn't cause any failures. I've
>> attached an image of what appears in case it helps.
>>
>> Deren
>>
>>
>> ____________________
>>    Racket Users list:
>>    http://lists.racket-lang.org/users
>>
>>
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140425/46e8d451/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plot-problem.png
Type: image/png
Size: 26650 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20140425/46e8d451/attachment-0001.png>

Posted on the users mailing list.