← 返回首页
Reference spaces by kushalkolar · Pull Request #809 · 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

Reference spaces#809

Draft
kushalkolar wants to merge 4 commits into
mainfrom
reference-space
Draft

Reference spaces#809
kushalkolar wants to merge 4 commits into
mainfrom
reference-space

Conversation

kushalkolar commented May 2, 2025
edited
Loading

Copy link
Copy Markdown
Member

Proof of concept for reference spaces, implements ideas from #772

I think I want to rename it to reference frame since that's what physicist and math people are used to, I wanted to avoid confusion with the Frame class which is something else completely but Frame is something a user would never touch so.

There are two sine waves here but the red one is 3 orders or magnitude larger. The magenta y-axis indicates the values for the red sine data which ranges from [-1000, 1000] and the white axis ticks are for the white sine line which ranges from [-1, 1]

rs-2025-05-01_23.37.11.mp4

By removing the camera from a reference space's controller we can also interactively independently rescale a given reference frame! Will need quite some work to do this properly, have methods to re-sync positions or other things between reference frames etc.

import numpy as np import fastplotlib as fpl xs = np.linspace(0, 10 * np.pi, 1000) ys = np.sin(xs) ys100 = ys * 1000 l1 = np.column_stack([xs, ys]) l2 = np.column_stack([xs, ys100]) fig = fpl.Figure(size=(500, 400)) fig[0, 0].add_line(l1) fig.show(maintain_aspect=False) fig[0, 0].auto_scale(zoom=0.4) rs = fig[0, 0].add_reference_space(scale=(1, 500, 1)) l2 = fig[0, 0].add_line(l2, reference_space=rs, colors="r") l2.add_axes(rs) l2.axes.y.line.material.color = "m" fpl.loop.run()

kushalkolar requested a review from clewis7 as a code owner May 2, 2025 03:33
kushalkolar marked this pull request as draft May 2, 2025 03:33
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.

1 participant

Footer

© 2026 GitHub, Inc.