Re: Graphics export to BMP and JPEG
- To: mathgroup at smc.vnet.net
- Subject: [mg82688] Re: Graphics export to BMP and JPEG
- From: Hannes Kessler <HannesKessler at hushmail.com>
- Date: Sun, 28 Oct 2007 04:07:25 -0500 (EST)
- References: <ffsdbd$ojr$1@smc.vnet.net><ffv2pc$b20$1@smc.vnet.net>
Hello Jens and pskmaths at googlemail.com, regarding the WHY question of Jens-Peer - unfortunately my company forces me to use certain file types, although, I agree, vector graphics as postscript would provide better quality. By the way, already the Export to WMF which supports vector graphics leads to a distorted image. Jens statement "you will never have the right size/resolution." is not correct: If I select the image and save it via the file menu in a bitmap format, the result is completely okay. So it should be possible to achieve the same result with Export. Thanks to pskmaths at googlemail.com, indeed this approach works. But I need something which can be used in a package to automate the conversion task. Currently I call ghostscript from the package for this purpose. But obviously a self-contained solution within Mathematica would be better in situations, when ghostscript is not available. So it would be good to know how to reproduce for the call to Export the conversion options used by Mathematica in the "File -> Save selection as" menu. Below I include an example graphics which I had trouble to convert. Regards, Hannes \!\(\* GraphicsBox[ GraphicsComplexBox[{{-3., 0.}, {1.4, 0.}, {3.7, 14.5}, {4.5, 14.4}, {10.1, 24.2}}, {{{}, {}, {GrayLevel[0], Thickness[Medium], LineBox[{1, 2, 3, 4, 5}]}}, { {GrayLevel[0], Thickness[Medium], TagBox[InsetBox["\[EmptyCircle]", 1], "InsetString"], TagBox[InsetBox["\[EmptyCircle]", 2], "InsetString"], TagBox[InsetBox["\[EmptyCircle]", 3], "InsetString"], TagBox[InsetBox["\[EmptyCircle]", 4], "InsetString"], TagBox[InsetBox["\[EmptyCircle]", 5], "InsetString"]}, {}}}], AspectRatio->NCache[GoldenRatio^(-1), 0.6180339887498948], Axes->True, AxesOrigin->{0, 0}, BaseStyle->{FontFamily -> "Arial", FontSize -> Medium}, Epilog->{{ TagBox[ InsetBox["1", {-3, 0}, {0, -1.5}], "InsetString"], TagBox[ InsetBox["2", {1.4, 0.}, {0, -1.5}], "InsetString"], TagBox[ InsetBox["3", {3.7, 14.5}, {0, -1.5}], "InsetString"], TagBox[ InsetBox["4", {4.5, 14.4}, {0, -1.5}], "InsetString"], TagBox[ InsetBox["5", {10.1, 24.2}, {0, -1.5}], "InsetString"]}, GrayLevel[1], RectangleBox[{-2.1, -1}, {-1.9, 1}], GrayLevel[0], LineBox[{{-2.1, -1}, {-2.1, 1}}], LineBox[{{-1.9, -1}, {-1.9, 1}}], Thickness[Medium], Dashing[{Medium}], LineBox[{{1.4, 0}, {4.2, 14.4}}], Dashing[{}], ArrowBox[{{4.2, 9.4}, {4.2, 14.4}}], TagBox[ InsetBox["6", {4.2, 9.4}, {0, 1.5}], "InsetString"]}, Frame->True, FrameLabel->{ FormBox["\"Spring deflection [mm]\"", TraditionalForm], FormBox["\"Spring force [kN]\"", TraditionalForm]}, FrameTicks->{{{0, FormBox["0", TraditionalForm]}, {2, FormBox["2", TraditionalForm]}, {4, FormBox["4", TraditionalForm]}, {6, FormBox["6", TraditionalForm]}, {8, FormBox["8", TraditionalForm]}, {10, FormBox["10", TraditionalForm]}, {12, FormBox["12", TraditionalForm]}, {14, FormBox["14", TraditionalForm]}}, {{0, FormBox["0", TraditionalForm]}, {5, FormBox["5", TraditionalForm]}, {10, FormBox["10", TraditionalForm]}, {15, FormBox["15", TraditionalForm]}, {20, FormBox["20", TraditionalForm]}, {25, FormBox["25", TraditionalForm]}}, None, None}, ImageSize->Large, PlotRange->{{-4, 14}, {-5, 30.}}, PlotRangeClipping->True, PlotRangePadding->{Automatic, Automatic}, Prolog->InsetBox[ BoxData[ FormBox[ TagBox[ GridBox[{{ "\"No\"", "\"Spring deflection [mm]\"", "\[SpanFromLeft]", "\"Spring force [kN]\""}, { "\[SpanFromAbove]", "\"SG-SG\"", "\"SG-CS\"", "\[SpanFromAbove]"}, {"1", RowBox[{"-", "1000.`"}], RowBox[{"-", "1000.`"}], "0.`"}, {"2", "1.4`", "1.`", "0.`"}, { "3", "3.7`", "2.1`", "14.5`"}, { "4", "4.5`", "2.9`", "14.4`"}, { "5", "10.1`", "8.6`", "24.2`"}, { "6", "4.2`", "2.6`", "14.4`"}}, GridBoxAlignment -> { "Columns" -> {{Center}}, "Rows" -> {{Center}}}, GridBoxDividers -> { "Columns" -> {{True}}, "Rows" -> {True, False, True, {False}, True}}, GridBoxItemSize -> {"Columns" -> { Scaled[0.03], Scaled[0.1], Scaled[0.1], Scaled[0.2]}, "Rows" -> {{Automatic}}}, ColumnsEqual -> False, RowsEqual -> False, GridBoxSpacings -> { "Columns" -> {{1}}, "Rows" -> {1, 1, 1, {0}, 1}}, BaseStyle -> {FontFamily -> "Arial", FontSize -> 9}], "Grid"], TraditionalForm]], Scaled[{1, 0.14285714285714285`}], Scaled[{1.05, -0.1}], Scaled[{1, 1}]]]\)