3
$\begingroup$

My problem is quite simple and yet I can't seem to find a solution to it. I'm trying to create a figure in vector format but if I export it to EPS I get a very bad gradient in the colors. If I export it to PDF I get a raster image. Somehow I thought to combine both separately (get the lines and spheres in vector and the gradient in raster), but I can't seem to get it to work as the result should look as in the last command:

nodelist = {{0, 6.75, 0}, {-0.8, 4.5, 0}, {1.75, 4.6, 0}, {-2.2, 7., 
    0}, {0.3, 8.75, 0}, {2.75, 7.3, 0}, {-2., 0.8, 0}, {0.75, 0.7, 
    0}, {3.25, 1, 0}, {-4.3, 2.3, 0}, {-1.5, 2.5, 0}, {1.8, 2.75, 
    0}, {5.5, 1.75, 0}, {4.25, 3, 0}, {-5.7, 4.1, 0}, {-3, 4.5, 
    0}, {4, 4.75, 0}, {7.1, 4, 0}, {7.75, 6.25, 0}, {-6.5, 6.25, 
    0}, {-4.5, 7.25, 0}, {5.75, 6.5, 0}, {7.5, 7.75, 0}, {-6.38, 8.75,
     0}, {4.75, 8.6, 0}, {-2., 9.5, 0}, {2.75, 10, 0}, {5.5, 11, 
    0}, {-4.125, 11, 0}, {0.5, 10.8, 0}, {-1.7, 12.1, 0}, {2.3, 12.25,
     0}};
nodes = Graphics3D[{PointSize[Large], 
   Table[Point[nodelist[[i]]], {i, 32}]}]

enter image description here

extruded = {{0, 6.75, 10}, {-0.8, 4.5, 10}, {1.75, 4.6, 10}, {-2.2, 
    7., 10}, {0.3, 8.75, 10}, {2.75, 7.3, 10}, {-2., 0.8, 0}, {0.75, 
    0.7, 0}, {3.25, 1, 0}, {-4.3, 2.3, 0}, {-1.5, 2.5, 0}, {1.8, 2.75,
     0}, {5.5, 1.75, 0}, {4.25, 3, 0}, {-5.7, 4.1, 0}, {-3, 4.5, 
    0}, {4, 4.75, 0}, {7.1, 4, 0}, {7.75, 6.25, 0}, {-6.5, 6.25, 
    0}, {-4.5, 7.25, 0}, {5.75, 6.5, 0}, {7.5, 7.75, 0}, {-6.38, 8.75,
     0}, {4.75, 8.6, 0}, {-2., 9.5, 0}, {2.75, 10, 0}, {5.5, 11, 
    0}, {-4.125, 11, 0}, {0.5, 10.8, 0}, {-1.7, 12.1, 0}, {2.3, 12.25,
     0}};
top = ListPlot3D[{{0, 6.75, 10}, {-0.8, 4.5, 10}, {1.75, 4.6, 
    10}, {-2.2, 7., 10}, {0.3, 8.75, 10}, {2.75, 7.3, 10}}, 
  Mesh -> All, ViewPoint -> Top, Axes -> False, Boxed -> False, 
  PlotStyle -> LightBrown]

enter image description here

mesh = ListPlot3D[extruded, Mesh -> All, PlotStyle -> {None}]

enter image description here

fn=ListPlot3D[extruded,Mesh->All,PlotStyle->{Opacity[0.8]},ColorFunction->(ColorData[{"DarkTerrain","Reverse"}][#3]&)]

enter image description here

fn2=ListPlot3D[extruded,Mesh->All,PlotStyle->None]

enter image description here

Vector graphics part

plot=Show[fn2,nodes,Axes->False,BoxRatios->{1,1,0.2},Boxed-> False,PlotRange-> All, ViewPoint->{-Pi,-Pi/2,Pi}]
Export["/Users/aaragon/Desktop/ramp.eps",%]

enter image description here

Raster graphics part

plot=Show[mesh,fn,nodes,top,Axes->False,BoxRatios->{1,1,0.2},Boxed-> False,PlotRange-> All, ViewPoint->{-Pi,-Pi/2,Pi}]
Export["ramp.pdf",plot,"AllowRasterization"->True,ImageSize->360,ImageResolution->600]

enter image description here

Is there a way to accomplish what I want?

$\endgroup$
  • 4
    $\begingroup$ Related: mathematica.stackexchange.com/questions/1542/… $\endgroup$ – Szabolcs Mar 31 '16 at 11:08
  • $\begingroup$ I saw that answer, and if you see the last command is exactly the solution. But the image created is rasterized, not vector graphics. $\endgroup$ – Alejandro Marcos Aragon Mar 31 '16 at 11:09
  • $\begingroup$ @AlejandroMarcosAragon Notice that planemesh is not defined in your question, so we can't actually run your code. Can you fix this to include its definition? Also, what happens if you don't allow rasterization in the PDF export? $\endgroup$ – MarcoB Apr 25 '16 at 13:52

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.