3
$\begingroup$

I've generated a graphics which exhibit gradient color in rectangle and export it as:

SetDirectory[NotebookDirectory[]]; 
Export["./test.pdf", Graphics[{Polygon[{{-4, 5/3}, {-4, 0}, {4, 0}, {4, 5/3}}, 
VertexColors -> {RGBColor[0, 0, 1, 0.3], RGBColor[0, 0, 1, 1], 
  RGBColor[0, 0, 1, 1], RGBColor[0, 0, 1, 0.3]}]}]];

If I preview it, i.e., directly view in Mathematica GUI,

Graphics[{Polygon[{{-4, 5/3}, {-4, 0}, {4, 0}, {4, 5/3}}, 
VertexColors -> {RGBColor[0, 0, 1, 0.3], RGBColor[0, 0, 1, 1], 
  RGBColor[0, 0, 1, 1], RGBColor[0, 0, 1, 0.3]}]}]

I got enter image description here but the exported file looks likeenter image description here with a very peculiar slash line and an edge around the rectangle. I don't know how to solve this problem.

$\endgroup$

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.