plot icon indicating copy to clipboard operation
plot copied to clipboard

Lines outside plot area

Open bennn opened this issue 10 years ago • 1 comments

Here's the problem: sometimes the ends of lines extend past the plot area. over-the-line (This picture was made using plot-pict and put directly into a scribble document.)

I'd like to give a smaller example with code, but I'm having trouble reproducing the issue. I think that's because rendering a plot clips the lines.

For example here's a perfectly clipped pict: clipped

And a seemingly-clipped blurry pict, generated by calling (compose1 bitmap pict->bitmap) on the first pict. blurred

If picts are supposed to be unclipped, is the an easy, non-blurry way to render & clip them?

bennn avatar Jul 15 '15 06:07 bennn

A simpler example:

#lang racket
(require plot/pict pict racket/class)
(define (make-plot)
  (parameterize ([line-width (* 3 (line-width))])
    (plot-pict
      (function (lambda (x) x) #:color 'red)
     #:x-min 0
     #:x-max 1
     #:y-max 2  ;; Makes the overlap easier to see
     )))
(define plt (make-plot))
(send (pict->bitmap plt) save-file "clip.png" 'png)

clip

bennn avatar Jul 24 '15 17:07 bennn