Skip to content

Orthogonal projection for mplot3d #537

Closed

Description

@tazle

It would be nice to be able to view 3D plots without the distortions caused by perspective projection. Orthogonal projection allows easier comparison of different elements of a plot, especially when viewing the plot close to the direction of an axis.

Implementation requires orthogonal replacement for persp_transformation() in mpl_toolkits.mplot3d.proj3d and a constructor parameter that selects which projection is used in Axes3D.

Activity

  1. tazle commented on Oct 18, 2011

    @tazle
    Author

    As monkey patch, the following seems to do the job, but breaks at least automatic placement of axis labels.

    import numpy
    from mpl_toolkits.mplot3d import proj3d
    def orthogonal_proj(zfront, zback):
        a = (zfront+zback)/(zfront-zback)
        b = -2*(zfront*zback)/(zfront-zback)
        return numpy.array([[1,0,0,0],
                            [0,1,0,0],
                            [0,0,a,b],
                            [0,0,0,zback]])
    proj3d.persp_transformation = orthogonal_proj
  2. reopened this on Oct 18, 2011
  3. added this to the milestone on Aug 18, 2014
  4. aglie commented on Nov 4, 2014

    @aglie

    I wonder, if the above patch was added to the release?

  5. tacaswell commented on Nov 4, 2014

    @tacaswell
    Member

    @aglie I do not think so. If you are interested in turning this patch into a PR I think we would be happy to review it.

    It would need some documentation and tests added before it could be merged.

  6. petehuang commented on Dec 30, 2016

    @petehuang
    Contributor

    PR still welcome here. Looks simple but we should be careful of breaks as @tazle mentions

    Recommend labeling as Difficulty: Easy

  7. added
    Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issues
    on Jan 3, 2017
  8. efiring commented on Jan 3, 2017

    @efiring
    Member

    I don't think much of anything involving mplot3d rates as "easy", and I suspect a PR for this feature involves a bit more than the 2011 monkey patch above suggests. @WeatherGod can change the label if he disagrees.

  9. modified the milestones: , on Apr 10, 2017
  10. RamiGASMI commented on Jan 31, 2018

    @RamiGASMI

    Hi

    I couldn't correctly implement this patch to use it with Axes3D, could any one help me with an example if possible

    Thank you all,

  11. WeatherGod commented on Jan 31, 2018

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

Metadata

Metadata

Assignees

Labels

Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesNew featuretopic: mplot3d

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions