NOAA-PMEL / PyFerret

The PyFerret program and Python module from NOAA/PMEL
https://ferret.pmel.noaa.gov/Ferret/
The Unlicense
60 stars 22 forks source link

Support patterns or hatching in PyFerret (Trac #1919) #12

Open karlmsmith opened 8 years ago

karlmsmith commented 8 years ago

PyFerret should support Ferret patterns by creating a path in the display program (PipedViewerPQ, cairo) that can then be applied as a tile over the appropriate region.

karlmsmith commented 8 years ago

(From GFDL) I think that hatching would suffice for us at GFDL. We'd greatly prefer this to be implemented as vector line-drawing, rather than a bitmap. Controllable parameters would be color, angle, spacing, and line thickness. (Cross-hatching could be achieved easily by the user if needed -- by simply overlaying a second hatch at 90deg.)

A second, related useful item would be a dot-grid -- with its key parameters being color, angle, spacing, and dot-diameter.

karlmsmith commented 6 years ago

Patterns to apply could be created using symbol files - fully filling out the symbol square as desired - and then tiling that "symbol" over the desired region. Still need to investigate getting this through PlotPlus code.

karlmsmith commented 6 years ago

On looking further, tiling only done in Qt with drawTiledPixmap - so a bitmap, which I suspect is not going to play well with vector images.

The best solution probably is to plot symbols. See https://github.com/NOAA-PMEL/PyFerret/blob/master/bench/pyjnls/bn_symbolpattern.jnl for an example of doing this - which showed up a bug that was fixed in https://github.com/NOAA-PMEL/PyFerret/commit/3ffda1e566975dfe1b682911b4c1acbd2473b2a7