Skip to content

Add example: pixel grid overlay on image #30457

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Faazc
Copy link

@Faazc Faazc commented Aug 23, 2025

PR summary

This PR adds a new example script (pixel_grid.py) to demonstrate how to overlay a pixel-aligned grid on top of an image using Matplotlib.

-The example demonstrates how to overlay a pixel-aligned grid on an image, which is particularly helpful for visual localization in image analysis.

  • This is useful for educational purposes, visual inspection, or image analysis.
  • The script shows how to load an image (or synthetic data), display it, and add vertical/horizontal grid lines spaced at fixed intervals.
  • The example is simple, self-contained, and uses standard Matplotlib and NumPy functionality.

PR checklist

  • [N/A] "closes #0000" is in the body of the PR description to link the related issue
  • [N/A] new and changed code is tested
  • Plotting related features are demonstrated in an example
  • [N/A] New Features and API Changes are noted with a directive and release note
  • Documentation complies with general and docstring guidelines

@github-actions github-actions bot added the Documentation: examples files in galleries/examples label Aug 23, 2025
@timhoffm
Copy link
Member

Thanks for the PR. I believe looping over axvline/axhline is typically not the right apporach. If it is ok to limit the grid to the image area, using hlines()/vlines() is simpler. If you want a grid that spans the Axes, using grid() and appropriate ticks is simpler.

@Faazc
Copy link
Author

Faazc commented Aug 24, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy