Skip to content
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

Black and white plotting option #7

Closed
kwinkunks opened this issue May 11, 2015 · 6 comments
Closed

Black and white plotting option #7

kwinkunks opened this issue May 11, 2015 · 6 comments
Milestone

Comments

@kwinkunks
Copy link
Member

It would be cool to have fills as well as or instead of colours.

Bonus: see #8

@kwinkunks kwinkunks modified the milestone: v1.0 Nov 9, 2015
@kwinkunks
Copy link
Member Author

From v1.0 scoping doc:

The use of arbitrary colour tables and some pattern templates. Examples of both will be included for each of the converted datasets. We will attempt to allow completely arbitrary pattern fill, but this requires the native production of SVG files, which we can do in principle via our g3.js library, but this may not be possible in the time available.

@kwinkunks
Copy link
Member Author

matplotlib hatches...

https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/hatch.py

Should be able to subclass to have

  • other shapes
  • random scattering (eg for sandstone)
  • dashed hatching

Eg see this example (not sure how great the code is...)

http://stackoverflow.com/questions/17285154/how-to-fill-a-polygon-with-a-custom-hatch-in-matplotlib

@LukasMosser
Copy link

Would it be possible to include the USGS geology hatches?
I've been looking on whether matplotlib supports hatches from bitmap or some pattern but could only find your above example with the polygon fill.

Here the link to USGS patterns:
http://pubs.usgs.gov/tm/2006/11A02/

@kwinkunks
Copy link
Member Author

Great suggestion. I think we can replicate a few of these with matplotlib's usual implementation for hatch fills, which uses paths to draw the elements of the hatch. I was going to work on this now, so I'll have some results shortly.

Mpl's paths are quite similar to the SVG and PS specifications, so it might be possible to use the instructions from the EPS files from USGS to replicate them that way, with a little manipulation in between. This would be preferable to doing it with bitmaps (and as you suggest, that may not even be possible).

@kwinkunks
Copy link
Member Author

Commit 932114c contains some custom hatches:

image

Had to use rather unintuitive symbols for these because of the ones mpl already uses.

@kwinkunks
Copy link
Member Author

Closing this.

USGS patterns: see #103

Matplotlib hatching: see #140

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

No branches or pull requests

2 participants