Dan Drake wrote: > On Thu, 02 Apr 2009 at 10:33PM +0200, Florent Hivert wrote: >> One thing which is very useful in algebraic combinatorics (or maybe >> more modestly in my team), is to have printed out formulas with >> pictures in it. By picture in include 2D arrays as well as trees, >> graphs... In MuPAD we had a way to get very handy uglyprint asciiarts: > > I would love this too! > > [...] >> It would be very useful to a way to get such outputs in sage. By such >> outputs I don't mean asciiart, but any formulas involving pictures. As >> show on the picture it seems that I can get this in emacs via latex / >> sage-view. So my question is: can anyone direct me to a start of a >> path to have these in the notebook ? > > Along similar lines is something I've been thinking about, which is > support for producing TikZ code from Sage objects so that we can easily > produce lovely TeX graphics. TikZ is a bit like PSTricks, but with > much wider support and better syntax; see [1] and [2] for examples of > what TikZ can do.
I've been wanting this for a long time too. Also, it would be great if matplotlib had a pgf/tikz backend, for example. I did some playing around with writing one based on the ps backend, but only got a little ways along. There have been posts on the matplotlib mailing list about this too. For the notebook, it would be nice to output some sort of html5/canvas code or some svg code inside of a div. I think that might be enough to have nice graphics in output in the notebook. > > I would like to see Sage objects be able to spit out a reasonable TikZ > representation. For example, the integer partition [4,4,2,1] might > produce: > > % part: 4 > \draw (0,0) rectangle (1,-1); > \draw (1,0) rectangle (2,-1); > \draw (2,0) rectangle (3,-1); > \draw (3,0) rectangle (4,-1); > % part: 4 > \draw (0,-1) rectangle (1,-2); > \draw (1,-1) rectangle (2,-2); > \draw (2,-1) rectangle (3,-2); > \draw (3,-1) rectangle (4,-2); > % part: 2 > \draw (0,-2) rectangle (1,-3); > \draw (1,-2) rectangle (2,-3); > % part: 1 > \draw (0,-3) rectangle (1,-4); > > which would produce the typical (English convention) Ferrers diagram. > The above code can be put inside \begin{tikzpicture} ... > \end{tikzpicture}. > > It would be nice to be able to output combinatorial objects as in > Florent's message above, and also plots and other graphical objects. > I've had these ideas for a while, but have never really done anything > with them, and they seem to be related to implementing ASCII graphics > for the command line. > > Dan > > 1. http://mathsci.kaist.ac.kr/~drake/pdf/lineary-sys-stability.pdf This link doesn't seem to work for me: "The requested URL /~drake/pdf/lineary-sys-stability.pdf was not found on this server." Thanks, Jason --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---