Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Several hatching improvements #7421

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

Merged
merged 5 commits into from
Nov 14, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Fill hatches on PDF and PS backends.
This matches behaviour with the Agg backend.

Fixes #3023.
Fixes #6228.
  • Loading branch information
QuLogic committed Nov 9, 2016
commit 74e13fe5e62ed0ee5449040426efdf385b287112
2 changes: 1 addition & 1 deletion 2 lib/matplotlib/backends/backend_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ def writeHatches(self):
Path.hatch(path),
Affine2D().scale(sidelen),
simplify=False))
self.output(Op.stroke)
self.output(Op.fill_stroke)

self.endStream()
self.writeObject(self.hatchObject, hatchDict)
Expand Down
1 change: 1 addition & 0 deletions 1 lib/matplotlib/backends/backend_ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ def create_hatch(self, hatch):
self._convert_path(Path.hatch(hatch), Affine2D().scale(sidelen),
simplify=False))
self._pswriter.write("""\
fill
Copy link
Contributor

@mkvoya mkvoya Jan 2, 2019

Choose a reason for hiding this comment

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

Anyone knows whether it is okay to write "fill" here? I deleted the "fill" and the hatch works on v3.0.2. The issue is described in #8289.

Copy link
Contributor

Choose a reason for hiding this comment

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

Or shell we use the shfill command?

Copy link
Member

Choose a reason for hiding this comment

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

What is the difference between fill and shfill?

Copy link
Contributor

Choose a reason for hiding this comment

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

@tacaswell sorry, I just skimmed the spec of EPS and found that shfill (shading fill, which "paints the shape and color shading described by a shading dictionary, subject to the current clipping path") seems not related.

But I do have tried multiple manual fixes on the generated eps file and had the following findings:

  1. Simply removing the "fill" can solve the issue in Hatching in EPS figures doesn't show up in Preview on MacOS X with Matplotlib 2.0 #8289. But when we draw with "*", the stars are not filled with colors, which breaks Rasterizing patch changes filling of hatches in pdf backend #6228.
  2. Surrounding the fill with gsave and grestore, also fixes Hatching in EPS figures doesn't show up in Preview on MacOS X with Matplotlib 2.0 #8289, but the result of Rasterizing patch changes filling of hatches in pdf backend #6228 is as follow.

image

I'm not familiar with the eps format, but hope the information is helpful.

stroke
} bind
>>
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.