TextPlots.jl icon indicating copy to clipboard operation
TextPlots.jl copied to clipboard

3D plots?

Open waldyrious opened this issue 11 years ago • 6 comments

Not sure if there's anything from http://syzygy.virtualave.net/webwork/javascript/plotter.htm that can be of use to TextPlot.jl, but I thought I'd at least make a mention of it.

Particularly, they seem to support 3D plots, which would be a nice addition.

waldyrious avatar May 23 '14 17:05 waldyrious

That is slick. I'm not sure 3d plotting would hold up in a terminal setting, but I might take a stab at it eventually. If you need that level of plotting, you should probably use Gadfly.

sunetos avatar May 23 '14 19:05 sunetos

I've thought about this more, and so far I can only come up with one semi-reasonable idea to make a 3d orthographic plot legible at such an insanely low resolution.

If instead of doing the striping on both x & y axes to show the descent into the z axis like the javascript example (and like most 3d plotting systems), we borrowed from the Mathematica-style rainbow gradient to reflect depth: dots with a higher z value would be a darker color.

We can detect if Julia is running with terminal colors enabled, and show a warning message when trying to 3d plot without running in a proper (at least ANSI 256-color) terminal.

This way, instead of a mess of dots that don't make sense, the striping would only be done at each dimension's boundaries, and at sample intervals along the z-axis.

This is pretty hard to describe correctly, so let me know if that made no sense.

sunetos avatar Sep 19 '14 18:09 sunetos

In other words, instead of properly tesselating a smooth 3d surface into quads like the other systems, we could get away with just curves that run from min Z to max Z, fading to dark as they approach max Z.

sunetos avatar Sep 19 '14 18:09 sunetos

If I understand correctly, you're talking about elevation contour lines, right? Sounds like it could work, but I assume when they get too close to each other and essentially would overlap in the same Braille character, some averaging would have to be used (similar to what's been discussed in #6) in order to preserve the color gradient effect... in any case, it'd surely worth a try :)

waldyrious avatar Sep 19 '14 19:09 waldyrious

I was assuming a left-handed coordinate system, where right on the screen is increasing X, up on the screen is increasing Y (like it is now), and diagonally into the screen is increasing Z. So I was proposing holding X & Y constant, and tracing from minZ to maxZ (going diagonally into the screen). It looks like contour lines are the opposite: holding Z constant, and tracing X at spaced Y intervals.

I really should just draw a picture. In fact I will, since I just ordered this little gadget specifically for these types of projects: http://www.myboogieboard.com/na/products/boogie-board-sync-9.html . Once it gets here early next week, I'll try to show what's in my head.

Your point about intersections is still valid though; that's a messy one.

sunetos avatar Sep 20 '14 16:09 sunetos

Oh, I see. I think I got it now, but I'm sure a diagram would make this even clearer. Looking forward to see that sketch :)

waldyrious avatar Sep 20 '14 17:09 waldyrious