Skip to content

Use math.log10 instead of math.log for logarithmic plots #986

@giordano

Description

@giordano

Project velocity can use logarithmic axis, which is quite useful for spreading out projects, but it uses math.log

df_consolidated["log_num_commits"] = df_consolidated["Commit"].apply(lambda x: math.log(x) if x != 0 else 0)
df_consolidated["log_num_contrib"] = df_consolidated["num_unique_contributors"].apply(
lambda x: math.log(x) if x != 0 else 0
)
df_consolidated["log_prs_issues_actions_weighted"] = df_consolidated["prs_issues_actions_weighted"].apply(math.log)
However I think that for humans it's easier to reason in terms of decades than it is of...powers of the Euler constant. If I a repo has a number of log10(commit) between 3 and 4 I can immediately tell "oh, that repo has ~thousands of commits", if it's between 1 and 2 I can easily guess "that one instead has only a few dozens", etc...while I have much more difficulties making the same quick guesses with the natural logarithm. A variation is to plot in log10 scale but use the linear values on the axes ticks: 1, 10, 100, 1000, etc..., which makes things even easier to read.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersstaleItems that dont have an owner and may need to be closed or re-assigned to be completed

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions