# Tag Info

6

Here is how you can get exact control over the exported page size directly from Mathematica: I'll assume I want exactly a 5 inch square page. Then I would create a GraphicsGrid instead of Grid from the plots, and output them in an Inset with a Graphics wrapper that has exactly 5 inches as its ImageSize: img1 = ListLinePlot[#, ImageSize -> 500] & ...

4

One non-perfect workaround is to Magnify your graphics in order to fit the page width: Export["test1.eps", Magnify[Grid[{img1}], .8]] But perfect result can be achieved by Exporting to PDF and then converting PDF to EPS using a third-party tool like free pdftops utility which is a part of Poppler (you can download Windows binaries here): ...

8

so you understand whats happening, the image is all there and being cut off by whatever software you use to render because it is wider than the page. It may actually be ok if you use some other software that properly handles eps. Acrobat cuts it off which is really annoying since they literally wrote the standard, but just for example, it imports correctly ...

1

Try the following: (* Import your data as tab-separated values; extra "" will be included *) Import["c:\\Users\\Marco\\Desktop\\Sandbox\\rawdata.txt", "TSV"]; Flatten[%]; (* remove the "" caused by the extra tabs in your data file *) DeleteCases[%, ""]; (* Reshape your data into an array with your required dimensions *) ArrayReshape[%, {308, 508}]; (* ...

0

Export["test.eps", g] FileByteCount["test.eps"]/1024^2 // N 204.9 Export["test.eps", Rasterize[g, RasterSize -> 2048]]; FileByteCount["test.eps"]/1024^2 // N 1.38359 (much faster too) You will need to see for yourself the quality is quite good.

3

Because the data in the text file has one column, importing using the "Table" format produces a nested N × 1 array, where N is the number of lines in the file. Instead, use the "List" import format, and you will get a one-dimensional array: Import["D:/Data/Mathematica/Convert_data/rawdata.txt", "List"] should give {1.59867, 1.57057, 1.60027, 1.51327, ...

2

After a bit, I hit upon a solution involving a round-trip through the import/export subsystem. First, it is helpful to have everything in the same representation, so we need to put the mathml into XMLElement form, e.g. mathml = ImportString[ExportString[1/2, "MathML"], {"MathML", "XMLElement"}] (* XMLElement["math", {"xmlns" -> ...

0

Here is a quick answer (based on @GuessWhoItIs's comment) for a basic rotation: STLdata = Import["MyFile.stl", "GraphicsComplex"]; RotatedSTL = Graphics3D[ GeometricTransformation[STLdata, RotationTransform[30 Degree, {1, 1, 1}]], Axes -> True] Export["MyFileRotated.stl", RotatedSTL, {"STL","BinaryFormat" -> False}]

0

This is not an answer -- I just can't refrain from commenting on your coding style. Your expression Table[Plot[f[d, x], {x, -85, 60}, PlotLabel -> f], {f, {CDF}}] is valid, but it amazes me. I would never have thought of it. Because I am extremely simple-minded, I would have written {Plot[CDF[d, x], {x, -85, 60}, PlotLabel -> CDF]}

4

Simulate data data = RandomVariate[PowerDistribution[1, 2.5], 10^3]; dist = SmoothKernelDistribution[data]; Plot[CDF[dist, x], {x, 0, 1}] Export Data Export["cdf.xls", Table[{x, CDF[dist, x]}, {x, 0, 1, .01}]];

1

It looks like setting Compatibility: Acrobat 4 (PDF 1.3) in the Save Adobe PDF dialog in Illustrator solves the issue (checked with Illustrator 17): In the resulting PDF file the transparency is flattened without rasterization (here "Untitled-1.pdf" is PDF file generated by Illustrator from blank document where the Exported file "pl.pdf" was Placed): (* ...

5

On OS X, a simple workaround is to re-save the Mathematica-exported PDF with Preview.app before placing it. Simply open it in Preview and press ⌘-S. I did try processing the PDF through several other programs, but Preview was the only one that worked with all files I tried without destroying them. Some others worked only with PDFs containing no ...

2

After multiple failures to achieve truly unattended batch plotting setup solely in Mathematica, I have finally decided to go with a hybrid approach instead. I have exported the plotting commands into a Mathematica script, then use a separate Python script to call WolframScript. After a couple of plots, the MathKernel will still crash as usual. This will ...

7

No crash with version 10.2 on Win7 x64 but there definitely is a bug: Here is how the graph is displayed in the FrontEnd: Show[Plot[x, {x, 0, 1}], Graphics[{Rotate[Text[Style["test", 60], {.5, .5}], \[Pi]/4]}]] And here is how the Exported PDF is rendered by Acrobat 11.0.12 (other PDF viewers show the same):

4

On my system (OS X 10.10.4) it doesn't even display correctly on-screen. This means that rasterization doesn't help. I can confirm the problem in 10.0.2, 10.1.0 and 10.2.0. The problem doesn't exist in 9.0.1. We can trace back this problem to a BezierCurve bug. gr = Show@Graph[{1 <-> 1, 1 <-> 2}, EdgeShapeFunction -> "Line", ...

1

I decided to modify undistortedGraphicsColumn from LLlAMnYP's post to work for my purposes and extend it to an undistortedGraphicsGrid. Because I am particularly interested in aligning the plot region frames carefully, I have changed the names to alignedGraphicsColumn and alignedGraphicsGrid Caveats, up front: alignedGraphicsColumn is a straight-forward ...

6

Ilian mentioned that this is fixed in newer version of Mathematica, but if you are not able to update, the following helper function may be of help: toFor[c_] := "(" <> ToString[Re[c]] <> "," <> ToString[Im[c]] <> ")" numbers = RandomComplex[10 + 10 I, 100]; Export["file.in", toFor /@ numbers, "Table"] This exports a list of ...

4

The default type is an unsigned integer. You need to specify a suitable type, eg: testList = {1, 2, 3, -4}; file = "test1"; BinaryWrite[file, testList, "Integer8"]; BinaryReadList[file, "Integer8"] Close[file]; Note the read needs to know the type as well. See BinaryRead for the list of types. (Integer8 is only good for values in the range -128 to 127 of ...

0

Why not PutAppend? Something like this should give you the desired result: testData = RandomReal[{0, 1}, {1, 1}]; OpenAppend["C:\\Users\\Alex\\Desktop\\1\\file1.nb", testData]; Consult the documentation too.

4

What you could do is download and install the STIX fonts by following the instructions here. These fonts are (if I'm not mistaken) also used by MathJAX, the engine that renders $\LaTeX$ code on this web site. Then, in Mathematica, do something like this: baseStyle = {FontFamily -> "STIXGeneral", 12, ScriptSizeMultipliers -> .66, ...

5

Indeed, 3D plots like this were exported as vector graphics with generally huge numbers of polygons in version 8. But even then, the export was automatically rasterized whenever there were VertexColors present in the plot. I described this as a trick for getting smaller PDF files here, and also used it e.g. here. So in general, I think it's actually a good ...

3

WDX is not a good format. We are likely to deprecate it or entirely replace it with a different implementation that is not backward-compatible (which is obviously problematic). Dataset will never directly support it. There are candidates for a possible native format for dataset, like Cap'n Proto, HDF5, and a couple others. Or XML. No, just kidding :-)

2

I agree that this is unexpected. I was able to reproduce the problem in MMA 10.1 on Win7-64bit. This looks like a bug within Export to me, which I think you should report to WRI. In the meantime, you can generate the frames yourself, then use ListAnimate to generate a movie for export with the same format (controls, panes) that you would get from Animate: ...

Top 50 recent answers are included