Skip to content

matplotlib 3d interactive plot boundaries #24679

Open

Description

@SaHaddad

Hi I want to zoom in more on the plot but the curve is cutted out by a "frame" as shown in the picture below and i would like to see the curve fill all the window. I asked help on discord but couldn't get an answer any help would be greatly appreciated
image

Activity

  1. oscargus commented on Dec 15, 2022

    @oscargus
    Member

    The box aspect is fixed in 3D plots, but you can change it by calling set_box_aspect. As opposed to the 2D case, setting it to None will not make it adapt, but that seems like a reasonable request, although it will require a bit of ad-hoc since there is not a unique way to figure out how to fill the window.

  2. SaHaddad commented on Dec 25, 2022

    @SaHaddad
    Author

    @oscargus
    Sorry but what should i put in the setboxaspect thing exactly ?
    Here is my code

    from mpl_toolkits.mplot3d import Axes3D
    import math as mt
    def attracteur(x,y,z,dt):
        lx,ly,lz,=[x],[y],[z]
        t=0
        β,ρ,σ=8/3,28,10
        while t<100:
            x,y,z=(x+dt*(σ*(y-x))),(y+dt*(ρ*x-y-x*z)),(z+dt*(y*x-β*z))
            t+=dt
            lx.append(x)
            ly.append(y)
            lz.append(z)
        pl.figure()
        ax=pl.axes(projection='3d')
        ax.plot3D(lx,ly,lz,'b',linewidth=0.5)
        pl.title('')
        ax.set_ylabel('$y$')
        ax.set_xlabel('$x$')
        ax.set_zlabel('$z$')
        pl.show()

    and a video will explain itself
    2022-12-09_19-43-38.webm

  3. oscargus commented on Dec 28, 2022

    @oscargus
    Member

    Sorry, it didn't work as I expected. One can affect it, but I cannot really find a way to expand it to cover the whole frame.

    May be related with #20655

  4. QuLogic commented on Oct 10, 2024

    @QuLogic
    Member

    I think this is fixed by #27349.

  5. added this to the v3.10.0 milestone on Oct 10, 2024
  6. scottshambaugh commented on Oct 16, 2024

    @scottshambaugh
    Contributor

    I don't believe this is related to #27349 - my interpretation of the original issue is that the user wants to expand the 2D clip box to fill the entire figure, like so
    image

  7. SaHaddad commented on Oct 16, 2024

    @SaHaddad
    Author

    Wow ! To be honest i was surprised to get any emails out of that issue recently. And yes what the previous comment illustrates is exactly what i was asking about. Are they still no commands to do it ?

  8. scottshambaugh commented on Oct 16, 2024

    @scottshambaugh
    Contributor

    Hey @SaHaddad, unfortunately there is still not a way to change this yet.

  9. SaHaddad commented on Oct 16, 2024

    @SaHaddad
    Author

    No worries this is just a nit pick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions