[racket-users] Re: Plot with text annotation inside the graph
Thanks Alex, that does the trick. On Saturday, October 15, 2016 at 12:58:28 AM UTC-4, Alex Harsanyi wrote: > You could try using a point-label or a function-label with a point size of 0, > like this: > > (plot (list (function-interval sin (lambda (x) 0)) > (function-label (lambda (x) (* (sin x) 0.2)) -1.8 "sin(x)" > #:point-size 0)) > #:x-min -2 #:x-max 2) > > Alex. > > On Saturday, October 15, 2016 at 10:29:07 AM UTC+8, Marc Kaufmann wrote: > > Hi all, > > > > I am creating some graphs where I want to label various regions as region > > A, B, C, and so on. Currently I am doing this by coloring the regions > > differently and having the labels in legend: > > > > (plot-file > > (list > > (axes) > > (function-interval (lambda (x) 0) MD 0 E_x #:label "F") > > (function-interval > > (lambda (x) (MD E_x)) > > (lambda (x) 0) > > e_x E_x > > #:color 4 #:line1-color 4 #:line2-color 4 > > #:label "G")) > > "graph-proof-which-task-completed-2.pdf" > > #:x-label "Instantaneous effort" > > #:y-label "Marginal Disutility") > > > > This becomes problematic with multiple regions since it is hard to > > distinguish the colors (or line styles). Is there a way to place a label > > "A" in the region "A"? > > > > Thanks, > > > > Marc -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] OSX/Racket/Golang shared libraries warning
First, this is absolutely not referencing a racket bug. I feel obligated to warn anybody that believes the assertion that GO now generates shared libraries consumable by no-GO code. It's true. Go generates a shared library, and you can call to it from Racket, but I can attest to two issues: 1) Expect crashes on OSX. Go attempts to make its runtime system compatible with code anticipating a extern C interface. There's lots of chatter with people running into "runtime/cgo: could not obtain pthread_keys", but none that mention Racket that I see. However, it does crash inside of DrRacket on OSX. Googling delivers examples of Python and Node having similar crashes. 2) Dreadful speed. Even when functioning, i.e. not on OSX, the speed is incredibly slow. I believe that extern "C" style code runs in a separate GO routine and performance-hampering context switching is involved. I'm talking about 1/35 of the speed of calling C/C++ from Racket. So, this is just a warning to lower expectations if you are thinking about calling Go code from an FFI such as Racket's, or if you expect it to work on a Mac. I hope the warning saves somebody a few hours of pain. As always, thanks for Racket. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.