Scipy - Latex Annotations in plots

F

fortuneteller

Hello,

I'm quite new to python and Scipy.
Anyway I want to use it to plot graphs.
Does anybody know if there is the possibility to use Latex in SciPy's
plotting functions like gplt?

Thanks for your help,

Matthias
 
R

Robert Kern

fortuneteller said:
Hello,

I'm quite new to python and Scipy.
Anyway I want to use it to plot graphs.
Does anybody know if there is the possibility to use Latex in SciPy's
plotting functions like gplt?

I don't believe so. matplotlib, however, does have this functionality in
recent releases.

--
Robert Kern
(e-mail address removed)

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
 
M

Matthias R.

Unfortunately matplotlib is only a 2D-plotting library.

Do you know another one with 3D-capabilities as well?
That would be very nice,

thank you,

Matthias
 
B

Bill Mill

Robert said:
Unfortunately matplotlib is only a 2D-plotting library.

Do you know another one with 3D-capabilities as well?
That would be very nice,

Perhaps gnuplot.py (http://gnuplot-py.sourceforge.net/) will work for
you? It is a thin wrapper around Gnuplot, which is very good at
producing ps format images, and is capable of producing 3 dimensional
graphs.

Peace
Bill Mill
bill.mill at gmail.com

PS please try to not top-post, you can lose the rest of the thread easily
 
R

Robert Kern

Matthias said:
Unfortunately matplotlib is only a 2D-plotting library.

Do you know another one with 3D-capabilities as well?

There's PyX.
That would be very nice,

Yes, yes it would.

--
Robert Kern
(e-mail address removed)

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
 
F

Francisco Borges

Robert said:
There's PyX.

Sorry, PyX can't do 3D plots.

-----------

I like PyX, use it a lot and would suggest it as a beter plotting
library than the ones at Scipy (for as long as you don't need on-screen
plotting).

I just saw matplotlib this week while searching for something that
would do 3D, it seemed pretty nice and it does have many more features
than PyX, is certainly more mature than PyX and more high level.

On the other hand PyX: LaTeX support seems to be way ahead and it can
be used to draw (very funky) figures.

My experience with PyX is that:

1. it takes more lines of code (than what I fell is needed) to do it;
2. it (still) lacks easy ways to do frequent things (like filling)
3. but once you got it done; the figures/plots are *PERFECT*.

Over PyX you must also be aware that:

a) PyX can't (yet) do pie-charts.

b) No, Pyx can't plot 3D (yes, despite using a 3D plot at their
webpage, it does *not* plot 3D).

c) Documentation can be very confusing at times, so start at the
examples;

d) PyX is not stable yet, the last 3 (or 2?) PyX releases were all
backwards incompatible.

Cheers,
Francisco
 
F

Francisco Borges

Francisco said:
1. it takes more lines of code (than what I fell is needed) to do it;
2. it (still) lacks easy ways to do frequent things (like filling)

Sorry, I just realised the piece of nonsense I just wrote...

PyX does fill objects very easily, what it does take lot's of work to
do is to fill the intersection of two objects, or the intersection of a
plot line and some chosen axis. Or is it just that I myself haven't
learned how to do that properly....

Cheers,
Francisco
 
B

Brian Elmegaard

Matthias R. said:
Unfortunately matplotlib is only a 2D-plotting library.

Do you know another one with 3D-capabilities as well?
That would be very nice,

You can quite easily write a function that produces metapost
code. Featpost is the best 3d-lib for that, afaik.

The good thing is that you get plot that work in both latex and
pdflatex and integrates completely with latex text.
 
F

Fernando Perez

Francisco said:
I like PyX, use it a lot and would suggest it as a beter plotting
library than the ones at Scipy (for as long as you don't need on-screen
plotting).

FWIW, the plotting support in scipy is essentially unmaintained and abandoned,
since the advent of matplotlib. It hasn't been officially deprecated, though
I'm wondering if perhaps we should do that just to save users the aggravation.
I just saw matplotlib this week while searching for something that
would do 3D, it seemed pretty nice and it does have many more features
than PyX, is certainly more mature than PyX and more high level.

I use both extensively, so I can comment a bit: matplotlib is a fantastic
_plotting_ library, and it has very extensive support for doing all kinds of
plotting-related things easily and with high output quality. As of v. 0.82,
its latex support is on-par with Pyx's, since now you can set it to do _all_
your text rendering (including ticks, numbers, etc.) via latex. It gets a bit
slower (much like pyx), but the quality is perfect (it's true latex running
underneath).

Besides, matplotlib provides widgets for on-screen rendering and embedding into
GUI applications, something which can be very important, and outside pyx's
domain of interest.

Where pyx shines is for generating what I call 'diagrams' for lack of a better
term: drawings that don't fall well into the model of 'plot these data points
at these coordinates' but that rather involve algorithmically-driven
positioning of geometric elements. This power is best seen (despite my poor
description) by just looking at the pyx examples page, which shows how even
relatively complex diagrams can be done in pyx with very little code, and give
stunning results.

While you can plot with pyx, and draw with matplotlib, I feel that they each
have their strengths, and I use both. I love both, and I feel they complement
each other extremely well.

For 3d plotting in python, VTK and mayavi are my workhorses, and I'm quite
happy with that solution so far.
On the other hand PyX: LaTeX support seems to be way ahead and it can
be used to draw (very funky) figures.

[have a look at recent matplotlib for proper latex]

Cheers,

f
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top