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]: pre-set file name for GUI save dialog in rcParams #27774

Closed
Labels
@FilipDominec

Description

@FilipDominec

Problem

While there is an obvious way to specify theoutput image format as well asdirectory where GUI suggests to export your interactive plot, like this:

 matplotlib.rcParams["savefig.format"] = "pdf" matplotlib.rcParams["savefig.directory"] = ...

there is no easy way to suggest thefile base name, and it always defaults to practically useless "Figure_1" or so.

Rationale 1: I often process & plot a lot of scientific datasets with long names that encode a bunch of useful parameters. My scripts would therefore save me significant amount of time if e.g. for "abcd123.dat" they suggested to export into "abcd123.*".

Rationale 2: One old question about this can be found on SO (https://stackoverflow.com/questions/41680007/how-to-change-default-filename-from-matplotlib-navigationtoolbar-in-a-pyqt5-appl) and the proposed solution requires monkey-patching Matplotlib functions - which is ugly, tedious and most importantly, the suggested code did not work anymore.

Proposed solution

Let's allow users to change the filename too, allowing one to simply set:

 matplotlib.rcParams["savefig.basename"] = ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    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