Gradient Fill using Graphics in Mathematica

扶醉桌前 提交于 2019-12-23 09:38:44

问题


How could I create the following using Rectangle[] in Graphics[]?


回答1:


Using Polygon, you can

Graphics[{EdgeForm[Black], 
  Polygon[{{0, 0}, {3, 0}, {3, 1}, {0, 1}}, 
   VertexColors -> {White, Red, Red, White}]}]



回答2:


Also:

Graphics[Raster[{Range[100]/100}, ColorFunction -> (Blend[{White, Red}, #] &)], 
 AspectRatio -> .3, 
 Frame       -> True, 
 FrameTicks  -> None]



来源:https://stackoverflow.com/questions/8142179/gradient-fill-using-graphics-in-mathematica

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!