[Matplotlib-devel] Interpolations in Line2D objects

Jody Klymak jklymak at uvic.ca
Sun Mar 10 11:14:40 EDT 2019

Hi Ray,

Thanks a lot for the interest in Matplotlib.  On the other hand, I’d be against this because the API for curve fitting would need to be elaborate, and in my opinion has a better home in scipy or numpy.  We are trying to get away from data processing tasks inside Matplotlib, and leave that to partner libraries, though a few exceptions still exist. 

As for legends, I’d argue pretty strongly that the data and the spline are quite different entities and deserve differentiation in the legend and/or caption of whatever figure you are making.  However if you really want the line and marker in the same legend entry there are numerous hacks to let you do that.  Easiest is probably to draw a marker + line off-canvas somewhere and label that.  

Cheers,  Jody

> On Mar 9, 2019, at  7:22 AM, Raymond Osborn via Matplotlib-devel <matplotlib-devel at python.org> wrote:
> Is there any interest in adding an interpolation attribute to axes.Line2D objects similar to those in Axes.imshow? We often use bicubic interpolation using spicy.interpolate to generate smooth lines to connect markers, partly for aesthetic reasons, but partly for (what we maintain are) valid scientific reasons. However, there is no way to display the line along with the associated marker in legends, and it generates additional Line2D objects that are not really separate entities.
> I haven’t looked into how this might be done but I thought I would check first to see if this has been considered before and rejected for any reason. It obviously requires storing additional smoothed arrays and smoothing options, and perhaps there are other complications I am not aware of.
> Ray
> _______________________________________________
> Matplotlib-devel mailing list
> Matplotlib-devel at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-devel

More information about the Matplotlib-devel mailing list