Skip to content

Basic axes #551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 114 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
142e67d
add colorbar to hlut tool
kushalkolar Jul 10, 2024
67b2b75
pause_events contextmanager
kushalkolar Jul 10, 2024
323c57c
cleanup
kushalkolar Jul 10, 2024
7c5e294
very basic stuff works
kushalkolar Jul 11, 2024
6e05129
perspective projection implementation
kushalkolar Jul 18, 2024
0717560
Graphic.add_axes, refactor grids into an object instead of dict
kushalkolar Jul 18, 2024
e94fedb
update example
kushalkolar Jul 18, 2024
403b70c
docstrings
kushalkolar Jul 18, 2024
2118477
Merge branch 'hlut-cbar' into axes
kushalkolar Jul 21, 2024
cc427a0
type annotations
kushalkolar Jul 24, 2024
f780fa8
fixes for gridplots
kushalkolar Jul 24, 2024
5047e9f
bbox account for camera state
kushalkolar Jul 24, 2024
e48f618
change method name
kushalkolar Jul 24, 2024
3ad7575
Ruler tick text mapping
kushalkolar Jul 24, 2024
88201b0
update docs
kushalkolar Jul 24, 2024
f54558a
docstring
kushalkolar Jul 24, 2024
618d0de
update docs
kushalkolar Jul 24, 2024
03225bb
set axes using scence bbox in Figure.show() for WgpuManualOffscreenCa…
kushalkolar Jul 24, 2024
44d1e3f
update year
kushalkolar Jul 24, 2024
8f10948
docs
kushalkolar Jul 24, 2024
6c16b61
update examples
kushalkolar Jul 24, 2024
6a266e0
PlotArea has background
kushalkolar Jul 24, 2024
a1d76f6
fix linear selector for images
kushalkolar Jul 24, 2024
8a26cd8
linear selector examples with axes stuff
kushalkolar Jul 24, 2024
617e234
comments
kushalkolar Jul 24, 2024
56400b5
change title
kushalkolar Jul 24, 2024
dd93a0b
docs conf.py
kushalkolar Jul 24, 2024
bc5b112
api docs
kushalkolar Jul 24, 2024
68c73df
remove pause_events from graphics.__all__
kushalkolar Jul 24, 2024
dbfa2da
remove gpu.rst
kushalkolar Jul 24, 2024
d6c69cd
accidentally removed gpu guide from docs
kushalkolar Jul 25, 2024
f672ea8
smaller heatmap
kushalkolar Jul 25, 2024
51507aa
smaller heatmap
kushalkolar Jul 25, 2024
748caef
fix gc
kushalkolar Jul 25, 2024
35e330d
hlut fixes
kushalkolar Jul 25, 2024
1bb0688
update example nbs
kushalkolar Jul 25, 2024
1d06646
add new nb tests screenshots
kushalkolar Jul 25, 2024
c6d0ce4
add desktop test screenshots
kushalkolar Jul 25, 2024
50296f9
better stuff
kushalkolar Jul 25, 2024
f586257
fix Subplot.get_rect()
kushalkolar Jul 25, 2024
895e632
Figure.show() works well for tests and docs gallery
kushalkolar Jul 25, 2024
3854f94
fix axes
kushalkolar Jul 25, 2024
1786135
update examples
kushalkolar Jul 25, 2024
35a2cbb
fix axes when non auto grid
kushalkolar Jul 25, 2024
0bbd067
desktop screenshots
kushalkolar Jul 25, 2024
b02bdaf
add selector tools test screenshot
kushalkolar Jul 25, 2024
ee61f0c
update nb test and screenshots
kushalkolar Jul 25, 2024
30d3f85
update doc
kushalkolar Jul 25, 2024
ada0dbe
black
kushalkolar Jul 25, 2024
40eb0ba
very basic stuff works
kushalkolar Jul 11, 2024
0973756
perspective projection implementation
kushalkolar Jul 18, 2024
f037ea4
Graphic.add_axes, refactor grids into an object instead of dict
kushalkolar Jul 18, 2024
2b8f1ad
update example
kushalkolar Jul 18, 2024
546c3e0
docstrings
kushalkolar Jul 18, 2024
19b6dac
add colorbar to hlut tool
kushalkolar Jul 10, 2024
08bedd3
pause_events contextmanager
kushalkolar Jul 10, 2024
5609dc6
cleanup
kushalkolar Jul 10, 2024
023c4d3
type annotations
kushalkolar Jul 24, 2024
6c03285
fixes for gridplots
kushalkolar Jul 24, 2024
3dbfc81
bbox account for camera state
kushalkolar Jul 24, 2024
4b75ea2
change method name
kushalkolar Jul 24, 2024
ca86733
Ruler tick text mapping
kushalkolar Jul 24, 2024
2d0d80a
update docs
kushalkolar Jul 24, 2024
d20e51b
docstring
kushalkolar Jul 24, 2024
8202748
update docs
kushalkolar Jul 24, 2024
f53deeb
set axes using scence bbox in Figure.show() for WgpuManualOffscreenCa…
kushalkolar Jul 24, 2024
5a2d4e4
update year
kushalkolar Jul 24, 2024
9795cea
docs
kushalkolar Jul 24, 2024
d0a2f29
update examples
kushalkolar Jul 24, 2024
9f272e0
PlotArea has background
kushalkolar Jul 24, 2024
7affc2c
fix linear selector for images
kushalkolar Jul 24, 2024
16e5e28
linear selector examples with axes stuff
kushalkolar Jul 24, 2024
984042a
comments
kushalkolar Jul 24, 2024
a90fbf7
change title
kushalkolar Jul 24, 2024
11281d5
docs conf.py
kushalkolar Jul 24, 2024
dd3bf5b
api docs
kushalkolar Jul 24, 2024
44d3f14
remove pause_events from graphics.__all__
kushalkolar Jul 24, 2024
8c7351a
remove gpu.rst
kushalkolar Jul 24, 2024
14397a7
accidentally removed gpu guide from docs
kushalkolar Jul 25, 2024
0792526
smaller heatmap
kushalkolar Jul 25, 2024
50b72e9
smaller heatmap
kushalkolar Jul 25, 2024
88d55a1
fix gc
kushalkolar Jul 25, 2024
2d262db
hlut fixes
kushalkolar Jul 25, 2024
a7e4814
update example nbs
kushalkolar Jul 25, 2024
ed9d3b8
add new nb tests screenshots
kushalkolar Jul 25, 2024
a5370ac
add desktop test screenshots
kushalkolar Jul 25, 2024
51f3a2d
better stuff
kushalkolar Jul 25, 2024
d01ced1
fix Subplot.get_rect()
kushalkolar Jul 25, 2024
8ba041e
Figure.show() works well for tests and docs gallery
kushalkolar Jul 25, 2024
e4e437c
fix axes
kushalkolar Jul 25, 2024
f559e7f
update examples
kushalkolar Jul 25, 2024
8cb6d24
fix axes when non auto grid
kushalkolar Jul 25, 2024
6cd0a58
desktop screenshots
kushalkolar Jul 25, 2024
640812c
add selector tools test screenshot
kushalkolar Jul 25, 2024
5b62038
update nb test and screenshots
kushalkolar Jul 25, 2024
722eb68
update doc
kushalkolar Jul 25, 2024
5bbdec3
black
kushalkolar Jul 25, 2024
a198686
add fastplotlib to intersphinx for examples links
kushalkolar Jul 26, 2024
266e03a
don't test linear selector example because github action is being weird
kushalkolar Jul 26, 2024
c845d33
merge conflict
kushalkolar Jul 26, 2024
4df9197
set timeout of 10 mins for CI actions
kushalkolar Jul 26, 2024
53c5229
remove selectors from testutils
kushalkolar Jul 26, 2024
abe5b91
try something
kushalkolar Jul 26, 2024
221463e
try anotehr thing
kushalkolar Jul 26, 2024
c36c112
add back axes update using camera
kushalkolar Jul 26, 2024
ccb3839
try yet another thing
kushalkolar Jul 26, 2024
0ff8982
axes.update_using_camera in Figure.show() is fine, but is viewport.re…
kushalkolar Jul 26, 2024
a7b208b
see if we can move the render call to test_examples.py
kushalkolar Jul 26, 2024
52a7ade
wrong attr
kushalkolar Jul 26, 2024
c0d0db6
should work on rtd and CI test examples screenshots
kushalkolar Jul 26, 2024
44d6055
fix keyerror
kushalkolar Jul 26, 2024
1679c35
diffs are a bit larger now because of axes, increase tolerance and re…
kushalkolar Jul 26, 2024
2056ca3
update tolerances for nb test
kushalkolar Jul 26, 2024
fbac8ef
forgot to update some test screenshots
kushalkolar Jul 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
docs-build:
name: Docs
runs-on: bigmem
timeout-minutes: 10
if: ${{ !github.event.pull_request.draft }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -49,6 +50,7 @@ jobs:
test-build-full:
name: Test Linux, notebook + glfw
runs-on: bigmem
timeout-minutes: 10
if: ${{ !github.event.pull_request.draft }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -105,6 +107,7 @@ jobs:
test-build-desktop:
name: Test Linux, only glfw
runs-on: bigmem
timeout-minutes: 10
if: ${{ !github.event.pull_request.draft }}
strategy:
fail-fast: false
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/screenshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
screenshots:
name: Regenerate
runs-on: bigmem
timeout-minutes: 10
if: ${{ !github.event.pull_request.draft }}
steps:
- name: Install git-lfs
Expand Down
14 changes: 14 additions & 0 deletions docs/source/api/fastplotlib.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
fastplotlib
***********

.. currentmodule:: fastplotlib

.. autofunction:: fastplotlib.pause_events

.. autofunction:: fastplotlib.enumerate_adapters

.. autofunction:: fastplotlib.select_adapter

.. autofunction:: fastplotlib.print_wgpu_report

.. autofunction:: fastplotlib.run
6 changes: 0 additions & 6 deletions docs/source/api/gpu.rst

This file was deleted.

2 changes: 2 additions & 0 deletions docs/source/api/graphics/ImageGraphic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Properties
.. autosummary::
:toctree: ImageGraphic_api

ImageGraphic.axes
ImageGraphic.block_events
ImageGraphic.cmap
ImageGraphic.cmap_interpolation
Expand All @@ -41,6 +42,7 @@ Methods
.. autosummary::
:toctree: ImageGraphic_api

ImageGraphic.add_axes
ImageGraphic.add_event_handler
ImageGraphic.add_linear_region_selector
ImageGraphic.add_linear_selector
Expand Down
2 changes: 2 additions & 0 deletions docs/source/api/graphics/LineCollection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Properties
.. autosummary::
:toctree: LineCollection_api

LineCollection.axes
LineCollection.block_events
LineCollection.cmap
LineCollection.colors
Expand All @@ -45,6 +46,7 @@ Methods
.. autosummary::
:toctree: LineCollection_api

LineCollection.add_axes
LineCollection.add_event_handler
LineCollection.add_graphic
LineCollection.add_linear_region_selector
Expand Down
2 changes: 2 additions & 0 deletions docs/source/api/graphics/LineGraphic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Properties
.. autosummary::
:toctree: LineGraphic_api

LineGraphic.axes
LineGraphic.block_events
LineGraphic.cmap
LineGraphic.colors
Expand All @@ -39,6 +40,7 @@ Methods
.. autosummary::
:toctree: LineGraphic_api

LineGraphic.add_axes
LineGraphic.add_event_handler
LineGraphic.add_linear_region_selector
LineGraphic.add_linear_selector
Expand Down
2 changes: 2 additions & 0 deletions docs/source/api/graphics/LineStack.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Properties
.. autosummary::
:toctree: LineStack_api

LineStack.axes
LineStack.block_events
LineStack.cmap
LineStack.colors
Expand All @@ -45,6 +46,7 @@ Methods
.. autosummary::
:toctree: LineStack_api

LineStack.add_axes
LineStack.add_event_handler
LineStack.add_graphic
LineStack.add_linear_region_selector
Expand Down
2 changes: 2 additions & 0 deletions docs/source/api/graphics/ScatterGraphic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Properties
.. autosummary::
:toctree: ScatterGraphic_api

ScatterGraphic.axes
ScatterGraphic.block_events
ScatterGraphic.cmap
ScatterGraphic.colors
Expand All @@ -39,6 +40,7 @@ Methods
.. autosummary::
:toctree: ScatterGraphic_api

ScatterGraphic.add_axes
ScatterGraphic.add_event_handler
ScatterGraphic.clear_event_handlers
ScatterGraphic.remove_event_handler
Expand Down
2 changes: 2 additions & 0 deletions docs/source/api/graphics/TextGraphic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Properties
.. autosummary::
:toctree: TextGraphic_api

TextGraphic.axes
TextGraphic.block_events
TextGraphic.deleted
TextGraphic.event_handlers
Expand All @@ -40,6 +41,7 @@ Methods
.. autosummary::
:toctree: TextGraphic_api

TextGraphic.add_axes
TextGraphic.add_event_handler
TextGraphic.clear_event_handlers
TextGraphic.remove_event_handler
Expand Down
4 changes: 2 additions & 2 deletions docs/source/api/layouts/subplot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Properties
.. autosummary::
:toctree: Subplot_api

Subplot.axes
Subplot.background_color
Subplot.camera
Subplot.canvas
Subplot.controller
Expand Down Expand Up @@ -60,8 +62,6 @@ Methods
Subplot.remove_animation
Subplot.remove_graphic
Subplot.render
Subplot.set_axes_visibility
Subplot.set_grid_visibility
Subplot.set_title
Subplot.set_viewport_rect

2 changes: 2 additions & 0 deletions docs/source/api/selectors/LinearRegionSelector.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Properties
.. autosummary::
:toctree: LinearRegionSelector_api

LinearRegionSelector.axes
LinearRegionSelector.axis
LinearRegionSelector.block_events
LinearRegionSelector.deleted
Expand All @@ -39,6 +40,7 @@ Methods
.. autosummary::
:toctree: LinearRegionSelector_api

LinearRegionSelector.add_axes
LinearRegionSelector.add_event_handler
LinearRegionSelector.add_ipywidget_handler
LinearRegionSelector.clear_event_handlers
Expand Down
2 changes: 2 additions & 0 deletions docs/source/api/selectors/LinearSelector.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Properties
.. autosummary::
:toctree: LinearSelector_api

LinearSelector.axes
LinearSelector.axis
LinearSelector.block_events
LinearSelector.deleted
Expand All @@ -39,6 +40,7 @@ Methods
.. autosummary::
:toctree: LinearSelector_api

LinearSelector.add_axes
LinearSelector.add_event_handler
LinearSelector.add_ipywidget_handler
LinearSelector.clear_event_handlers
Expand Down
6 changes: 4 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = "fastplotlib"
copyright = "2023, Kushal Kolar, Caitlin Lewis"
copyright = "2024, Kushal Kolar, Caitlin Lewis"
author = "Kushal Kolar, Caitlin Lewis"
release = fastplotlib.__version__

Expand Down Expand Up @@ -57,7 +57,8 @@
"../../examples/desktop/line_collection",
"../../examples/desktop/scatter",
"../../examples/desktop/heatmap",
"../../examples/desktop/misc"
"../../examples/desktop/misc",
"../../examples/desktop/selectors",
]
),
"ignore_pattern": r'__init__\.py',
Expand Down Expand Up @@ -102,6 +103,7 @@
"numpy": ("https://numpy.org/doc/stable/", None),
"pygfx": ("https://pygfx.com/stable", None),
"wgpu": ("https://wgpu-py.readthedocs.io/en/latest", None),
"fastplotlib": ("https://fastplotlib.readthedocs.io/en/latest/", None),
}

