question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Think of better API to set plotting frame for 2D figures

See original GitHub issue

Currently, we can set frame by passing *Orbit.pqw() in set_frame which is not user friendly and not intuitive.


Current status as of the last edit:

  • We still don’t have a fine control over the plane, there are only two options available. Do we want/need to add more?
    • Or should I say three? At this point I’m not even sure Planes.BODY_FIXED should be a “plane”.
  • Even if we can set the plane, we can’t set the reference direction directly: only using .set_orbit_frame or .set_body_frame (which at the moment calls *orbit.pqw(), but that’s an implementation detail). Do we want a method to change this?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
astrojuanlucommented, Apr 12, 2020

This was addressed in #891:

This adds a new method to all orbit plotters, plot_body_orbit, that “Plots complete revolution of body and current position if given”, and another two for 2D orbit plotters, set_orbit_frame and set_body_frame. The former avoids calling Orbit.from_body_ephem (about to be removed), and the latter avoid the need to call set_frame(*orbit.pqw()), which is ugly, impossible to understand, and in general shouldn’t be there.

Now all the details about how the frame is set are hidden inside these functions, which frees us from refactoring them internally while maintaining this new API, which I think is acceptable. OrbitPlotter2D.set_frame and its static counterpart are deprecated now.

On the other hand, our original objective, which was producing plots in the Geocentric Solar Ecliptic frame that you added in #562, is a little bit closer, because the fundamental plane of GSE happens to be the same as Planes.EARTH_ECLIPTIC. However:

  • We still don’t have a fine control over the plane, there are only two options available. Do we want/need to add more?
    • Or should I say three? At this point I’m not even sure Planes.BODY_FIXED should be a “plane”.
  • Even if we can set the plane, we can’t set the reference direction directly: only using .set_orbit_frame or .set_body_frame (which at the moment calls *orbit.pqw(), but that’s an implementation detail). Do we want a method to change this?

I am changing the title (and scope) of this issue to reflect the current status.

1reaction
astrojuanlucommented, May 5, 2019

We should remove this pqw stuff, it’s just a hack. Too inconsistent and fragile to be generally useful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

2D and 3D plotting tutorial in Python - Kaggle
Matplotlib is an excellent 2D and 3D graphics library for generating scientific figures. Some of the many advantages of this library include:.
Read more >
Visualizing Data with the Spatially Enabled DataFrame
You can quickly visualize the points by calling the plot() method off the DataFrame 's spatial accessor and passing the map you created...
Read more >
Chapter 4. Visualization with Matplotlib - O'Reilly
Matplotlib is a multiplatform data visualization library built on NumPy arrays, and designed to work with the broader SciPy stack. It was conceived...
Read more >
Plotting in PyQt5 — Using PyQtGraph to create ... - Python GUIs
Create custom plots in PyQt with PyQtGraph. ... However, PyQtGraph provides an API for using these to draw plots and manage the plot...
Read more >
Chart visualization — pandas 1.5.2 documentation - PyData |
We provide the basics in pandas to easily create decent looking plots. See the ecosystem section for visualization libraries that go beyond the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found