Hot answers tagged

6

Write writes expressions out in InputForm, so you really need to use WriteString With[{delimiter = " "}, helper[strm_, {x_, y_}] := WriteString[strm, x, delimiter, y, delimiter]] With[{ data = {{1, 2}, {2, 1}, {1, 3}, {4, 2}, {4, 1}}, file = FileNameJoin[{$HomeDirectory, "Desktop", "data.txt"}]}, Module[{out}, out = OpenWrite[file]; ...


6

As stated above, and based on MarcoB comments, I tested the workaround proposed by Simon Woods in Audio export issues, and it works: u1 = Import["AcqDev_0_6ch[ai0to5]_2500kHz_ai_000.wav"]; Block[{Rescale = #1 &}, Export["AcqDev_0_6ch[ai0to5]_2500kHz_ai_rot000.wav", u1]] u2 = Import["AcqDev_0_6ch[ai0to5]_2500kHz_ai_rot000.wav"]; Below are the first 100,...


4

With version 10.4.1 I get the plot rasterized (but not the legend) with your code. As a workaround you can use the Jens' trick: Export["myFig2.eps", Graphics[Inset[pl, Automatic, Automatic, Scaled[1]]]]; Here is how the exported EPS file looks when opened by Adobe Acrobat 11 (I have selected a number on the frame in order to show that it is a selectable ...


3

I think this does what you want. exportToFolder[{dir_, data : {{_, _?MatrixQ} ..}}] := With[{path = "folder" <> ToString @ dir}, CreateDirectory @ path; Export[FileNameJoin[{path, ToString @ #}], #2, "Table"] & @@@ data; ] Make sure you first remove the TableForm wrapper from your data: rawoutput = First @ alloutput; Then your ...


3

You can use Rasterize before exporting to a .eps file. fig = Graphics3D[{Opacity[0.5], Sphere[]}] Now Export like Export["fig2.eps", Rasterize[fig]] which will preserve the opacity in .eps. For better resolution you can use RasterSize. For comparison Export["fig1.eps", fig] Then I use them in a tex file and this is how they look in pdf Left ...


3

I'm surprised that the first example works. There is an issue with converting Tube objects to MeshRegion objects, and in fact DiscretizeGraphics fails on curve1 and curve2 alike. You can use the trick from this page, to convert to a MeshRegion before export as STL. << "http://pastebin.com/raw/3ySiwVrb" (* Import the curve2 = Graphics3D[ Rotate[...


3

I think for this kind of matrix it is better to use some of the dedicated matrix formats, like, "MTX" (of Matrix Market) or "HarwellBoeing". Below are two examples using "MTX": one with a dense 6000x6000 matrix and one with a sparse matrix. Dense matrix Mathematica mat = RandomReal[{0, 1}, {6000, 6000}]; Export["/path/RandomMat.mtx", mat, "MTX"] Python ...


3

SetDirectory[NotebookDirectory[]] (mat = RandomReal[1, {5, 5}]) // MatrixForm Export["mat.txt", mat, "CSV"] Open python and type >python Python 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2] on linux2 >>> f = open ( 'mat.txt' , 'r') >>> mat = [ map(float,line.split(',')) for line in f ] >>> print(mat) [[0....


2

Use ReadList["foo.txt"] to read Mathematica expressions SetDirectory[NotebookDirectory[]] list1 = {2 (-I Cos[\[Pi]/18] - Sin[\[Pi]/18]), 2 (-I Cos[\[Pi]/18] + Sin[\[Pi]/18]), 2 (1/2 - (I Sqrt[3])/2), 2 (Cos[(2 \[Pi])/9] - I Sin[(2 \[Pi])/9]), 2 (Cos[\[Pi]/9] - I Sin[\[Pi]/9]), {2.7297 + 0. I, -2. + 0. I, -1.89575 + 0.616863 I, -1.89575 - 0....


1

Here a two ways to save all your notebook graphics to PNG files : 1. Web page with PNG Graphics This is the quick and indirect way to do that and is actually what you tried. But as you said, by default the exported graphics in the folders are in the GIF format. To Export a notebook to a web page with all the graphics in PNG, this seems to work: Export["...



Only top voted, non community-wiki answers of a minimum length are eligible