← 返回首页
settable `LineStack.separation` by kushalkolar · Pull Request #990 · fastplotlib/fastplotlib · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

settable LineStack.separation#990

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

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

Conversation

kushalkolar commented Feb 4, 2026
edited
Loading

Copy link
Copy Markdown
Member

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 requested a review from clewis7 as a code owner February 4, 2026 23:50

github-actions Bot commented Feb 5, 2026

Copy link
Copy Markdown

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

Copy link
Copy Markdown
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
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide 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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide 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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide 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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

0 means it is placed above the y-max of the previous line, so stacking with no extra spacing

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

Copy link
Copy Markdown
Member Author

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

change separation of an existing LineStack

2 participants

Footer

© 2026 GitHub, Inc.