Sorry, something went wrong.
|
📚 Docs preview built and uploaded! https://www.fastplotlib.org/ver/line-stack-sep-setter |
Sorry, something went wrong.
|
@clewis7 gtg, I don't need to change the examples they explicitly set the separation already :D |
Sorry, something went wrong.
| metadatas: Sequence[Any] | np.ndarray = None, | ||
| isolated_buffer: bool = True, | ||
| separation: float = 10.0, | ||
| separation: float = 0.0, |
There was a problem hiding this comment.
Default separation needs to be bigger than 0, otherwise it will just plot all of the user's lines on top of each other, which might be confusing/unexpected
If 10 is too big, just do 1.0 or something small
Sorry, something went wrong.
There was a problem hiding this comment.
0 stacks them with no gap between the ymax of the previous and ymin of the next. 1 can be too much when the yrange of the data is very small.
Sorry, something went wrong.
There was a problem hiding this comment.
So I was thinking 0 would be a good default, just plain stacking
Sorry, something went wrong.
There was a problem hiding this comment.
So all the lines are on top of each other? Why would someone not just use a LineCollection then?
Maybe the default should be a value based on the data. Similar to vmin/vmax, do a quick calc of the y range or x range depending on the separation axis and use that as the default.
Sorry, something went wrong.
There was a problem hiding this comment.
0 means it is placed above the y-max of the previous line, so stacking with no extra spacing
Sorry, something went wrong.
There was a problem hiding this comment.
Sorry, something went wrong.
|
I'm now thinking if we should just have LineStack functionality into LineCollection. Sometimes you see a stack and then you want to see them on top of each other for a few traces (easy peasy since we now have the VisibilitySelector). Maybe LineCollection.separation = None means no stacking, LineCollection.separation = 0.0 means stacking directly on top based on previous line's y-max. We keep LineStack as just a simple subclass for API stability since I think a lot of people are using that already. |
Sorry, something went wrong.
Useful to be able to set the separation. Also the default is now 0.0 since 10 is often way too large when y-values are small. Will probably have to update gallery examples, will do later.
closes #898