The way matplotlib does its MathText rendering is 1) incomplete (we don't
support all of MathTex), and 2) has *massive* overhead (relatively
speaking). Matplotlib is intended for producing figures with many disparate
components. The amount of code it takes to just generate a simple plot is
fairly significant (along with also firing up a python interpreter).
Meanwhile, MathJax is much lighter in the sense that all it needs to do is
parse a string and render out font characters.

As for matplotlib vs. MathJax, you will likely sending bitmaps to OpenGL
(if possible) anyway because that is pretty much what you will need to do
with matplotlib as well as MathJax. It is technically possible to obtain
the stroke data to send the font lines to OpenGL, but it will not look the
same as it would if you let a font renderer generate the bitmap. There are
a few reasons why matplotlib does not have an OpenGL backend yet, one of
them is because OpenGL does a terrible job in rendering text.

This is not to say that what you are thinking of doing is impossible to do.
It may be quite possible, but given that no one (that I am aware of) have
managed to get matplotlib running on a mobile OS, you have a huge
undertaking ahead of you just to get started. And, once you get there, it
is quite likely that the performance won't be what you need. In addition,
you might not like the resulting render. More power to you if you can get
it working, and I know many people who are interested in getting that stack
working on tablets and such.

On the other hand, there are plenty of documentation on how to build mobile
apps that take advantage of javascript-based technologies. Your startup
cost is very low here. And given that you will likely going to need to use
bitmaps anyway, it might not be all that bad of an option. I have no clue
what the performance penalty of firing up a javascript renderer on a mobile
OS, but in the face of the unknown, I avoid guessing. Don't fall victim to
premature optimization. I have been very surprised at how fast certain
(slow) technologies can be.

A minimalist LaTeX distro is an intriguing idea. I have no clue how much
effort it would take to do that, but that may be quite feasible.

Best of luck to you, and I look forward to finding out what you manage to
get working.

Cheers!
Ben Root

On Fri, Jul 10, 2015 at 4:37 AM, asiga <asigan...@yahoo.com> wrote:

> Why do you suggest MathJax? I assume Javascript will be less efficient than
> Python. Moreover, I'm not sure I can get the MathJax output as polygonal
> primitives that I can send to OpenGL. And, to complicate things, you cannot
> use JIT Javascript engines on iOS such as V8, due to sandboxing.
>
> In fact, I'm considering to build myself a minimal LaTeX distro. Maybe that
> would be the best option.
>
>
>
>
>
> --
> View this message in context:
> http://matplotlib.1069221.n5.nabble.com/Efficient-matplotlib-use-on-iOS-and-Android-apps-tp45901p45914.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to