How make/hack 1D real number line plots like we learned in elementary algebra?

443 views
Skip to first unread message

Chris Seberino

unread,
Sep 7, 2011, 1:30:46 AM9/7/11
to sage-support
Sage can do great 2D and 3D plots.

What about baby 1D plots that would be really nice for the kids?

If I select a number using an interact widget, it would be nice to see
a plot of a 1D real number line with the selected point appear as a
big colored dot. Plots of solutions to inequalities like x > 1 would
be icing on the cake and involve the same big colored dot with a ray
drawn to one side.

Any examples somewhere?

Chris

kcrisman

unread,
Sep 7, 2011, 8:49:30 AM9/7/11
to sage-support
> If I select a number using an interact widget, it would be nice to see
> a plot of a 1D real number line with the selected point appear as a
> big colored dot.  Plots of solutions to inequalities like x > 1 would
> be icing on the cake and involve the same big colored dot with a ray
> drawn to one side.

This is already http://trac.sagemath.org/sage_trac/ticket/9793 (and
#8085). Interested in implementing it? :)

> Any examples somewhere?

You can do this "by hand" by using matplotlib methods to remove one of
the axes. I don't have an example on hand, but
http://trac.sagemath.org/sage_trac/ticket/9793#comment:2 has an
example, I think.

I hope this helps. If we had the manpower, this would already have
been done, I'm sure, it's such an obvious thing.

- kcrisman

Chris Seberino

unread,
Sep 7, 2011, 11:04:01 AM9/7/11
to sage-support


On Sep 7, 7:49 am, kcrisman <kcris...@gmail.com> wrote:
> > If I select a number using an interact widget, it would be nice to see
> > a plot of a 1D real number line with the selected point appear as a
> > big colored dot.  Plots of solutions to inequalities like x > 1 would
> > be icing on the cake and involve the same big colored dot with a ray
> > drawn to one side.
>
> This is alreadyhttp://trac.sagemath.org/sage_trac/ticket/9793(and
> #8085).  Interested in implementing it?  :)

Yes. I'll collect a list of these requests and take a short at it
some time.

cs

Simon

unread,
Sep 9, 2011, 6:56:08 AM9/9/11
to sage-s...@googlegroups.com
There was a discussion about plotting number lines in Mathematica on stackoverflow a while back
I don't know if any of the code there would be helpful...
Reply all
Reply to author
Forward
0 new messages