4
$\begingroup$

I am trying to use the new to version 12.1 graphics directive HatchFilling. Here is an example:

Column@Table[Graphics[{
    {
     {HatchFilling[], Rectangle[{0, 0}, {1, y}]},
     Line[{{0, 0}, {1, 0}}]
     }
    },
   PlotLabel -> "Aspect Ratio = " <> ToString[y]],
  {y, {0.05, 0.1, 0.2, 0.5, 1}}]

Mathematica graphics

As you can see when the aspect ratio is small the hatching is gray but then becomes blacker as the aspect ratio goes towards 1. I don't want it to change gray level. (GrayLevel has no effect).

Any ideas how to fix?

Thanks

$\endgroup$
  • $\begingroup$ I think this is a bug, but perhaps a workaround: Column@Table[Graphics[{{{HatchFilling[], Rectangle[{0, 0}, {1, y}]}, Line[{{0, 0}, {1, 0}}]}}, PlotRangePadding -> {0, 0.2}], {y, {0.05, 0.1, 0.2, 0.5, 1}}]. I don't know why this works but maybe it can help. $\endgroup$ – ktm Mar 27 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.