Tag Info

Hot answers tagged

16

Animations as interactive visualizations The simplest form of interactive graphics is an animation in which the play head can be moved by the user. That doesn't sound very interactive, but in terms of functionality the play head is nothing but a type of Slider. With this simple interpretation of interactivity, any movie format supported by Export would be ...


8

Yes, you can indeed convert the output to a graphics object before exporting it. I wrote a function for that in this answer, and it works with SVG too: outlinedExport[name_, gr_, opts : OptionsPattern[]] := Export[name, First@ImportString[ExportString[gr, "PDF"], "PDF", "TextMode" -> "Outlines"], opts] res = Solve[x^2 + a x + 1 == 0, x] ...


6

Although I do see a difference between the contents of bad.svg when I export with version 8.0.4 and 9.0.1, the svg is displayed in exactly the same way by Google Chrome. The display does indeed show a white background in Safari, though, when exported from Mathematica 8.0.4 on OS X. So we could now argue whether this is the fault of the browser, or the fault ...


6

This is the reply from Wolfram Research Technical Support [CASE:631799]: After consultation with a developer, there is nothing really that can be done with the Export function directly in terms of simplifying the group structure of SVG files. You may be able to develop some system by programmatically parsing the file down, but this would likely ...


5

First, let me tell you that following your code my output is quite different. g=Graphics[{Disk[{-1,0},1/2],Rectangle[]}]; ExportString[g,"SVG"] Output <?xml version="1.0" encoding="UTF-8"?> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="361pt" height="223pt" viewBox="0 0 361 223" version="1.1"> <g ...


4

The short answer is no, there is no straightforward (built-in) way to convert Mathematica's dynamic objects to non-proprietary HTML+SVG/JS. To see why, consider how you might try ti represent the following very simple example in HMTL/SVG? Manipulate[With[{pts = {#, Sin[a*#]} & /@ (x /. Quiet[Solve[Sin[a*x] == b*AiryAi[-x] && 0 < x < 10, ...


3

I just answered a related question where I posted an SVG export function that fixes the scaling problems. At least that's what I conclude from the following tests: First load the definitions for svgExport from the answer linked here. Create a plot and export it like this: p = Plot[Sin[x], {x, 0, 2 Pi}]; svgExport["plot.svg", p, AspectRatio -> Full] ...


2

Mathematica does not put information about width and height into <svg> tag, but the first group contains a filled rectangle (<rect fill ...>) that does have width and height. You may extract width and height attributes from that <rect> and assign them to the root <svg> element.


2

After some experimentation, I discovered that the issue preventing svgExport from working was that string replacements which add attributes caused multiple copies of the width and height attributes to be inserted. To avoid that, I rewrote it to use rule replacements on the symbolic representation of the XML instead of string replacement. The result is rather ...


1

This is not supposed to happen, but indeed the SVG output is rasterized. It happens when you use DensityPlot, but not with ContourPlot (in version 8 at least). So I think this is a bug. To keep the axes as vector graphics, I would suggest my answer here as a work-around.



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