Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf821bf6

Browse files
committed
PGF backend: slightly simplify image drawing
1 parentbe54fae commitf821bf6

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

‎lib/matplotlib/backends/backend_pgf.py‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -640,17 +640,13 @@ def draw_image(self, gc, x, y, im, transform=None):
640640
writeln(self.fh,r"\begin{pgfscope}")
641641
self._print_pgf_clip(gc)
642642
f=1./self.dpi# from display coords to inch
643+
writeln(self.fh,r"\pgftext[at=\pgfqpoint{%fin}{%fin},left,bottom]{"% (x*f,y*f))
643644
iftransformisnotNone:
644645
tr1,tr2,tr3,tr4,tr5,tr6=transform.frozen().to_values()
645-
# scale is already included in the above transform
646-
w,h=1,1
647-
# translation can be merged into this transform (makes it easier)
648-
tr5+=x
649-
tr6+=y
650-
x,y=0,0
651-
writeln(self.fh,r"\makeatletter\pgfsys@transformcm{%f}{%f}{%f}{%f}{%fin}{%fin}\makeatother"% (tr1,tr2,tr3,tr4,tr5*f,tr6*f))
646+
w=h=self.dpi# scale is already included in the transform
647+
writeln(self.fh,r"\pgfsys@transformcm{%f}{%f}{%f}{%f}{%fin}{%fin}"% (tr1*f,tr2*f,tr3*f,tr4*f,tr5*f,tr6*f))
652648
interp=str(transformisNone).lower()# interpolation in PDF reader
653-
writeln(self.fh,r"\pgftext[at=\pgfqpoint{%fin}{%fin},left,bottom]{\pgfimage[interpolate=%s,width=%fin,height=%fin]{%s}}"% (x*f,y*f,interp,w*f,h*f,fname_img))
649+
writeln(self.fh,r"\pgfimage[interpolate=%s,width=%fin,height=%fin]{%s}}"% (interp,w*f,h*f,fname_img))
654650
writeln(self.fh,r"\end{pgfscope}")
655651

656652
defdraw_tex(self,gc,x,y,s,prop,angle,ismath="TeX!",mtext=None):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp