Hot answers tagged

10

You can use the Antialiasing option to get what you want: image = Graphics[ { Red, Triangle[{{0, 0}, {1, 0}, {0, 1}}], Blue, Triangle[{{1, 0}, {2, 0}, {2, 1}}], Green, Triangle[{{2, 1}, {2, 2}, {1, 2}}], Yellow, Triangle[{{1, 2}, {0, 2}, {0, 1}}] }, BaseStyle -> Antialiasing -> False ] Rasterize@image


5

If you use the option Method -> "KernelDensityEstimation" in LearnDistribution, then the estimated bandwidth can be extracted. Call that value bw. (And I'm assuming that a Gaussian kernel will be used.) (* Generate some data *) SeedRandom[12345]; data = RandomVariate[NormalDistribution[0, 1], 100] (* Use LearnDistribution *) ld = ...


3

Use the graphics primitives from a2 as Prolog in Show and use the options PlotRangeClipping -> False and ImagePadding -> ... to prevent clipping: Show[a1, Prolog -> First @ a2, ImagePadding -> 70, PlotRangeClipping -> False]


2

I suppose that by "a directory in a notebook directory" you mean "the directory of the notebook where the Export is evaluated". Of course the notebook should first be saved somewhere. Then do : Export[FileNameJoin[{NotebookDirectory[], "newDirectory", "testFile55.jpg"}], ConstantImage[Red]] The "...


2

I sort of figured this out just as I was about to post, but thought I'd share in case anyone else has the same problem, since I couldn't find it on SE. However, I haven't figured it out completely, and I'd love a more comprehensive answer. One issue is that it's not an honest polyhedron: in the second argument, some of the polygonal faces are specified e.g. ...


2

The common way is making a sparse array and putting there the result at the desired place. s = SparseArray[{{11, 1} -> 1, {2, 2} -> 2, {3, 3} -> 3, {1, 13} -> 4}, {12, 15}, ""]; s // MatrixForm Than you can export it to Excel


1

adapting @Kuba's solution to a similar question. jsonExport[file_, listOfURLs_]:=FileTemplateApply[#, #2[[1]], file] & @@ Reap@ExportString[URL /@ listOfURLs, "RawJSON", "ConversionFunction" -> Function[Sow[First@#]; "``"]] . jsonExport[NotebookDirectory[] <> "file.json", {"https://www.google.com/&...


1

thegrid = Column[{Text[ Style["Table of Squares and Cubes", FontFamily -> "Comic Sans MS", FontSize -> 14, FontWeight -> Bold]], Grid[Prepend[ Table[{Style[n, Black], Style[n^2, Blue], Style[n^3, If[n <= 15, Green, Red]]}, {n, 1, 50}], {n, n^2, n^3}], Frame -> {All, {1}}, FrameStyle ...


1

Generate some fake data. I'm assuming this is what your list looks like. data = Range[100]; datap = Partition[ Partition[data, 2], 10]; Each list is of the same length, so exporting can be done with Export["filename.xlsx",MapThread[Join@##&, datap]. If, however, your lists are not all the same length: datap1 = With[{d = Partition[data, 2]}, {...


1

Generate a 501x1001 array: A = CellularAutomaton[30, {{1}, 0}, 500]; Dimensions[A] (* {501, 1001} *) Export one pixel per matrix entry: Export["~/Desktop/zebra.png", Image[Raster[Reverse[A]]]] The resulting image has exactly 1001x501 pixels, each one either black (=0) or white (=1) (opposite color scheme from ArrayPlot): If you want the ...


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