Skip to content

settable LineStack.separation#990

Open
kushalkolar wants to merge 2 commits intomainfrom
line-stack-sep-setter
Open

settable LineStack.separation#990
kushalkolar wants to merge 2 commits intomainfrom
line-stack-sep-setter

Conversation

@kushalkolar
Copy link
Member

@kushalkolar kushalkolar commented Feb 4, 2026

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

@kushalkolar kushalkolar requested a review from clewis7 as a code owner February 4, 2026 23:50
@github-actions
Copy link

github-actions bot commented Feb 5, 2026

📚 Docs preview built and uploaded! https://www.fastplotlib.org/ver/line-stack-sep-setter

@kushalkolar
Copy link
Member Author

@clewis7 gtg, I don't need to change the examples they explicitly set the separation already :D

metadatas: Sequence[Any] | np.ndarray = None,
isolated_buffer: bool = True,
separation: float = 10.0,
separation: float = 0.0,
Copy link
Member

Choose a reason for hiding this comment

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

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

Copy link
Member Author

Choose a reason for hiding this comment

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

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

So I was thinking 0 would be a good default, just plain stacking

Copy link
Member

Choose a reason for hiding this comment

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

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

change separation of an existing LineStack

2 participants