<div dir="ltr"><div><div><div>I see what you mean. There have been some people asking for that feature. And there is some preliminary support for it built in, in fact. In mplot3d.proj3d, there is:<br>```<br>def persp_transformation(zfront, zback):<br>    a = (zfront+zback)/(zfront-zback)<br>    b = -2*(zfront*zback)/(zfront-zback)<br>    return np.array([[1,0,0,0],<br>                     [0,1,0,0],<br>                     [0,0,a,b],<br>                     [0,0,-1,0]<br>                     ])<br>```<br><br></div>However, I haven't looked into integrating it into mplot3d (pull requests are welcomed). Some people have done some hacking, but I never heard back on the results of it. I think if you search the mailing list archives for perspective projection, you might find some tidbits.<br><br></div>Seriously, projections are not my specialty, so pull requests would be greatly welcomed!<br><br></div>Ben Root<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Apr 17, 2016 at 12:17 PM, Eric Gayer <span dir="ltr"><<a href="mailto:egayer@gmail.com" target="_blank">egayer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi Ben,<div><br></div><div>Thanks for your answer, maybe I didn’t well explained what I was looking for, I did play around with ax.view_init() but there is no elevation or angle that change anything in the way the perspective is presented.</div><div>What I am looking for is to find a way (and I am actually not sure it is possible) to change apparent depth of the 3D view.</div><div>I attached an image that show the difference between the two representations (persp() and plot_wireframe with ax_init(60,30))</div><div>We feel a greater depth with the R figure than with matplotlib. Closest thing seems bigger in the R plot. Comparing R plot to Matplolib plot it is like comparing perspective view to orthographic view.</div><div><br></div><div>I hope you see what I mean :) I don’t really know how to explain it actually.</div><div>Basically it would be awesome if we could change something like the perspective factor with matplotlib, so we could chose how big would appear closest things and then how small would appear farthest things.</div><div><br></div><div>Thanks again for your help</div><div>Eric</div><div><br></div><div><img src="cid:B8262ED2-3D14-4C4D-866B-9A9781FE47B1@ipgp.fr" height="530" width="910"></div><div><div class="h5"><div><br></div><div><br><div><div>On Apr 17, 2016, at 4:51 PM, Benjamin Root <<a href="mailto:ben.v.root@gmail.com" target="_blank">ben.v.root@gmail.com</a>> wrote:</div><br><blockquote type="cite"><div dir="ltr"><div><div><div><div>Sorry for the long delay in replying. It seems like your email got held up on the listserve.<br><br></div>Looking at perps(), it seems like it is just doing ax.plot_wireframe() and some camera angle settings, which can be set via ax.view_init():<br><br>|  view_init(self, elev=None, azim=None)<br>|      Set the elevation and azimuth of the axes.<br>|      <br>|      This can be used to rotate the axes programatically.<br>|      <br>|      'elev' stores the elevation angle in the z plane.<br>|      'azim' stores the azimuth angle in the x,y plane.<br>|      <br>|      if elev or azim are None (default), then the initial value<br>|      is used which was specified in the :class:`Axes3D` constructor.<br><br></div>Does that help?<br><br></div>Cheers!<br></div>Ben Root<br><br><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 21, 2016 at 5:37 AM, Eric Gayer <span dir="ltr"><<a href="mailto:egayer@gmail.com" target="_blank">egayer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">Hi all, <div>I am not sure this is the right place for my question, but I don’t really know where to ask…</div><div>I would like to know if there is a chance for matplolib to provide the same 3D plot perspective as the perp() function in R or from the  plot3D package from Karline Soetaert (based on persp()) in R</div><div><br></div><div><a href="http://www.r-bloggers.com/creating-surface-plots/" target="_blank">http://www.r-bloggers.com/creating-surface-plots/</a></div><div><br></div><div><a href="http://www.r-bloggers.com/3d-plots-in-r/" target="_blank">http://www.r-bloggers.com/3d-plots-in-r/</a></div><div><br></div><div> I found nothing on how to change perspective aspect in mplot3d. I am afraid it is not possible to work on the depth of the perspective in a mplot3d plot, is anyone knows how to do it ?</div><div><br></div><div>Does anyone think it would be possible in a near future ? </div><div><br></div><div>Thanks</div><span><font color="#888888">Eric</font></span></div><br>_______________________________________________<br>
Matplotlib-users mailing list<br>
<a href="mailto:Matplotlib-users@python.org" target="_blank">Matplotlib-users@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/matplotlib-users" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/matplotlib-users</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div></div></div></div></blockquote></div><br></div>