[Matplotlib-users] patch and its border

Benjamin Root ben.v.root at gmail.com
Tue Jun 7 10:57:52 EDT 2016


This actually intersects a bit with a need of mine in basemap. In basemap,
I need to find a clip path that is just slightly bigger than the bounding
box of the map limbs so that I am not "shaving" the border line for the map
limbs. I guess I could flip the problem around and have the map limbs drawn
"inside" the specified polygon so that I don't have to worry about the clip
path shaving my limbs (... yes, I know that sounds incredibly silly).

On Sun, Jun 5, 2016 at 9:22 PM, Thomas Caswell <tcaswell at gmail.com> wrote:

> 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.
>
> Tom
>
> 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
>>
>
> _______________________________________________
> 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/20160607/10338f15/attachment.html>


More information about the Matplotlib-users mailing list