html_theme_options = {
Expand Down
4 changes: 2 additions & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ Welcome to fastplotlib's documentation!
.. toctree::
:maxdepth: 1
:caption: API


fastplotlib <api/fastplotlib>
Figure <api/layouts/figure>
Subplot <api/layouts/subplot>
Graphics <api/graphics/index>
Graphic Features <api/graphic_features/index>
Selectors <api/selectors/index>
Widgets <api/widgets/index>
Utils <api/utils>
GPU <api/gpu>

.. toctree::
:caption: Gallery
Expand Down
6 changes: 1 addition & 5 deletions examples/desktop/gridplot/gridplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import fastplotlib as fpl
import imageio.v3 as iio

figure = fpl.Figure(shape=(2, 2))
figure = fpl.Figure(shape=(2, 2), size=(700, 560))

im = iio.imread("imageio:clock.png")
im2 = iio.imread("imageio:astronaut.png")
Expand All @@ -25,10 +25,6 @@

figure.show()

figure.canvas.set_logical_size(700, 560)

for subplot in figure:
subplot.auto_scale()

# NOTE: `if __name__ == "__main__"` is NOT how to use fastplotlib interactively
# please see our docs for using fastplotlib interactively in ipython and jupyter
Expand Down
6 changes: 1 addition & 5 deletions examples/desktop/gridplot/gridplot_non_square.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import fastplotlib as fpl
import imageio.v3 as iio

figure = fpl.Figure(shape=(2, 2), controller_ids="sync")
figure = fpl.Figure(shape=(2, 2), size=(700, 560))

im = iio.imread("imageio:clock.png")
im2 = iio.imread("imageio:astronaut.png")
Expand All @@ -23,10 +23,6 @@

figure.show()

figure.canvas.set_logical_size(700, 560)

for subplot in figure:
subplot.auto_scale()

# NOTE: `if __name__ == "__main__"` is NOT how to use fastplotlib interactively
# please see our docs for using fastplotlib interactively in ipython and jupyter
Expand Down
8 changes: 5 additions & 3 deletions examples/desktop/gridplot/multigraphic_gridplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
from itertools import product

# define figure
figure = fpl.Figure(shape=(2, 2), names=[["image-overlay", "circles"], ["line-stack", "scatter"]])
figure = fpl.Figure(
shape=(2, 2),
names=[["image-overlay", "circles"], ["line-stack", "scatter"]],
size=(700, 560)
)

img = iio.imread("imageio:coffee.png")

Expand Down Expand Up @@ -106,8 +110,6 @@ def make_circle(center, radius: float, n_points: int = 75) -> np.ndarray:

figure.show()

figure.canvas.set_logical_size(700, 560)

# NOTE: `if __name__ == "__main__"` is NOT how to use fastplotlib interactively
# please see our docs for using fastplotlib interactively in ipython and jupyter
if __name__ == "__main__":
Expand Down
10 changes: 4 additions & 6 deletions examples/desktop/heatmap/heatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,20 @@
import fastplotlib as fpl
import numpy as np

figure = fpl.Figure()
figure = fpl.Figure(size=(700, 560))

xs = np.linspace(0, 1_000, 10_000, dtype=np.float32)
xs = np.linspace(0, 1_000, 9_000, dtype=np.float32)

sine = np.sin(np.sqrt(xs))

data = np.vstack([sine * i for i in range(20_000)])
data = np.vstack([sine * i for i in range(15_000)])

# plot the image data
img = figure[0, 0].add_image(data=data, name="heatmap")
del data

figure.show()

figure.canvas.set_logical_size(700, 560)

figure[0, 0].auto_scale()

# NOTE: `if __name__ == "__main__"` is NOT how to use fastplotlib interactively
# please see our docs for using fastplotlib interactively in ipython and jupyter
Expand Down
6 changes: 1 addition & 5 deletions examples/desktop/heatmap/heatmap_cmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import fastplotlib as fpl
import numpy as np

figure = fpl.Figure()
figure = fpl.Figure(size=(700, 560))

xs = np.linspace(0, 1_000, 10_000, dtype=np.float32)

Expand All @@ -24,10 +24,6 @@

figure.show()

figure.canvas.set_logical_size(700, 560)

figure[0, 0].auto_scale()

img.cmap = "viridis"

# NOTE: `if __name__ == "__main__"` is NOT how to use fastplotlib interactively
Expand Down
5 changes: 1 addition & 4 deletions examples/desktop/heatmap/heatmap_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import fastplotlib as fpl
import numpy as np

figure = fpl.Figure()
figure = fpl.Figure(size=(700, 560))

xs = np.linspace(0, 1_000, 9_000, dtype=np.float32)

Expand All @@ -23,9 +23,6 @@

figure.show()

figure.canvas.set_logical_size(700, 560)

figure[0, 0].auto_scale()
cosine = np.cos(np.sqrt(xs)[:3000])

# change first 2,000 rows and 3,000 columns
Expand Down
5 changes: 1 addition & 4 deletions examples/desktop/heatmap/heatmap_square.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import numpy as np


figure = fpl.Figure()
figure = fpl.Figure(size=(700, 560))

xs = np.linspace(0, 1_000, 20_000, dtype=np.float32)

Expand All @@ -25,9 +25,6 @@
del data # data no longer needed after given to graphic
figure.show()

figure.canvas.set_logical_size(1500, 1500)

figure[0, 0].auto_scale()

if __name__ == "__main__":
print(__doc__)
Expand Down
Loading
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy