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.

Just wondering if someone could help me for this problem. I have utilised prolog to use a jpg image as the background of my plot in order to compare my results with a reference plot. Although the outcome looks very good in the Mathematica working environment, when I try to export the outcome to pdf the scaling of the background image will be changed and the exported pdf graph is not like what I can see in the Mathematica working environment.

This is what I used to draw the plot:

Needs["PlotLegends`"];
backimage = Import["backimage.jpg"];
ListLinePlot[{Data1}, Mesh -> Full, InterpolationOrder -> 3, PlotStyle -> {{Thick, Darker[Blue, 0.5]}}, Joined -> {True}, PlotMarkers -> {{"*",18}}, PlotRange -> {{320, 480}, {-80/1000, 80/1000}}, AxesOrigin -> {0, 0}, FrameTicks -> Automatic, Frame -> True, FrameStyle -> Directive[Thickness[0.0035], Bold, FontFamily -> "Helvetica", 16],  GridLines -> None, AxesStyle -> Directive[Thickness[0.0035], Bold, FontFamily -> "Helvetica"], Prolog -> {Texture[backimage], Polygon[{Scaled[{0, 0}], Scaled[{1, 0}], Scaled[{1, 1}], Scaled[{0, 1}]}, VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]}]

where data points are:

Data1={{320.`, 0.00171`}, {320.625`, 0.00802`}, {321.25`,  0.01382`}, {321.875`, 0.0194`}, {322.5`, 0.02464`}, {323.125`, 0.02974`}, {323.75`, 0.03426`}, {324.375`, 0.03881`}, {325.`, 0.04315`}, {325.625`, 0.04729`}, {326.25`, 0.051`}, {326.875`, 0.05469`}, {327.5`, 0.05792`}, {328.125`, 0.06066`}, {328.75`,0.06287`}, {329.375`, 0.06448`}, {330.`, 0.06512`}, {330.625`,0.065`}, {331.25`, 0.06418`}, {331.875`, 0.06236`}, {332.5`, 0.05963`}, {333.125`, 0.0562`}, {333.75`, 0.05219`}, {334.375`, 0.0474`}, {335.`, 0.04238`}, {335.625`, 0.037`}, {336.25`, 0.03139`}, {336.875`, 0.02559`}, {337.5`, 0.02011`}, {338.125`,  0.01444`}, {338.75`, 0.0088`}, {339.375`, 0.00313`}, {340.`, -0.00233`}, {340.625`, -0.00813`}, {341.25`, -0.01374`}, {341.875`, -0.01949`}, {342.5`, -0.02523`}, {343.125`, -0.03118`}, {343.75`, -0.03665`}, {344.375`, -0.04212`}, {345.`,-0.04726`}, {345.625`, -0.05204`}, {346.25`, -0.05601`}, {346.875`,-0.05954`}, {347.5`, -0.06211`}, {348.125`, -0.0638`}, {348.75`,-0.06465`}, {349.375`, -0.06484`}, {350.`, -0.06399`}, {350.625`,-0.06246`}, {351.25`, -0.06044`}, {351.875`, -0.05791`}, {352.5`,-0.05485`}, {353.125`, -0.05157`}, {353.75`, -0.048`}, {354.375`,-0.044`}, {355.`, -0.03988`}, {355.625`, -0.03559`}, {356.25`,-0.03091`}, {356.875`, -0.02575`}, {357.5`, -0.02044`}, {358.125`,-0.01462`}, {358.75`, -0.00845`}, {359.375`, -0.00192`}, {360.`,   0.00468`}, {360.625`, 0.01172`}, {361.25`, 0.01853`}, {361.875`, 0.02515`}, {362.5`, 0.03135`}, {363.125`, 0.03737`}, {363.75`, 0.04252`}, {364.375`, 0.04719`}, {365.`, 0.05109`}, {365.625`, 0.05436`}, {366.25`, 0.05672`}, {366.875`, 0.0588`}, {367.5`,  0.06019`}, {368.125`, 0.06105`}, {368.75`, 0.06141`}, {369.375`,   0.06165`}, {370.`, 0.06134`}, {370.625`, 0.06071`}, {371.25`, 0.05967`}, {371.875`, 0.0581`}, {372.5`, 0.05576`}, {373.125`, 0.05296`}, {373.75`, 0.04948`}, {374.375`, 0.04515`}, {375.`, 0.04011`}, {375.625`, 0.03457`}, {376.25`, 0.02845`}, {376.875`, 0.02188`}, {377.5`, 0.01525`}, {378.125`, 0.00844`}, {378.75`, 0.0016`}, {379.375`, -0.005`}, {380.`, -0.01107`}, {380.625`,-0.01703`}, {381.25`, -0.02254`}, {381.875`, -0.02772`}, {382.5`, -0.03252`}, {383.125`, -0.03728`}, {383.75`, -0.04152`}, {384.375`, -0.04573`}, {385.`, -0.04976`}, {385.625`, -0.05364`}, {386.25`, -0.05688`}, {386.875`, -0.05991`}, {387.5`, -0.06228`}, {388.125`, -0.06402`}, {388.75`, -0.06492`}, {389.375`, -0.0652`}, {390.`, -0.06431`}, {390.625`, -0.06257`}, {391.25`, -0.06007`}, {391.875`, -0.05694`}, {392.5`, -0.05296`}, {393.125`, -0.04866`}, {393.75`, -0.044`}, {394.375`, -0.03906`}, {395.`, -0.03399`}, {395.625`, -0.02904`}, {396.25`, -0.02384`}, {396.875`, -0.01843`}, {397.5`, -0.01298`}, {398.125`, -0.0074`}, {398.75`, -0.0015`}, {399.375`, 0.00386`}, {400.`, 0.0065`}, {400.625`, 0.0055`}, {401.25`, 0.00137`}, {401.875`, -0.00405`}, {402.5`, -0.00755`}, {403.125`, -0.00696`}, {403.75`, -0.00269`}, {404.375`, 0.00328`}, {405.`, 0.00844`}, {405.625`, 0.01005`}, {406.25`, 0.00696`}, {406.875`, 0.00101`}, {407.5`, -0.00515`}, {408.125`, -0.009`}, {408.75`, -0.00883`}, {409.375`, -0.00442`}, {410.`, 0.0014`}, {410.625`, 0.00588`}, {411.25`, 0.00702`}, {411.875`, 0.00442`}, {412.5`, -0.00088`}, {413.125`, -0.00558`}, {413.75`, -0.00705`}, {414.375`, -0.00475`}, {415.`, 0.00035`}, {415.625`, 0.00605`}, {416.25`, 0.00927`}, {416.875`, 0.00802`}, {417.5`, 0.00325`}, {418.125`, -0.00313`}, {418.75`, -0.0084`}, {419.375`, -0.01003`}, {420.`, -0.00693`}, {420.625`, -0.00113`}, {421.25`, 0.00464`}, {421.875`, 0.00795`}, {422.5`, 0.00717`}, {423.125`, 0.00266`}, {423.75`, -0.00277`}, {424.375`, -0.00618`}, {425.`, -0.00623`}, {425.625`, -0.0027`}, {426.25`, 0.00281`}, {426.875`, 0.00718`}, {427.5`, 0.00794`}, {428.125`, 0.00486`}, {428.75`, -0.00081`}, {429.375`, -0.00686`}, {430.`, -0.00993`}, {430.625`, -0.00844`}, {431.25`, -0.00325`}, {431.875`, 0.0031`}, {432.5`, 0.00818`}, {433.125`, 0.00924`}, {433.75`, 0.00591`}, {434.375`, 0.00024`}, {435.`, -0.00482`}, {435.625`, -0.00729`}, {436.25`, -0.00583`}, {436.875`, -0.00106`}, {437.5`, 0.00402`}, {438.125`, 0.00682`}, {438.75`, 0.00602`}, {439.375`, 0.00186`}, {440.`, -0.00407`}, {440.625`, -0.00823`}, {441.25`, -0.00847`}, {441.875`, -0.00469`}, {442.5`, 0.0014`}, {443.125`, 0.00738`}, {443.75`, 0.01001`}, {444.375`, 0.00797`}, {445.`, 0.00265`}, {445.625`, -0.00353`}, {446.25`, -0.00801`}, {446.875`, -0.00859`}, {447.5`, -0.00489`}, {448.125`, 0.00065`}, {448.75`, 0.00535`}, {449.375`, 0.00717`}, {450.`, 0.00505`}, {450.625`, -0.00006`}, {451.25`, -0.00509`}, {451.875`, -0.00724`}, {452.5`, -0.00574`}, {453.125`, -0.00091`}, {453.75`, 0.00496`}, {454.375`, 0.00873`}, {455.`, 0.00819`}, {455.625`, 0.00402`}, {456.25`, -0.0022`}, {456.875`, -0.00781`}, {457.5`, -0.0099`}, {458.125`, -0.00737`}, {458.75`, -0.00177`}, {459.375`, 0.00427`}, {460.`, 0.00841`}, {460.625`, 0.00826`}, {461.25`, 0.00411`}, {461.875`, -0.00167`}, {462.5`, -0.00596`}, {463.125`, -0.0072`}, {463.75`, -0.00441`}, {464.375`, 0.00087`}, {465.`, 0.00559`}, {465.625`, 0.00716`}, {466.25`, 0.0051`}, {466.875`, 0.00016`}, {467.5`, -0.00553`}, {468.125`, -0.00866`}, {468.75`, -0.00763`}, {469.375`, -0.00299`}, {470.`, 0.00321`}, {470.625`, 0.00848`}, {471.25`, 0.00981`}, {471.875`, 0.00651`}, {472.5`, 0.00048`}, {473.125`, -0.00553`}, {473.75`, -0.00898`}, {474.375`, -0.00809`}, {475.`, -0.00323`}, {475.625`, 0.00254`}, {476.25`, 0.00662`}, {476.875`, 0.00725`}, {477.5`, 0.00418`}, {478.125`, -0.00122`}, {478.75`, -0.00567`}, {479.375`, -0.00692`}};

And the image I used in the background (backimage.jpg) is enter image description here

After running this command in the Mathematica notebook, this is how it looks in the working environment: enter image description here

Which is very nice and it is exactly what I need. But when I try to export this graph (including the background) to pdf, this is what I get: enter image description here

which is not the same as what I expected. I tried to use PrintingStyleEnvironment to sort this issue out, but it was not successful.

share|improve this question
    
Please provide detailed code how did you add the background image to the plot. –  Alexey Popkov Oct 31 '13 at 6:35
1  
@AlexeyPopkov he provided the code for that –  Mike Honeychurch Oct 31 '13 at 6:59
1  
I get the same happening with 8.0.4 on OS X. It seems the scaled on the image is forgotten during the export. Also tried exporting some of the examples in the docs and got the same problem –  Mike Honeychurch Oct 31 '13 at 7:03
    
There's no problem on WinXp, –  Kuba Oct 31 '13 at 7:38
    
Just wanted to mention that my version number is 8.0.4.0 and platform is Microsoft Windows 7 (64-bit). –  mak maak Oct 31 '13 at 7:51

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.