Updated plot to make use of data minimum for setting up plot Y axis#241
Open
sivamgr wants to merge 1 commit intogizak:masterfrom
Open
Updated plot to make use of data minimum for setting up plot Y axis#241sivamgr wants to merge 1 commit intogizak:masterfrom
sivamgr wants to merge 1 commit intogizak:masterfrom
Conversation
iamquang95
reviewed
Feb 21, 2020
|
|
||
| func GetMinFloat64From2dSlice(slices [][]float64) (float64, error) { | ||
| if len(slices) == 0 { | ||
| return 0, fmt.Errorf("cannot get max value from empty slice") |
There was a problem hiding this comment.
cannot get max value from empty slice -> cannot get min value from empty slice
iamquang95
reviewed
Feb 21, 2020
| minVal := self.MinVal | ||
| if maxVal == 0 { | ||
| maxVal, _ = GetMaxFloat64From2dSlice(self.Data) | ||
| minVal, _ = GetMinFloat64From2dSlice(self.Data) |
There was a problem hiding this comment.
So if maxVal == 0, the minVal will be re-calculated even user sets this value by purpose?
iamquang95
reviewed
Feb 21, 2020
| } | ||
|
|
||
| func (self *Plot) renderBraille(buf *Buffer, drawArea image.Rectangle, maxVal float64) { | ||
| func (self *Plot) renderBraille(buf *Buffer, drawArea image.Rectangle, minVal float64, maxVal float64) { |
There was a problem hiding this comment.
You missed implementation of this part
|
I did an update version of this pr here: #259 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Irrespective of data set range the Y axis always points to zero. Updated plots to make use of minimum value from data to set the Y axis start value