Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[ENH]: callable arguments to the high level plot functions #20926

Closed
@akhmerov

Description

@akhmerov

Problem

I often find myself using an equivalent of this code:

x=np.linspace(x_min,x_max)pyplot.plot(x,f(x))

This is unnecessarily verbose, and if written in one line has redundancy:

pyplot.plot(np.linspace(x_min,x_max),f(np.linspace(x_min,x_max)))

Proposed solution

It would be convenient if.plot and similar high level plotting routines identified callable arguments and if possible evaluated those with array arguments. I imagine the amount of meaningful combinations would be limited.

Additional context and prior art

Providing functions as input to plotting routines and letting those take care of the evaluation is a common pattern.

  • Julia has suchinterface
  • Mathematica goes astep further and determines how to sample the function. This is out of scope for matplotlib.
  • Similarly matlab hasfplot

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp