Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lines outside plot area #8

Open
bennn opened this issue Jul 15, 2015 · 1 comment
Open

Lines outside plot area #8

bennn opened this issue Jul 15, 2015 · 1 comment

Comments

@bennn
Copy link
Contributor

bennn commented Jul 15, 2015

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
Copy link
Contributor Author

bennn commented Jul 24, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant