[Matplotlib-users] patch and its border

Thomas Caswell tcaswell at gmail.com
Sun Jun 5 21:22:59 EDT 2016

I recall there being discussion of controlling if paths are stroked
'inside', 'outside', or 'on' the path, but I can not find a link.

One possible work around (which is not super elegant) is to use two
rectangles, one drawn with the thick border and one with a `lw=0` and a
higher z-order overlayed on top.


On Sun, Jun 5, 2016 at 6:36 PM Matěj Týč <matej.tyc at gmail.com> wrote:

> Hello,
> consider a case when I want to draw a patch, but it is important how the
> border is drawn. For example, if I have an aerial photo and I would like
> to add a rectangle of given dimensions as a reference. Having the
> rectangle interior white and its border thick and black is good, because
>  it ensures that the reference will be always clearly visible,
> regardless of whether the photo is dark or bright.
> However, as the border is thick, it may significantly overlap with the
> interior, which is highly unwanted, because it will look smaller.
> Therefore, in this case, I would like to draw the border, but all of it
> should be outside of the patch primary area.
> And I am sure that there are use cases for the opposite situation.
> TL;DR: Take a look at the attached picture to see what I have in mind -
> I would like to use "outer borders" (red) or "inner borders", or
> classical ones, depending on my needs.
> Is there a user possibility to influence how the border is drawn? If
> not, how difficult would it be to implement this in matplotlib?
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20160606/bc565eb4/attachment.html>

More information about the Matplotlib-users mailing list