Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.
u = 2/(1 + Z1) Sech[T/Z1 + 1/(9 Z1) Log[1 + Z1]]^2;
w = 2/(1 + Z2) Sech[T/Z2 + 1/(9 Z2) Log[1 + Z2]]^2;
Z1 = 5;
Z2 = 10;


Plot[{u, w}, {T, -15, 15}, PlotRange -> {0, 0.45}, Frame -> True, 
 Axes -> {False, False}, 
 Epilog -> {Inset[
    Graphics[{DotDashed, Line[{{0, 0}, {0.19, 0}}]}], {10, 0.41}], 
   Inset["z=0.1", {13, 0.41}], 
   Inset[Graphics[{Dashed, Line[{{0, 0}, {0.19, 0}}]}], {10, 0.38}], 
   Inset["z=0.2", {13, 0.38}]}, PlotStyle -> {DotDashed, Dashed}]

Mathematica graphics

When I want is to change the format of the plot into EPS, though some parts of the plot programed by using Epilog and Inset ( I mean "_._. Z=0.1" and "_ _ _Z=0.2") change their forms and make the plot unreadable! How can I revise my program? I think I should use Panel but I dont know how!

share|improve this question

migrated from stackoverflow.com Jun 6 '12 at 10:25

This question came from our site for professional and enthusiast programmers.

1  
ImportString[ExportString[p, "EPS"], "EPS"] (where p is the plot) works mostly fine for me on win7 mma8. Can you specify preciser what the problem is? –  Ajasja Jun 6 '12 at 10:44
    
The result I get using Export["g.eps", g] looks fine. How do you export and what do you get as output? What version of Mathematica do you have? –  Szabolcs Jun 6 '12 at 12:50
add comment

1 Answer 1

As noted in the comments, the results from eps export look fine. However, you can use an alternative version of your Epilog with a single Inset working with scaled coordinates as follows:

Epilog -> 
 Inset[
   Grid[{{Graphics[{DotDashed, Line[{{0, 0}, {1, 0}}]}, 
          AspectRatio -> .1, ImageSize -> 30], Style["z=0.1", 12]}, 
         {Graphics[{Dashed, Line[{{0, 0}, {1, 0}}]}, 
           AspectRatio -> .1, ImageSize -> 30], Style["z=0.2", 12]}}], 
   Offset[{-10, -10}, Scaled[{1, 1}]], {Right, Top}]

(Check for details Inset > Applications > first example in the docs on the content and placement of insets.)

Or, you can wrap the Grid with Panel:

Epilog ->  Inset[Panel@Grid[...]]  

If you replace the Epilog->... part of your code with these versions, you get

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.