Open zkbt opened 2 months ago
@Pat-Wachiraphan and @catrionamurray , while addressing the weird behavior for imshow/pcolormesh
-ing large arrays in #238 , I'm trying to clarify the ways we make 2D flux plots. Previously, .imshow()
was our default and would sneakily try to switch to .pcolormesh()
in the background, if it seemed like that would help. I worry that's going to cause confusion, since they now can behave a bit more differently, so I'm hoping to do this instead:
.imshow()
always uses plt.imshow()
, good for uniform arrays.pcolormesh()
always uses plt.pcolormesh()
, good for non-uniform arrays.paint()
will choose between .imshow()
and .pcolormesh()
as needed. I think I want .paint()
to be the default way to make a 2D flux plot for folks who don't want to think much about what's going on behind the scenes, but those who care can still explicitly choose .imshow()
or .pcolormesh()
. I wanted to give you the heads up because I found-and-replaced imshow_quantities
and imshow_with_models
to paint_quantities
and paint_with_models
, and I believe this would likely break some chromatic_fitting
functionality? It's a small dumb thing, but wanted to make sure you were aware of it!
@Pat-Wachiraphan and @catrionamurray , I added you as reviewers, to make sure you see this!
This pull request addresses @Pat-Wachiraphan 's issue in #238, where previous versions of
.imshow
and.pcolormesh
both failed to accurately displayRainbow
flux arrays that contained many more data points than there were pixels available. The main changes are:.imshow()
to use'antialiasing'
by default, which seems to do a pretty good job in limits of both large and small datasets.pcolormesh()
throw a warning if there are too few pixels to display the requested dataset, including suggestions for possible reasonable solutions for the user.paint()
as a default wrapper for 2D presentation of smooth datasets. Previously,.imshow()
would switch to.pcolormesh()
if it seemed reasonable, but this made it a little confusing to know in any particular situation what was actually being used. Since the different aliasing behavior now makes it more important to know which is being used, I wanted to remove that behavior, so if people call.imshow()
they know they're getting.imshow()