add logarithmic axes support, with tests. Supports positive Y-values only. (#141)

Co-authored-by: Ton Wessling <twessling@ebay.com>
This commit is contained in:
twessling-icas 2023-05-22 22:37:57 +07:00 committed by GitHub
parent c1468e8ae4
commit 1ccfbb0172
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 195 additions and 1 deletions

View file

@ -103,3 +103,8 @@ func KValueFormatter(k float64, vf ValueFormatter) ValueFormatter {
return fmt.Sprintf("%0.0fσ %s", k, vf(v))
}
}
// FloatValueFormatter is a ValueFormatter for float64, exponential notation, e.g. 1.52e+08.
func ExponentialValueFormatter(v interface{}) string {
return FloatValueFormatterWithFormat(v, "%.2e")
}