SourceForge logo
SourceForge logo
Menu

Re: [matplotlib-devel] clipping tick lines

From: Michael D. <md...@st...> - 2008年07月31日 14:48:26
Aha -- here from John (in another thread) is why those lines were 
commented out:
""""
On Sun, Jul 27, 2008 at 4:24 PM, John Hunter <jd...@gm...> wrote:
> > if midPoint:
> > if self.gridOn:
> > self.gridline.draw(renderer)
> > if self.tick1On:
> > self.tick1line.draw(renderer)
> > if self.tick2On:
> > self.tick2line.draw(renderer)
> 
For a little extra color on what is going on here -- we don't want to
automatically clip the tick lines to the axes bounding box because
someone might choose the tick direction 'out'. Since we can't use
graphical clipping, this test is trying to make sure the tick location
is in the view interval before drawing it. You may want to consider a
overridable method 'is_draw_tick' or something along those lines,
which defaults to::
 mtransforms.interval_contains(self.get_view_interval(), self.get_loc())
""""
So, I suppose we'll need to find another solution other than graphical 
clipping, or a way to do it only when needed to solve the problem at 
hand (in this thread).
Cheers,
Mike
Michael Droettboom wrote:
> (Just back from vacation)
>
> That change was long enough ago that I don't remember the reason -- it 
> may have just been a debugging hack that made its way into the code. 
> Let's leave it uncommented until someone notices breakage... ;)
>
> Cheers,
> Mike
>
> Ryan May wrote:
> 
>> Eric Firing wrote:
>> 
>> 
>>>> Anyone have any ideas?
>>>> 
>>>> 
>>> I don't, but it appears that the set_clip_path method was introduced in 
>>> 4817 by Mike D., complete with the commented-out lines.
>>> http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/axis.py?annotate=5651 
>>>
>>> http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/axis.py?view=diff&r1=4816&r2=4817 
>>> 
>>> 
>> Uncommenting them doesn't seem to break anything and it solves my 
>> problem as well. I guess there could be performance impacts so I'll 
>> wait for Mike to weigh in.
>>
>> Ryan
>>
>> 
>> 
>
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

View entire thread

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /