Open
Conversation
## Added Arrow Annotation Feature to `plot2D_samples_mat` Function ### Changes: 1. **New Parameter `draw_arrows`**: Introduced an optional boolean parameter `draw_arrows` to the `plot2D_samples_mat` function. When set to `True`, this parameter allows users to plot arrows in the middle of the lines connecting source and target samples. This helps to visually identify the direction from source to target. 2. **Arrow Placement**: The arrows are strategically placed at the midpoint of the lines for clear visualization. 3. **Arrow Properties**: The color and alpha (transparency) of the arrows match the lines they are associated with, ensuring visual consistency. ### Motivation: The addition of the arrow annotation feature enhances the visual representation of the connections between source and target samples. Especially in cases where directionality matters, these arrows provide a clearer understanding of the flow from source to target. ### Code: The main code changes involve: - Calculating the midpoint of the line segments. - Using the `plt.annotate` method to draw an arrow at the calculated midpoint. ### Example Usage: ```python plot2D_samples_mat(xs, xt, G, draw_arrows=True) ```
Collaborator
|
Hello @kiasar thanks for the contribution, the test are failing at the moment, I will do a code reviews as soon as possible when they as they pas. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added Arrow Annotation Feature to
plot2D_samples_matFunctionChanges:
New Parameter
draw_arrows: Introduced an optional boolean parameterdraw_arrowsto theplot2D_samples_matfunction. When set toTrue, this parameter allows users to plot arrows in the middle of the lines connecting source and target samples. This helps to visually identify the direction from source to target.Arrow Placement: The arrows are strategically placed at the midpoint of the lines for clear visualization.
Arrow Properties: The color and alpha (transparency) of the arrows match the lines they are associated with, ensuring visual consistency.
As a visual example, this update allows the user to choose between these two types.


Motivation:
The addition of the arrow annotation feature enhances the visual representation of the connections between source and target samples. Especially in cases where directionality matters, these arrows provide a clearer understanding of the flow from source to target.
Code:
The main code changes involve:
plt.annotatemethod to draw an arrow at the calculated midpoint.Example Usage:
Types of changes
Motivation and context / Related issue
How has this been tested (if it applies)
PR checklist