autoplot / python

bridge from python, using jpype
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

add plotting demos to python API #1

Closed jbfaden closed 2 weeks ago

jbfaden commented 5 years ago

Bob requested that the API presented to Python would include some plotting as well. I've never done this in IDL and Matlab, but it should be easy to do.

jbfaden commented 4 years ago

I've made it so the pip autoplot package now includes the bridge to Autoplot, so you can say "applot([...],[...])".

rweigel commented 4 years ago

What was the commit id? Probably want to add a demo too.

I'd make the function name "plot" and use at as either

import autoplot as ap # Should be more common usage
ap.plot(...,...) # should call ap.javaaddpath() as needed

or

from autoplot import plot
plot(...,...) # should call ap.javaaddpath() as needed
jbfaden commented 4 years ago

The problem with automatically calling javaaddpath automatically is how is the jar path specified? I thought of including a no-args version of javaaddpath which would use a default (http://autoplot.org/latest/autoplot.jar) version, or maybe an environment variable.

jbfaden commented 4 years ago

Originally I had an applot which would use the jpype version of Java, the one running in the session. The problem with this is Macs have the strange issue where they can't bring up GUIs, but also I found that on Linux exiting Autoplot exits the entire python session. So the new version of applot (I used the name from the IDL version) serializes the data and sends a plot command to a running external Autoplot session.

jbfaden commented 1 year ago

I'll add an example of how to plot from Python into Autoplot here: https://github.com/autoplot/python/wiki

jbfaden commented 2 weeks ago

This was done in 2023.