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

Allow user-defined stylesheets.#156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

samcunliffe
Copy link
Collaborator

@samcunliffesamcunliffe commentedJun 8, 2023
edited
Loading

Minimal code-change solution to#2.

As discussed off-issue, I've gone for an (oversimplified) UI: our user puts their custom theme in cwd with the nameuser.mplstyle. I expect we want to refine this (hence a draft PR at the moment).

A TDD test to check we can set the theme from a user-defined stylesheet.For this, just use Solarized_Light2.
... with their own custom stylesheet. At the moment this must be called'user.mplstyle' in the cwd.
@samcunliffe
Copy link
CollaboratorAuthor

🔴Failure as expected.

@dstansby
Copy link
Member

Seems like a good first approach.

Could you check that this doesn't break#64 again? I suspect that setting the stylesheet globally (which as far as I know is all that can be done in Matplotlib 😢 ) might resurface that. If it does, we might have to discuss either dropping this new feature, or finding a way to parse the style sheet and manually apply the styles to the figure/axes.

@dstansby
Copy link
Member

Or what we might be able to do is set the style sheet, plot, then reset to the previous style sheet directly after plotting.

@samcunliffe
Copy link
CollaboratorAuthor

set the style sheet, plot, then reset to the previous style sheet directly after plotting.

Good old MPL devs have provided acontext manager. P'raps this helps....

dstansby reacted with thumbs up emoji

@dstansby
Copy link
Member

Is this still WiP, or should I give it a full review?

@samcunliffe
Copy link
CollaboratorAuthor

samcunliffe commentedJun 15, 2023
edited
Loading

Still WIP (and as-is, this does re-introduce#64). But I think I know what to do.
Failing test first, for proof.

@samcunliffesamcunliffe mentioned this pull requestJun 20, 2023
2 tasks
@dstansby
Copy link
Member

Succeeded by#181, but I did cherry-pick the test from here 🪄

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@dstansbydstansbyAwaiting requested review from dstansby

Assignees
No one assigned
Labels
New featureNew feature or request
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@samcunliffe@dstansby

[8]ページ先頭

©2009-2025 Movatter.jp