[Matplotlib-devel] Producing plots with objects

Benjamin Root ben.v.root at gmail.com
Wed Sep 27 12:38:53 EDT 2017


Tune,

That sounds like a fantastic project, and I absolutely *love* the idea! As
a low-vision person myself, I understand the need for such applications.
The last time I did anything like this for other visually-impaired
students, I used foam pads and a mixture of sand and glue to teach students
the shape of the letters of the alphabet by tracing their fingers along the
rough parts of the foam pad. Luckily, the alphabet doesn't change, so I can
just have a single set of them. But for mathematical formulas, you would
certainly need something dynamic to help with exploration of the many kinds
of mathematical formulas.

The basic idea here would be a program that would have a some plotted curve
(fetched from the object returned by the call to `plt.plot()`), and a
callback function attached to the 'button_press' event (assuming that is
what a touchscreen reports screen touches as). In the callback function,
you would have the x/y coordinates of the press event, and you would have
the curve as a stored object (either as a global or some such). You would
then calculate the distance between the x/y of the event, and the curve,
and then activate a tone (I would assume python has some sort of
sound-playing package somewhere). You can then deactivate the tone on the
'button_release' event (a second callback). There is also a 'mouse_move'
event, if I remember correctly, so you can update the tone as the finger
drags along the screen.

Let me know if you have more questions!

Cheers!
Ben Root



On Wed, Sep 27, 2017 at 1:11 AM, Thomas Caswell <tcaswell at gmail.com> wrote:

> Ben Root wrote a book on interactive figures https://www.amazon.com/
> Interactive-Applications-using-Matplotlib-Benjamin/dp/1783988843
>
> Also see the 03 tutorial on picking in https://github.com/
> tacaswell/interactive_mpl_tutorial
>
> Tom
>
> On Tue, Sep 26, 2017 at 2:16 PM Jody Klymak <jklymak at uvic.ca> wrote:
>
>> Sure you can do this, plus or minus the Windows 10 interaction which I
>> know nothing about. Once you figure to how to plot what you want, have a
>> look at:
>>
>> https://matplotlib.org/users/event_handling.html
>>
>> to see how to make the plot respond to button_press_event or
>> motion_notify_event.
>>
>> Cheers, Jody
>>
>> On 25 Sep 2017, at 2:40, Tune Kamae wrote:
>>
>> Hi,
>>
>>
>>
>> My knowledge on matplotlib is limited and may be using wrong terminology.
>>
>> However my goal is quite clear. What I don’t know is where to post my
>> question.
>>
>> If this is not the right mailing list, please forgive me and suggest the
>> right mailing list.
>>
>>
>>
>> My goal:
>>
>>    1. Make a plot with all elements accessible as objects like the one
>>    Excel produces.
>>    2. Then by touching anywhere on screen (assuming Win10 with a touch
>>    screen), one will know how close is the touch location to a curve or the
>>    x-axis.
>>    3. If such a plot can be put out, I can program for the blind
>>    students follow a line by producing sound.
>>    4. They can follow any one of multiple curves in a plot and can feel
>>    what a sinusoidal curve is.
>>
>>
>>
>> I would greatly appreciate if someone can guide me along this direction.
>>
>>
>>
>> Tune Kamae
>>
>>
>>
>> Windows 10 版のメール <https://go.microsoft.com/fwlink/?LinkId=550986>から送信
>>
>>
>>
>> _______________________________________________
>> Matplotlib-devel mailing list
>> Matplotlib-devel at python.org
>> https://mail.python.org/mailman/listinfo/matplotlib-devel
>>
>> _______________________________________________
>> Matplotlib-devel mailing list
>> Matplotlib-devel at python.org
>> https://mail.python.org/mailman/listinfo/matplotlib-devel
>>
>
> _______________________________________________
> Matplotlib-devel mailing list
> Matplotlib-devel at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20170927/aa773109/attachment.html>


More information about the Matplotlib-devel mailing list