Dissapearing data? / path.simplify behavior

FYI: Thanks for the help John.

This is case where having path.simplify = True causes the plot to be incorrect. Attached are two different images (not quite the same data as the original post- but the same affect). One with path.simplify as true
and one as false. Notice the bottom right plot - the simplify case causes a massive change in the way the plot looks.

It looks like we’ll be reconfiguring things for our users to make sure this is set to false for now. I haven’t experimented w/ the threshold argument to see where this kicks in. It’s definitely a function of plot
size (which is probably expected after reading the simplify documentation).

Does anyone know if there is a good write up anywhere on the cases where having path.simplify=True is important? I’ll search back through the old list posts and see what I can find…

Ted

···

From: James Evans [jrevans1@…803…]
Sent: Friday, November 13, 2009 11:15 AM
To: ‘matplotlib development list’
Subject: [matplotlib-devel] Dissapearing data?

All,

I have noticed a bizarre occurrence. I have a fairly dense plot that when viewed in a large figure I can see all of the data, but as I resize the plot smaller I start to see some of the data disappear. I understand that there is a pixel-space
issue, but to someone who might not realize that their plot is physically too small, they might think that what they see is really true. In the attached example script (with data) you can see this behavior. When the plot gets small enough you never see anything
reach the y value of 20.0. I found this to be a little disconcerting and was wondering if I can get a detailed explanation as to what I am seeing.

Thanks,

–James Evans

Added missing attachments…

simplify_false.png

simplify_true.png

···

From: Drain, Theodore R (343P) [theodore.r.drain@…179…]
Sent: Tuesday, November 17, 2009 7:29 PM
To: James Evans; ‘matplotlib development list’
Subject: Re: [matplotlib-devel] Dissapearing data? / path.simplify behavior

FYI: Thanks for the help John.

This is case where having path.simplify = True causes the plot to be incorrect. Attached are two different images (not quite the same data as the original post- but the same affect). One with path.simplify as true
and one as false. Notice the bottom right plot - the simplify case causes a massive change in the way the plot looks.

It looks like we’ll be reconfiguring things for our users to make sure this is set to false for now. I haven’t experimented w/ the threshold argument to see where this kicks in. It’s definitely a function of plot
size (which is probably expected after reading the simplify documentation).

Does anyone know if there is a good write up anywhere on the cases where having path.simplify=True is important? I’ll search back through the old list posts and see what I can find…

Ted


From: James Evans [jrevans1@…803…]
Sent: Friday, November 13, 2009 11:15 AM
To: ‘matplotlib development list’
Subject: [matplotlib-devel] Dissapearing data?

All,

I have noticed a bizarre occurrence. I have a fairly dense plot that when viewed in a large figure I can see all of the data, but as I resize the plot smaller I start to see some of the data disappear. I understand that there is a pixel-space
issue, but to someone who might not realize that their plot is physically too small, they might think that what they see is really true. In the attached example script (with data) you can see this behavior. When the plot gets small enough you never see anything
reach the y value of 20.0. I found this to be a little disconcerting and was wondering if I can get a detailed explanation as to what I am seeing.

Thanks,

–James Evans

Drain, Theodore R (343P) wrote:

FYI: Thanks for the help John.
This is case where having path.simplify = True causes the plot to be incorrect. Attached are two different images (not quite the same data as the original post- but the same affect). One with path.simplify as true and one as false. Notice the bottom right plot - the simplify case causes a massive change in the way the plot looks.
It looks like we'll be reconfiguring things for our users to make sure this is set to false for now. I haven't experimented w/ the threshold argument to see where this kicks in. It's definitely a function of plot size (which is probably expected after reading the simplify documentation).
Does anyone know if there is a good write up anywhere on the cases where having path.simplify=True is important? I'll search back through the old list posts and see what I can find...

It is a matter of speed, and I think of some hard limits in agg on the number of points it can handle.

So far, every time someone has pointed out a problem--a case in which the simplification code makes a perceptible difference in the appearance of the plot--Mike D. has found a way to fix it.

I haven't followed this thread closely, but have you verified the problem with recent mpl, and have you provided a minimal script to trigger it?

Eric

Eric Firing wrote:

Drain, Theodore R (343P) wrote:
  

FYI: Thanks for the help John.
This is case where having path.simplify = True causes the plot to be incorrect. Attached are two different images (not quite the same data as the original post- but the same affect). One with path.simplify as true and one as false. Notice the bottom right plot - the simplify case causes a massive change in the way the plot looks.
It looks like we'll be reconfiguring things for our users to make sure this is set to false for now. I haven't experimented w/ the threshold argument to see where this kicks in. It's definitely a function of plot size (which is probably expected after reading the simplify documentation).
Does anyone know if there is a good write up anywhere on the cases where having path.simplify=True is important? I'll search back through the old list posts and see what I can find...
    
It is a matter of speed, and I think of some hard limits in agg on the number of points it can handle.
  

Exactly. To that, I would add that it greatly decreases file size for the vector formats (Ps, Pdf, Svg etc.), and also works around similar limitations in Adobe Acrobat Reader (and probably other renderers).

I consider any case where path.simplify *must* be False in order to get correct results to be a bug. The particular bug here (exercised in the attachment in James' original e-mail) was fixed relatively recently on October 21 (r7896). I can confirm the broken behavior with the most recently released version (0.99.1.2), but not with the 0.99.x maintenance branch in SVN. So this fix will make it into the next 0.99.x point release.

Mike

···

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA