Skip to main content
Commonmark migration
Source Link

I work with histograms and would like to export it to EPS format. I've noticed that my exported image loses the PlotRangeClipping option that I set up when I export the plot. This is true for at least EPS, PNG and PDF.

Based on this question and its accepted answer, I defined the function

OutlinedExport[name_,gr_,opts:OptionsPattern[]]:= Export[ name, First@ImportString[ ExportString[ gr, "PDF" ], "PDF", "TextOutlines"->True ], FilterRules[ {opts}, Options[Export] ] ] 

Now here is an example of histogram

data = Table[InverseCDF[NormalDistribution[0, 1], Random[]], {i, 1000}]; PlotB = Histogram[data, 20, PlotRange -> {{-2, 2}, Automatic}, Frame->True] OutlinedExport["output2.pdf", PlotB, ImageSize -> 600] 

which appears to have lost the clipping during the export.

The questions are :###

  • Is there a way to preserve clipping as defined through options like PlotRangeClipping and PlotRangePadding ?

  • If the problem is related with the OutlinedExport, is there a way to answer my question while also keeping the outline of fonts (which I need but have here removed for the sake of example) ?

I work with histograms and would like to export it to EPS format. I've noticed that my exported image loses the PlotRangeClipping option that I set up when I export the plot. This is true for at least EPS, PNG and PDF.

Based on this question and its accepted answer, I defined the function

OutlinedExport[name_,gr_,opts:OptionsPattern[]]:= Export[ name, First@ImportString[ ExportString[ gr, "PDF" ], "PDF", "TextOutlines"->True ], FilterRules[ {opts}, Options[Export] ] ] 

Now here is an example of histogram

data = Table[InverseCDF[NormalDistribution[0, 1], Random[]], {i, 1000}]; PlotB = Histogram[data, 20, PlotRange -> {{-2, 2}, Automatic}, Frame->True] OutlinedExport["output2.pdf", PlotB, ImageSize -> 600] 

which appears to have lost the clipping during the export.

The questions are :###

  • Is there a way to preserve clipping as defined through options like PlotRangeClipping and PlotRangePadding ?

  • If the problem is related with the OutlinedExport, is there a way to answer my question while also keeping the outline of fonts (which I need but have here removed for the sake of example) ?

I work with histograms and would like to export it to EPS format. I've noticed that my exported image loses the PlotRangeClipping option that I set up when I export the plot. This is true for at least EPS, PNG and PDF.

Based on this question and its accepted answer, I defined the function

OutlinedExport[name_,gr_,opts:OptionsPattern[]]:= Export[ name, First@ImportString[ ExportString[ gr, "PDF" ], "PDF", "TextOutlines"->True ], FilterRules[ {opts}, Options[Export] ] ] 

Now here is an example of histogram

data = Table[InverseCDF[NormalDistribution[0, 1], Random[]], {i, 1000}]; PlotB = Histogram[data, 20, PlotRange -> {{-2, 2}, Automatic}, Frame->True] OutlinedExport["output2.pdf", PlotB, ImageSize -> 600] 

which appears to have lost the clipping during the export.

The questions are :

  • Is there a way to preserve clipping as defined through options like PlotRangeClipping and PlotRangePadding ?

  • If the problem is related with the OutlinedExport, is there a way to answer my question while also keeping the outline of fonts (which I need but have here removed for the sake of example) ?

replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

I work with histograms and would like to export it to EPS format. I've noticed that my exported image loses the PlotRangeClipping option that I set up when I export the plot. This is true for at least EPS, PNG and PDF.

Based on this questionthis question and its accepted answer, I defined the function

OutlinedExport[name_,gr_,opts:OptionsPattern[]]:= Export[ name, First@ImportString[ ExportString[ gr, "PDF" ], "PDF", "TextOutlines"->True ], FilterRules[ {opts}, Options[Export] ] ] 

Now here is an example of histogram

data = Table[InverseCDF[NormalDistribution[0, 1], Random[]], {i, 1000}]; PlotB = Histogram[data, 20, PlotRange -> {{-2, 2}, Automatic}, Frame->True] OutlinedExport["output2.pdf", PlotB, ImageSize -> 600] 

which appears to have lost the clipping during the export.

The questions are :###

  • Is there a way to preserve clipping as defined through options like PlotRangeClipping and PlotRangePadding ?

  • If the problem is related with the OutlinedExport, is there a way to answer my question while also keeping the outline of fonts (which I need but have here removed for the sake of example) ?

I work with histograms and would like to export it to EPS format. I've noticed that my exported image loses the PlotRangeClipping option that I set up when I export the plot. This is true for at least EPS, PNG and PDF.

Based on this question and its accepted answer, I defined the function

OutlinedExport[name_,gr_,opts:OptionsPattern[]]:= Export[ name, First@ImportString[ ExportString[ gr, "PDF" ], "PDF", "TextOutlines"->True ], FilterRules[ {opts}, Options[Export] ] ] 

Now here is an example of histogram

data = Table[InverseCDF[NormalDistribution[0, 1], Random[]], {i, 1000}]; PlotB = Histogram[data, 20, PlotRange -> {{-2, 2}, Automatic}, Frame->True] OutlinedExport["output2.pdf", PlotB, ImageSize -> 600] 

which appears to have lost the clipping during the export.

The questions are :###

  • Is there a way to preserve clipping as defined through options like PlotRangeClipping and PlotRangePadding ?

  • If the problem is related with the OutlinedExport, is there a way to answer my question while also keeping the outline of fonts (which I need but have here removed for the sake of example) ?

I work with histograms and would like to export it to EPS format. I've noticed that my exported image loses the PlotRangeClipping option that I set up when I export the plot. This is true for at least EPS, PNG and PDF.

Based on this question and its accepted answer, I defined the function

OutlinedExport[name_,gr_,opts:OptionsPattern[]]:= Export[ name, First@ImportString[ ExportString[ gr, "PDF" ], "PDF", "TextOutlines"->True ], FilterRules[ {opts}, Options[Export] ] ] 

Now here is an example of histogram

data = Table[InverseCDF[NormalDistribution[0, 1], Random[]], {i, 1000}]; PlotB = Histogram[data, 20, PlotRange -> {{-2, 2}, Automatic}, Frame->True] OutlinedExport["output2.pdf", PlotB, ImageSize -> 600] 

which appears to have lost the clipping during the export.

The questions are :###

  • Is there a way to preserve clipping as defined through options like PlotRangeClipping and PlotRangePadding ?

  • If the problem is related with the OutlinedExport, is there a way to answer my question while also keeping the outline of fonts (which I need but have here removed for the sake of example) ?

edited title
Link
Pschoofs
  • 429
  • 2
  • 11

How to preserve clipping when exporting a framed histogram with font outliningembedding?

edited title
Link
Pschoofs
  • 429
  • 2
  • 11
Loading
Tweeted twitter.com/#!/StackMma/status/228808974777065472
Source Link
Pschoofs
  • 429
  • 2
  • 11
Loading