ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 09 Oct 2017 08:48:47 -0500Visualizing Polyhedron with specified rangehttps://ask.sagemath.org/question/30561/visualizing-polyhedron-with-specified-range/I am working on visualizing an unbounded polyhedron with plot command. I have a trouble with the way the default visualizer plots the polyhedron. I would like to define range of (x,y,z) domain it visualizes as well as remove big blue arrow that indicates the direction on which the polyhedron extends to because unboundedness is obvious in my application.
The code I have used is following.
`
dd = Polyhedron(ieqs=[[0,1,-sqrt(2),0],[0,1,sqrt(2),0],[0,0,-sqrt(2),1],[0,0,sqrt(2),1]])
dd.plot(ymax=4)
`
Sun, 08 Nov 2015 07:44:04 -0600https://ask.sagemath.org/question/30561/visualizing-polyhedron-with-specified-range/Answer by jipilab for <p>I am working on visualizing an unbounded polyhedron with plot command. I have a trouble with the way the default visualizer plots the polyhedron. I would like to define range of (x,y,z) domain it visualizes as well as remove big blue arrow that indicates the direction on which the polyhedron extends to because unboundedness is obvious in my application.</p>
<p>The code I have used is following. </p>
<p><code>
dd = Polyhedron(ieqs=[[0,1,-sqrt(2),0],[0,1,sqrt(2),0],[0,0,-sqrt(2),1],[0,0,sqrt(2),1]])
dd.plot(ymax=4)
</code></p>
https://ask.sagemath.org/question/30561/visualizing-polyhedron-with-specified-range/?answer=39088#post-id-39088First, to remove the arrows, one possible way is to use `render_solid`. The following code will not draw the rays (which are by default drawn as arrows).
sage: QF.<a> = QuadraticField(2)
sage: dd = Polyhedron(ieqs=[[0,1,-a,0],[0,1,a,0],[0,0,-a,1],[0,0,a,1]])
sage: dd.render_solid()
Second, to get a bigger picture, there is a work around by multiplying the rays by a certain scalar.
sage: dd2 = Polyhedron(rays = [100*r.vector() for r in dd.rays()])
sage: dd2.render_solid()
This is not as clean as specifying the ranges on each axis, but is a start.
Currently, to plot the polyhedron object, it uses the data of the polyhedron and it is not (yet) possible to set a certain range for the axis.
Mon, 09 Oct 2017 08:48:47 -0500https://ask.sagemath.org/question/30561/visualizing-polyhedron-with-specified-range/?answer=39088#post-id-39088