# Tag Info

## New answers tagged export

2

Since you know the dimensions of the array when you are importing it back, the quickest solution is to Flatten the array before you export it as a MAT file, and then ArrayReshape it back when you want to use it. testArray = Array[#1 + #2 - #3 - #4 &, {1, 1, 2, 2}] (* {{{{0,-1},{-1,-2}}}} *) Export["test.mat", testArray] Export::type: ...

1

How I'd do it: pts = {{0.504, 2.79}, {0.519, 2.7773}, {0.5349, 2.7642}, {0.5504, 2.7515}, {0.5666, 2.7398}, {0.5858, 2.7341}, {0.5914, 2.8566}, {0.5917, 2.8364}, {0.5918, 2.8766}, {0.5924, 2.8164}, {0.5933, 2.7963}, {0.5935, 2.7525}, {0.5935, 2.8966}, {0.594, 2.7763}, {0.5974, 2.9163}}; (* reordering *) pts = ...

3

If you highlight all the brackets on the right side of what you want, and then do File->Save Selection As you should get this. nb = CreateDocument[{TextCell["PDF Test", "Section"], {Table[PieChart@Range@5, {7}]} // TableForm}]; I transposed the list so it reads left to right and put it in table form to get rid of the brackets. nb = ...

4

You need to set the page size as well as the paper size. I can only test this in V10.1 but it works: nb = CreateDocument[{TextCell["PDF Test", "Section"],Table[PieChart@Range@5, {7}]}]; SetOptions[nb, PrintingOptions -> {"PaperOrientation"->"Landscape","PageSize" -> {1296, 864}, "PaperSize" -> {1296, 864}}]; SetOptions[nb, ...

1

With some modifications. nb = CreateDocument[ Column[{TextCell["PDF Test", "Section"], GraphicsRow[Table[PieChart@Range@5, {7}], ImageSize -> 700]}]];

1

I think your problem is with your "Text" specification, rather than with the CharacterEncoding specification. It appears that, when you use "Text", exporting / importing defaults to trying to work with plain text (e.g. ASCII), which fails in the case of special characters. This shows that specifying "Text" is equivalent to asking for {"Text", "Plaintext"}: ...

0

In version 10.2 (perhaps going back to 10.0, but I cannot verify that), by default STL's are imported as MeshRegion objects. Assuming that casefn is a string representing the path to an STL file, you can see all the elements available for import from the file Import[casefn, "Elements"] (*{"BinaryFormat", "BoundaryMeshRegion", "Comments", ...

1

From the documentation of InterpolatingFunction, section "properties and relations": InterpolatingFunction does a Piecewise polynomial interpolation and then comes the code to get those polynomials. After running the first two lines of your code I do (just for the x-coordinates): pts = First /@ pts[[path]]; pts = {#, pts[[#]]} & /@ ...

1

The way curve is built is by using a parameter $t$ corresponding to indexes in list: $(t_i,(x_i,y_i))_{i=1,\dots,n}$ where $t_i=i$ and $x_i=x(t_i)$, $y_i=y(t_i)$. Hence, curve[i] give the coordinates of point $i$. What I did is reconstruct two third order polynomials (func) on each interval $[i,i+1]$ and identify their 4 coefficents by solving the system ...

13

From the PDF file definitions (7.5.4 - 7.5.6) you don't need to modify the inner structure of a PDF file to make changes, its enough to append the new definitions of the components (New or old) and suitable cross-reference section with pointers to the shift positions of some relevant components for random access. Here I attempt some code to do all the work ...

4

I suspect that the fuzziness you see might not be caused by rasterization, but rather by antialiasing applied to the ArrayPlot markers. Anti-aliasing makes the edges of small graphical elements fuzzy to avoid jaggedness, and it is typically a good thing that generates visually pleasing results. In your case, however, the very small plot markers present in a ...

5

The culprit here is not the legends, it is your usage of Opacity for one of the PlotStyle directives. EPS does not support opacity. Instead of warning you or simply ignoring the directive mathematica chooses to rasterize the whole image. (And evidently using a lossy compression no less ) FYI you can do this to see if you have an embedded raster in the eps: ...

-1

I see no difference in the two plots. Mathematica 10.2 on Windows 10 x64

22

The package and all code of this answer can be found on my GitHub account. A solution that takes only small amount of time is to follow this route: take the first usable java library for accessing and changing PDF files you find do one of the following: write a small amount of Java code to create a simple interface to the functionality (if you are ...

3

The answers in the duplicate link go into the right direction but would still not suffice. This is from the answer by andre given here: http://mathematica.stackexchange.com/a/19503/29305 toEString[dat_] := If[dat == 0., "0.0000000000000000+E00", MantissaExponent[dat] // With[{mantissa = #[[1]], exponent = #[[2]]}, { If[mantissa < ...

3

I don't think that this is possible at the moment, although I'd love to be corrected on this one. As it happens, essentially the same question has been asked before on the Wolfram Community (Can I create a movie including synchronized sound?), as a followup to a question asked in the comments section of an older Mathematica Q&A: Creating Movie Files. ...

1

(*add a new entry*) file = "C:\\Users\\Ali\\Desktop\\database.csv"; str = OpenAppend[file]; asp = StringJoin["ASP", "9"]; sequence = "CGTCAATGGCATGATCGAT"; description = "the foursome are combined to make 16some"; Catch[If[MemberQ[ReadList[file][[All, 1]], asp], Throw["The construct is already part of the list"], Put[{asp, sequence, description}, str]]] ...

1

Your sample spdat generated from random numbers is of course likely to be just an example for this question, but nonetheless in the interest of thoroughness I would like to point that in the literal case you cannot be sure to recover your spdat from spmat, because your spdat may contain duplicate directives, only one of which is retained when you generate ...

4

Using Export directly "just works": In[23]:= mat = SparseArray[DiagonalMatrix[2^Range[0, 10]]]; In[24]:= file = Export[CreateTemporary[], mat, "Package"]; In[25]:= FilePrint[file] During evaluation of In[25]:= (* Created with the Wolfram Language : www.wolfram.com *) SparseArray[Automatic, {11, 11}, 0, {1, {{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, {{1}, ...

2

Here are two different ways of getting spdat from spmat: Join[#[[1]], {#[[2]]}] & /@ (ArrayRules[spmat]) or (this is chuy's suggestion) MapThread[Append, {#["NonzeroPositions"], #["NonzeroValues"]}] &@spmat

3

To directly answer the question (Not to say its a good idea) you can do something like this: raster = Rasterize[Show[fig3, Frame -> False], ImageSize -> {300, 300}]; Graphics[{Inset[raster, {0, 0}, {150, 30}, 20]}, PlotRange -> {{-10, 10}, {0, 200000}}, Frame -> True, Axes -> False, LabelStyle -> Directive[Black, FontSize -> ...

6

You have expressed two really BAD ideas: Export to outdated WMF format and edit the vector figure in PowerPoint which is not intended for editing vector graphics. With WMF you get low quality and most probably distorted figure, and when you edit it in MS Office you obtain just a junk instead of the original figure. Do not edit vector figures in MS Office! ...

Top 50 recent answers are included