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

Added test_loglog in test_datetime.py#27435

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

Open
dchen2438 wants to merge1 commit intomatplotlib:main
base:main
Choose a base branch
Loading
fromdchen2438:test_loglog

Conversation

dchen2438
Copy link

@dchen2438dchen2438 commentedDec 4, 2023
edited
Loading

PR summary

Added the test_loglog method in test_datetime.py
This PR is forAxes.loglog in#26864

image

PR checklist

Copy link

@github-actionsgithub-actionsbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join uson gitter for real-time discussion.

For details on testing, writing docs, and our review process, please seethe developer guide

We strive to be a welcoming and open project. Please follow ourCode of Conduct.

@ksunden
Copy link
Member

I will reassert my comment from the semilog version of this (#27320):

Yes, log/semilog/etc axes with datetimes do not make much sense, as they are based on the 1970-01-01 zero mark for computing the scale, and so you are rarely working on multiple orders of magnitude where log scaling makes sense (and even when you are, the zero mark is completely arbitrary and unlikely to be related to your data).

Given that the implementation of semilog[xy] is really just some kwarg management over set_[xy]scale plus plot, the latter of which is already tested with datetimes and the former of which is tested pretty thoroughly independently, I think my vote would be to just omit the tests from the datetime file.

If we were to keep it (which, again, I'd argue we likely don't), just to prove that nothing about units prevents it from being applied, this is actually the case where using dates closer to 1970 (and spanning several decades, most likely) is likely beneficial, as it would make the scale transform visually apparent.

@jklymak
Copy link
Member

mpl.rcParams["date.converter"]='concise'fig, (ax1,ax2,ax3)=plt.subplots(3,1,layout='constrained')x=np.arange(np.datetime64('2015-12-01'),np.datetime64('2023-12-06'))y=10**np.linspace(0,4,len(x))ax1.loglog(x,y)ax2.loglog(y,x)ax3.loglog(x,x)

As@ksunden points out, this is hardly great for larger time spans, with minor ticks being mislabeled.

boo

OTOH, it doesn't spit out an error message, so maybe thats OK for the purposes of these smoke tests?

@dchen2438
Copy link
Author

I updated the PR to have wider date range input

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

@github-actionsgithub-actions[bot]github-actions[bot] left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Projects
Status: Needs review
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@dchen2438@ksunden@jklymak@dstansby@oscargus

[8]ページ先頭

©2009-2025 Movatter.jp