Skip to content

fix: address PR feedback to improve Matplotlib side-by-side display#4

Open
Michal-Fularz wants to merge 3 commits intomasterfrom
display-image-matplotlib-7117131935577827918-13488927482085545876
Open

fix: address PR feedback to improve Matplotlib side-by-side display#4
Michal-Fularz wants to merge 3 commits intomasterfrom
display-image-matplotlib-7117131935577827918-13488927482085545876

Conversation

@Michal-Fularz
Copy link
Copy Markdown
Member

Applied code review feedback for the Matplotlib side-by-side view, setting figsize, removing ticks, and using tight_layout.


PR created automatically by Jules for task 13488927482085545876 started by @Michal-Fularz

Updates the plotting in `ex_2` of `ipc_s01e01.py` according to code review:
- Set explicit `figsize` for better layout readability.
- Removed axis ticks using `plt.xticks([]), plt.yticks([])` to focus entirely on the image content.
- Added `plt.tight_layout()` to ensure titles don't overlap.

Co-authored-by: Michal-Fularz <3768498+Michal-Fularz@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the image processing script to correctly display images in Matplotlib by converting from BGR to RGB and providing a side-by-side comparison. The review feedback recommends using plt.axis('off') instead of chaining xticks and yticks calls for better adherence to PEP 8 and idiomatic Matplotlib usage.

plt.subplot(1, 2, 1)
plt.imshow(img_color)
plt.title('BGR (Incorrect)')
plt.xticks([]), plt.yticks([])
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Chaining multiple function calls on a single line using a comma is non-idiomatic in Python and violates PEP 8's recommendation against multiple statements on the same line. For image visualization in Matplotlib, it is more idiomatic to use plt.axis('off') to hide both the axes and the ticks.

Suggested change
plt.xticks([]), plt.yticks([])
plt.axis('off')
References
  1. PEP 8 discourages multiple statements on the same line. Chaining calls with commas creates an implicit tuple and is considered poor style. (link)

plt.subplot(1, 2, 2)
plt.imshow(img_rgb)
plt.title('RGB (Correct)')
plt.xticks([]), plt.yticks([])
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

As with the previous subplot, consider using plt.axis('off') instead of chaining xticks and yticks calls. This adheres to PEP 8 and follows standard Matplotlib practices for displaying images.

Suggested change
plt.xticks([]), plt.yticks([])
plt.axis('off')
References
  1. PEP 8 discourages multiple statements on the same line. (link)

google-labs-jules bot and others added 2 commits April 15, 2026 20:24
Updates the plotting in `ex_2` of `ipc_s01e01.py` according to code review:
- Set explicit `figsize` for better layout readability.
- Removed axis ticks using `plt.xticks([]), plt.yticks([])` to focus entirely on the image content.
- Added `plt.tight_layout()` to ensure titles don't overlap.

Co-authored-by: Michal-Fularz <3768498+Michal-Fularz@users.noreply.github.com>
Updates the plotting in `ex_2` of `ipc_s01e01.py` according to code review:
- Set explicit `figsize` for better layout readability.
- Removed axis ticks using `plt.xticks([]), plt.yticks([])` to focus entirely on the image content.
- Added `plt.tight_layout()` to ensure titles don't overlap.

Co-authored-by: Michal-Fularz <3768498+Michal-Fularz@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant