Freitag, 8. Juli 2011

How to create publication style figures with Mathematica

Recently, I've been using Mathematica a lot - both for data processing and analysis as well as for plots. Plotting is easily done and quite selfexplaining, or at least well documented. Publication style figures of plots have little more demands: labled axes, legends, etc. I tinkered around quite a lot with such figures and I'd like to share my output:

As said a good looking plot can be created quite fast:

<< PlotLegends`

l1 = RandomReal[{2900, 3100}, 10]

fig1 = ListPlot[{l1, l2},
  Joined -> True, PlotStyle -> {Red, Green},
  PlotMarkers -> Automatic,
  PlotLegend -> {"list1", "list2"}, LegendShadow -> None,
  LegendPosition -> {1.1, -0.25}
  ]




A figure with two plots and the legend having its own part requires some more code:

pm = {Graphics[{Red, Disk[ImageScaled[{0.5, 0.5}], .025]}],
  Graphics[{Green, Disk[ImageScaled[{0.5, 0.5}], .025]}]}
pm2 = {
  Graphics[{Red, Disk[ImageScaled[{0.5, 0.5}], .25]}],
  Graphics[{Green, Disk[ImageScaled[{0.5, 0.5}], .25]}]
  }

fig = Show[
  GraphicsRow[{
    ListPlot[{l1, l2}, Joined -> True, PlotMarkers -> pm,
     PlotStyle -> {Red, Green}],
    Graphics[
     Legend[Transpose[{pm2, {"list1", "list2"}}],
      LegendShadow -> None]],
    ListPlot[l3, Joined -> True, PlotStyle -> Black,
     PlotMarkers -> Automatic]},
   ImageSize -> Full
   ],
  Graphics[Text[Style["(a)", 14], {0, 20}]],
  Graphics[Text[Style["(b)", 14], {400, 20}]],
  Graphics[Text[Style["(c)", 14], {800, 20}]](*,Frame->True*)
  ]



Unfortunatly, the figures shown are in "PNG" format and they do not look as nice as in "EPS" format. (For some reason I can't upload "EPS" formatted pictures.)

Keine Kommentare :

Kommentar veröffentlichen