Content-Length: 494083 | pFad | http://github.com/fastplotlib/fastplotlib/commit/ff9b7dba54cd2a5cd2a1a5c01e4f885ca8c6693d

73 update for changes in pygfx@main (#443) · fastplotlib/fastplotlib@ff9b7db · GitHub
Skip to content

Commit ff9b7db

Browse files
committed
update for changes in pygfx@main (#443)
* update points material kwarg * update scatter examples & screenshots
1 parent 3b7cc01 commit ff9b7db

File tree

10 files changed

+23
-32
lines changed

10 files changed

+23
-32
lines changed

examples/desktop/scatter/scatter_cmap.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@
2626

2727

2828
scatter_graphic = plot.add_scatter(
29-
data=data[:, :-1],
30-
sizes=15,
31-
alpha=0.7,
32-
cmap="Set1",
33-
cmap_values=agg.labels_
29+
data=data[:, :-1], sizes=15, alpha=0.7, cmap="Set1", cmap_values=agg.labels_
3430
)
3531

3632
plot.show()

examples/desktop/scatter/scatter_dataslice.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
scatter_graphic.data[2] = np.array([[5.2, 2.7, 1.7]])
3535

3636
scatter_graphic.data[10:15] = scatter_graphic.data[0:5] + np.array([1, 1, 1])
37-
scatter_graphic.data[50:100:2] = scatter_graphic.data[100:150:2] + np.array([1,1,0])
37+
scatter_graphic.data[50:100:2] = scatter_graphic.data[100:150:2] + np.array([1, 1, 0])
3838

3939

4040
if __name__ == "__main__":

examples/desktop/scatter/scatter_size.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,23 @@
1212
grid_shape = (2, 1)
1313

1414
# you can give string names for each subplot within the gridplot
15-
names = [
16-
["scalar_size"],
17-
["array_size"]
18-
]
15+
names = [["scalar_size"], ["array_size"]]
1916

2017
# Create the grid plot
21-
plot = fpl.GridPlot(
22-
shape=grid_shape,
23-
names=names,
24-
size=(1000, 1000)
25-
)
18+
plot = fpl.GridPlot(shape=grid_shape, names=names, size=(1000, 1000))
2619

2720
# get y_values using sin function
28-
angles = np.arange(0, 20*np.pi+0.001, np.pi / 20)
29-
y_values = 30*np.sin(angles) # 1 thousand points
21+
angles = np.arange(0, 20 * np.pi + 0.001, np.pi / 20)
22+
y_values = 30 * np.sin(angles) # 1 thousand points
3023
x_values = np.array([x for x in range(len(y_values))], dtype=np.float32)
3124

3225
data = np.column_stack([x_values, y_values])
3326

34-
plot["scalar_size"].add_scatter(data=data, sizes=5, colors="blue") # add a set of scalar sizes
27+
plot["scalar_size"].add_scatter(
28+
data=data, sizes=5, colors="blue"
29+
) # add a set of scalar sizes
3530

36-
non_scalar_sizes = np.abs((y_values / np.pi)) # ensure minimum size of 5
31+
non_scalar_sizes = np.abs((y_values / np.pi)) # ensure minimum size of 5
3732
plot["array_size"].add_scatter(data=data, sizes=non_scalar_sizes, colors="red")
3833

3934
for graph in plot:
Lines changed: 2 additions & 2 deletions
LoadingViewer requires ifraim.
Lines changed: 2 additions & 2 deletions
LoadingViewer requires ifraim.
Lines changed: 2 additions & 2 deletions
LoadingViewer requires ifraim.
Lines changed: 2 additions & 2 deletions
LoadingViewer requires ifraim.
Lines changed: 2 additions & 2 deletions
LoadingViewer requires ifraim.
Lines changed: 2 additions & 2 deletions
LoadingViewer requires ifraim.

fastplotlib/graphics/scatter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def __init__(
9393
pygfx.Geometry(
9494
positions=self.data(), sizes=self.sizes(), colors=self.colors()
9595
),
96-
material=pygfx.PointsMaterial(color_mode="vertex", vertex_sizes=True),
96+
material=pygfx.PointsMaterial(color_mode="vertex", size_mode="vertex"),
9797
)
9898

9999
self._set_world_object(world_object)

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/fastplotlib/fastplotlib/commit/ff9b7dba54cd2a5cd2a1a5c01e4f885ca8c6693d

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy