Skip to content
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

Draft: Size for markers #4026

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions src/silx/gui/plot/backends/BackendBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ def addMarker(
text: str | None,
color: str,
symbol: str | None,
symbolsize: float,
linestyle: str,
linewidth: float,
constraint: Callable[[float, float], tuple[float, float]] | None,
Expand Down
3 changes: 2 additions & 1 deletion src/silx/gui/plot/backends/BackendMatplotlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,7 @@ def addMarker(
text,
color,
symbol,
symbolsize: float,
linestyle,
linewidth,
constraint,
Expand All @@ -965,7 +966,7 @@ def addMarker(
marker = self._getMarkerFromSymbol(symbol)
if x is not None and y is not None:
line = ax.plot(
x, y, linestyle=" ", color=color, marker=marker, markersize=10.0
x, y, linestyle=" ", color=color, marker=marker, markersize=symbolsize
)[-1]

if text is not None:
Expand Down
6 changes: 5 additions & 1 deletion src/silx/gui/plot/backends/BackendOpenGL.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def __init__(
text,
color,
symbol,
symbolsize,
linewidth,
dashpattern,
constraint,
Expand All @@ -124,6 +125,7 @@ def __init__(
"color": colors.rgba(color),
"constraint": constraint if isConstraint else None,
"symbol": symbol,
"symbolsize": symbolsize,
"linewidth": linewidth,
"dashpattern": dashpattern,
"yaxis": yaxis,
Expand Down Expand Up @@ -714,7 +716,7 @@ def _renderItems(self, overlay=False):
(pixelPos[1],),
marker=item["symbol"],
color=color,
size=11,
size=item["symbolsize"],
)
context.matrix = self.matScreenProj
marker.render(context)
Expand Down Expand Up @@ -1120,6 +1122,7 @@ def addMarker(
text,
color,
symbol,
symbolsize: float,
linestyle,
linewidth,
constraint,
Expand All @@ -1135,6 +1138,7 @@ def addMarker(
text,
color,
symbol,
int(symbolsize + 0),
t20100 marked this conversation as resolved.
Show resolved Hide resolved
linewidth,
dashpattern,
constraint,
Expand Down
2 changes: 2 additions & 0 deletions src/silx/gui/plot/items/marker.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def __init__(self):

self._x = None
self._y = None
self._symbol_size = 10.0
self._bgColor: colors.RGBAColorType | None = None
self._constraint = self._defaultConstraint
self.__isBeingDragged = False
Expand All @@ -90,6 +91,7 @@ def _addRendererCall(self, backend, symbol=None, linestyle="-", linewidth=1):
text=self.getText(),
color=self.getColor(),
symbol=symbol,
symbolsize=self.getSymbolSize(),
linestyle=linestyle,
linewidth=linewidth,
constraint=self.getConstraint(),
Expand Down
Loading