Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* @kushalkolar
* @clewis7
6 changes: 1 addition & 5 deletions examples/desktop/scatter/scatter_cmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@


scatter_graphic = plot.add_scatter(
data=data[:, :-1],
sizes=15,
alpha=0.7,
cmap="Set1",
cmap_values=agg.labels_
data=data[:, :-1], sizes=15, alpha=0.7, cmap="Set1", cmap_values=agg.labels_
)

plot.show()
Expand Down
2 changes: 1 addition & 1 deletion examples/desktop/scatter/scatter_dataslice.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
scatter_graphic.data[2] = np.array([[5.2, 2.7, 1.7]])

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


if __name__ == "__main__":
Expand Down
21 changes: 8 additions & 13 deletions examples/desktop/scatter/scatter_size.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,23 @@
grid_shape = (2, 1)

# you can give string names for each subplot within the gridplot
names = [
["scalar_size"],
["array_size"]
]
names = [["scalar_size"], ["array_size"]]

# Create the grid plot
plot = fpl.GridPlot(
shape=grid_shape,
names=names,
size=(1000, 1000)
)
plot = fpl.GridPlot(shape=grid_shape, names=names, size=(1000, 1000))

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

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

plot["scalar_size"].add_scatter(data=data, sizes=5, colors="blue") # add a set of scalar sizes
plot["scalar_size"].add_scatter(
data=data, sizes=5, colors="blue"
) # add a set of scalar sizes

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

for graph in plot:
Expand Down
4 changes: 2 additions & 2 deletions examples/desktop/screenshots/scatter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions examples/desktop/screenshots/scatter_cmap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions examples/desktop/screenshots/scatter_colorslice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions examples/desktop/screenshots/scatter_dataslice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions examples/desktop/screenshots/scatter_present.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions examples/desktop/screenshots/scatter_size.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion fastplotlib/graphics/scatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def __init__(
pygfx.Geometry(
positions=self.data(), sizes=self.sizes(), colors=self.colors()
),
material=pygfx.PointsMaterial(color_mode="vertex", vertex_sizes=True),
material=pygfx.PointsMaterial(color_mode="vertex", size_mode="vertex"),
)

self._set_world_object(world_object)
Expand Down