old_camera.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:yt 作者: yt-project 项目源码 文件源码
def save_annotated(self, fn, image, enhance=True, dpi=100, clear_fig=True, 
                       label_fmt=None):
        """
        Save an image with the transfer function represented as a colorbar.

        Parameters
        ----------
        fn : str
           The output filename
        image : ImageArray
           The image to annotate
        enhance : bool, optional
           Enhance the contrast (default: True)
        dpi : int, optional
           Dots per inch in the output image (default: 100)
        clear_fig : bool, optional
           Reset the figure (through pylab.clf()) before drawing.  Setting 
           this to false can allow us to overlay the image onto an 
           existing figure
        label_fmt : str, optional
           A format specifier (e.g., label_fmt="%.2g") to use in formatting 
           the data values that label the transfer function colorbar. 

        """
        image = image.swapaxes(0,1) 
        ax = self.show_mpl(image, enhance=enhance, clear_fig=clear_fig)
        self.annotate(ax.axes, enhance, label_fmt=label_fmt)
        self._pylab.savefig(fn, bbox_inches='tight', facecolor='black', dpi=dpi)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号