本文整理汇总了Python中matplotlib.axes.Axes.set_axis_off方法的典型用法代码示例。如果您正苦于以下问题:Python Axes.set_axis_off方法的具体用法?Python Axes.set_axis_off怎么用?Python Axes.set_axis_off使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.axes.Axes
的用法示例。
在下文中一共展示了Axes.set_axis_off方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TelescopeEventView
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import set_axis_off [as 别名]
class TelescopeEventView(tk.Frame, object):
""" A frame showing the camera view of a single telescope """
def __init__(self, root, telescope, data=None, *args, **kwargs):
self.telescope = telescope
super(TelescopeEventView, self).__init__(root)
self.figure = Figure(figsize=(5, 5), facecolor='none')
self.ax = Axes(self.figure, [0, 0, 1, 1], aspect=1)
self.ax.set_axis_off()
self.figure.add_axes(self.ax)
self.camera_plot = CameraPlot(telescope, self.ax, data, *args, **kwargs)
self.canvas = FigureCanvasTkAgg(self.figure, master=self)
self.canvas.show()
self.canvas.get_tk_widget().pack(side=tk.TOP, fill=tk.BOTH, expand=True)
self.canvas._tkcanvas.pack(side=tk.BOTTOM, fill=tk.BOTH, expand=True)
self.canvas._tkcanvas.config(highlightthickness=0)
@property
def data(self):
return self.camera_plot.data
@data.setter
def data(self, value):
self.camera_plot.data = value
self.canvas.draw()
示例2: fibers_2d_xy
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import set_axis_off [as 别名]
def fibers_2d_xy():
'''
Plot fibers in 2D section (plane XY)
'''
fig3 = figure(5)
ax3 = Axes(fig3, [.1, .1, .8, .8])
fig3.add_axes(ax3)
for i in range(0, len(sx[0])):
l = Line2D([sx[0][i] - fib.lf / 2. * cos(phi_x[0][i]), sx[0][i] + fib.lf / 2. * cos(phi_x[0][i])], \
[sy[0][i] - fib.lf / 2. * cos(phi_y[0][i]), sy[0][i] + fib.lf / 2. * cos(phi_y[0][i])], \
linewidth = .5, color = 'black')
#print i, sx[0][i], lf / 2. * cosphi_x[0][i], [sx[0][i] - lf / 2. * cosphi_x[0][i], sx[0][i] + lf / 2. * cosphi_x[0][i]], \
# [sy[0][i] - lf / 2. * cosphi_y[0][i], sy[0][i] + lf / 2. * cosphi_y[0][i]], \
# [sz[0][i] - lf / 2. * cosphi_z[0][i], sz[0][i] + lf / 2. * cosphi_z[0][i]]
ax3.add_line(l)
ax3.plot(sx, sy, 'ko', markersize = 3.0)
ax3.plot([ -spec.l_x / 2., spec.l_x / 2. ], [spec.l_y / 2., spec.l_y / 2.], 'k-', linewidth = 2)
ax3.plot([ -spec.l_x / 2., spec.l_x / 2. ], [-spec.l_y / 2., -spec.l_y / 2.], 'k-', linewidth = 2)
ax3.plot([ spec.l_x / 2., spec.l_x / 2. ], [-spec.l_y / 2., spec.l_y / 2.], 'k-', linewidth = 2)
ax3.plot([ -spec.l_x / 2., -spec.l_x / 2. ], [-spec.l_y / 2., spec.l_y / 2.], 'k-', linewidth = 2)
ax3.set_axis_off()
#ax3.set_xlim( -l_x / 2., l_x / 2. )
#ax3.set_ylim( -l_y / 2., l_y / 2. )
title('Fibers in 2D - xy')
draw()
示例3: __init__
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import set_axis_off [as 别名]
def __init__(self, fig, rect=None, *args, **kwargs):
'''
Build an :class:`Axes3D` instance in
:class:`~matplotlib.figure.Figure` *fig* with
*rect=[left, bottom, width, height]* in
:class:`~matplotlib.figure.Figure` coordinates
Optional keyword arguments:
================ =========================================
Keyword Description
================ =========================================
*azim* Azimuthal viewing angle (default -60)
*elev* Elevation viewing angle (default 30)
================ =========================================
'''
if rect is None:
rect = [0.0, 0.0, 1.0, 1.0]
self._cids = []
self.initial_azim = kwargs.pop('azim', -60)
self.initial_elev = kwargs.pop('elev', 30)
self.xy_viewLim = unit_bbox()
self.zz_viewLim = unit_bbox()
self.xy_dataLim = unit_bbox()
self.zz_dataLim = unit_bbox()
# inihibit autoscale_view until the axes are defined
# they can't be defined until Axes.__init__ has been called
self.view_init(self.initial_elev, self.initial_azim)
self._ready = 0
Axes.__init__(self, fig, rect,
frameon=True,
*args, **kwargs)
# Disable drawing of axes by base class
Axes.set_axis_off(self)
self._axis3don = True
self.M = None
self._ready = 1
self.mouse_init()
self.set_top_view()
self.axesPatch.set_linewidth(0)
self.figure.add_axes(self)
示例4: display_image
# 需要导入模块: from matplotlib.axes import Axes [as 别名]
# 或者: from matplotlib.axes.Axes import set_axis_off [as 别名]
def display_image(self):
# plot and save the image
img = self.compute_image()
# clear previous figure
self.fig.clf()
# setup plot
ax = Axes(self.fig, [0, 0, 1, 1]) # remove outer border
ax.set_axis_off() # disable axis
ax.set_xlim((self.xmin, self.xmax))
ax.set_ylim((self.ymin, self.ymax))
ax.set_xticklabels([])
ax.set_yticklabels([])
ax.imshow(img, cmap=pl.get_cmap(self.cmap), interpolation='nearest',
extent=[self.xmin, self.xmax, self.ymin, self.ymax],
origin='upper', aspect=1.0)
self.fig.add_axes(ax)