Skip to content

Navigation Menu

Sign in
Appearance settings

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

Provide feedback

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

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fb8aedc

Browse filesBrowse files
authored
update for changes in pygfx@main (#443)
* update points material kwarg * update scatter examples & screenshots
1 parent 576ccbf commit fb8aedc
Copy full SHA for fb8aedc

File tree

Expand file treeCollapse file tree

10 files changed

+23
-32
lines changed
Filter options
Expand file treeCollapse file tree

10 files changed

+23
-32
lines changed

‎examples/desktop/scatter/scatter_cmap.py

Copy file name to clipboardExpand all lines: examples/desktop/scatter/scatter_cmap.py
+1-5Lines 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

Copy file name to clipboardExpand all lines: examples/desktop/scatter/scatter_dataslice.py
+1-1Lines 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

Copy file name to clipboardExpand all lines: examples/desktop/scatter/scatter_size.py
+8-13Lines 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:
+2-2Lines changed: 2 additions & 2 deletions
Loading
+2-2Lines changed: 2 additions & 2 deletions
Loading
+2-2Lines changed: 2 additions & 2 deletions
Loading
+2-2Lines changed: 2 additions & 2 deletions
Loading
+2-2Lines changed: 2 additions & 2 deletions
Loading
+2-2Lines changed: 2 additions & 2 deletions
Loading

‎fastplotlib/graphics/scatter.py

Copy file name to clipboardExpand all lines: fastplotlib/graphics/scatter.py
+1-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.