Comments (1)
See EllipticalFrame
implementation here
class EllipticalFrame(BaseFrame):
"""
An elliptical frame.
"""
spine_names = "chv"
def update_spines(self):
xmin, xmax = self.parent_axes.get_xlim()
ymin, ymax = self.parent_axes.get_ylim()
xmid = 0.5 * (xmax + xmin)
ymid = 0.5 * (ymax + ymin)
dx = xmid - xmin
dy = ymid - ymin
theta = np.linspace(0.0, 2 * np.pi, 1000)
self["c"].data = np.array(
[xmid + dx * np.cos(theta), ymid + dy * np.sin(theta)]
).transpose()
self["h"].data = np.array(
[np.linspace(xmin, xmax, 1000), np.repeat(ymid, 1000)]
).transpose()
self["v"].data = np.array(
[np.repeat(xmid, 1000), np.linspace(ymin, ymax, 1000)]
).transpose()
super().update_spines()
def _update_patch_path(self):
"""Override path patch to include only the outer ellipse,
not the major and minor axes in the middle.
"""
self.update_spines()
vertices = self["c"].data
if self._path is None:
self._path = Path(vertices)
else:
self._path.vertices = vertices
def draw(self, renderer):
"""Override to draw only the outer ellipse,
not the major and minor axes in the middle.
FIXME: we may want to add a general method to give the user control
over which spines are drawn.
"""
axis = "c"
pixel = self[axis]._get_pixel()
line = Line2D(
pixel[:, 0],
pixel[:, 1],
linewidth=self._linewidth,
color=self._color,
zorder=1000,
)
line.draw(renderer)
from mocpy.
Related Issues (20)
- MOC overlap with a MRM: calculation of proba in the intersection HOT 14
- MOCServer Cancells request on HST coverage (MOC too big) HOT 3
- MOC sky area HOT 5
- mocpy probability calculation when using multiprocessing HOT 21
- garbage collector stumbles when a MOC is pickled
- Parallelized (on the Rust side) MOC generation HOT 25
- Remove deprecated plot methods
- Multiple Subplotting Issue/help HOT 4
- PyPI wheels for manylinux2014 x86_64 HOT 3
- from_vizier_table returns empty MOC silently on incorrect table names HOT 4
- Max, min, median, average Distance in a region HOT 10
- Support of numpy 2.0 HOT 1
- JSON serialization of empty space MOC fails HOT 2
- moc.union(moc1, moc2) fails with TypeError HOT 5
- `from_healpix_cells` no longer allows HEALPix cells with index 0 HOT 3
- MOC.from_astropy_regions doesn't work with boxes with height > width HOT 1
- Support regions.Regions HOT 1
- Switch between small cones and big cones strategy in `from_cones`
- boxes and mocpy pixels do not match HOT 2
- Add option to opt out of degrading MOCs in plots
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mocpy.