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_mat
FunctionChanges:
New Parameter
draw_arrows
: Introduced an optional boolean parameterdraw_arrows
to theplot2D_samples_mat
function. 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.
![image](https://private-user-images.githubusercontent.com/23178294/263402914-ae71577b-6d88-40d2-a337-c0deac7f0d8c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2OTI3MDYsIm5iZiI6MTczOTY5MjQwNiwicGF0aCI6Ii8yMzE3ODI5NC8yNjM0MDI5MTQtYWU3MTU3N2ItNmQ4OC00MGQyLWEzMzctYzBkZWFjN2YwZDhjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE2VDA3NTMyNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVkNzllNjA4NzAxNjYyOTI4OTQ3MWFlNGVmZDhlYjgxZWJiNTZiZTlmNWU5Y2FkYmNiNDczYjM3OWQwNmU0ZjImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.qCLNi27qJxN7LduSuFPGhSxjQG6VV940js6EDsUqf0c)
![image](https://private-user-images.githubusercontent.com/23178294/263402935-4dedb587-b975-4ef1-8af6-e8443dc2dd2c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2OTI3MDYsIm5iZiI6MTczOTY5MjQwNiwicGF0aCI6Ii8yMzE3ODI5NC8yNjM0MDI5MzUtNGRlZGI1ODctYjk3NS00ZWYxLThhZjYtZTg0NDNkYzJkZDJjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE2VDA3NTMyNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTMyZWJmNDVlZjZjMjFmNjQwMTkxNDZmOWU5MDdjZWUwYWZjMmIzZTFkNWU0ODBiMWYxZjFjYzEwMDlmYzRlOTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.vaURqijqwfDbSFKalp8pa5bMSW7eWG2mwh3FGx3a06Q)
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.annotate
method 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