ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 27 Sep 2018 11:47:57 +0200How to plot a set of points?https://ask.sagemath.org/question/43723/how-to-plot-a-set-of-points/ Hello,
how can I plot an interval like [0,1] ?
Sat, 22 Sep 2018 12:26:45 +0200https://ask.sagemath.org/question/43723/how-to-plot-a-set-of-points/Answer by dazedANDconfused for <p>Hello,</p>
<p>how can I plot an interval like [0,1] ? </p>
https://ask.sagemath.org/question/43723/how-to-plot-a-set-of-points/?answer=43742#post-id-43742The documentation for Sage plotting in 2 dimensions is [here](http://doc.sagemath.org/html/en/reference/plotting/sage/plot/plot.html). From your description, I think you are talking about region_plot(). Here's an example:
x,y = var('x,y')
region_plot([x^2 + y < 1, x < y], (x,-2,2), (y,-2,2))
The region plotted consists of the points satisfying both inequalities (intersection), where x is in the interval [-2,2] and y is in the interval [-2,2].Tue, 25 Sep 2018 03:05:51 +0200https://ask.sagemath.org/question/43723/how-to-plot-a-set-of-points/?answer=43742#post-id-43742Comment by -christopher- for <p>The documentation for Sage plotting in 2 dimensions is <a href="http://doc.sagemath.org/html/en/reference/plotting/sage/plot/plot.html">here</a>. From your description, I think you are talking about region_plot(). Here's an example:</p>
<pre><code>x,y = var('x,y')
region_plot([x^2 + y < 1, x < y], (x,-2,2), (y,-2,2))
</code></pre>
<p>The region plotted consists of the points satisfying both inequalities (intersection), where x is in the interval [-2,2] and y is in the interval [-2,2].</p>
https://ask.sagemath.org/question/43723/how-to-plot-a-set-of-points/?comment=43781#post-id-43781Thank you for your answer :)Thu, 27 Sep 2018 11:47:57 +0200https://ask.sagemath.org/question/43723/how-to-plot-a-set-of-points/?comment=43781#post-id-43781Answer by tmonteil for <p>Hello,</p>
<p>how can I plot an interval like [0,1] ? </p>
https://ask.sagemath.org/question/43723/how-to-plot-a-set-of-points/?answer=43731#post-id-43731I am not sure about your question, but you can do:
sage: line2d([(0,0),(1,0)], xmin=-2, xmax=2, thickness=2)
Sun, 23 Sep 2018 18:05:15 +0200https://ask.sagemath.org/question/43723/how-to-plot-a-set-of-points/?answer=43731#post-id-43731Comment by -christopher- for <p>I am not sure about your question, but you can do:</p>
<pre><code> sage: line2d([(0,0),(1,0)], xmin=-2, xmax=2, thickness=2)
</code></pre>
https://ask.sagemath.org/question/43723/how-to-plot-a-set-of-points/?comment=43732#post-id-43732sorry I have not described my question good enough. I'm looking for something like: plot all points (x,y) for which x is in interval A and y is interval B. I would like to define a set of Points (x,y) by some rules, maybe do some set operations like intersection on it, and finally plot it.Sun, 23 Sep 2018 18:23:57 +0200https://ask.sagemath.org/question/43723/how-to-plot-a-set-of-points/?comment=43732#post-id-43732