I am trying to put several diagrams together in a kind of a table. I think this is called "index print", photography people do that when they have to review many photographs at once. Anyway, this is the code:
main :: IO ()
main = mainWith @(Diagram B)
$ (tile . fmap renderOne) examples
renderOne :: AnyGraph -> Diagram B
renderOne (AnyGraph gr) = ...
tile :: [Diagram B] -> Diagram B
tile xs = let columns = (ceiling . sqrt . fromIntegral . length) xs
in (vcat . fmap hcat . List.chunksOf columns) xs
It does not work as I expect. But let us approach it gradually. First, here is a render of a single tile:
Now, let us hcat
four tiles together.
Add a second row: (See how scale invariant features thicken.)
And this is how it looks with 4 rows:
Out of hand!
It seems to me that scale invariant features, such as arrow heads, are scaled in proportion to the area of the picture. But in this case, I need to grow my diagram without re-scaling those features. How can I achieve that?
Scale invariance is a term used in mathematics, economics and physics and is a feature of an object that does not change if all scales in the object are multiplied by a common factor.
In physics, mathematics and statistics, scale invariance is a feature of objects or laws that do not change if scales of length, energy, or other variables, are multiplied by a common factor, and thus represent a universality.
Scale-Invariant Feature Transform (SIFT)—SIFT is an algorithm in computer vision to detect and describe local features in images. It is a feature that is widely used in image processing. The processes of SIFT include Difference of Gaussians (DoG) Space Generation, Keypoints Detection, and Feature Description.
Principal components are not scale invariant because a scale chance in one of the variables leads to a change in the shape of the swarm of points in the sample.
The user manual section on measurement units is what you want to look at. Things like arrowheads are by default measured in "normalized" units, which are scaled so that they are always a constant proportion of the size of the whole picture. If I understand your use case correctly, I think you probably want to use local units instead. Use the primed variant of whatever arrow function you are using, and give it an options record something like
(with & headLength .~ local 0.1)
but with whatever number makes your pictures look the way you want. See the arrow tutorial for more on arrow options.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With