omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    matplotlib surface example not working

    Pythonista
    5
    7
    4162
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jmv38
      jmv38 last edited by jmv38

      this example: https://matplotlib.org/mpl_examples/mplot3d/surface3d_demo3.py
      when run from pythonista, does not plot as in the doc.
      It should show
      but the result is very different.

      Is there any solution?
      thanks.

      1 Reply Last reply Reply Quote 0
      • Matteo
        Matteo last edited by

        Hi, most likely it is due to different version of Pythonista matplotlib compared to the version you use in your computer or the version used to produce the image of the example. Pythonista matplotlib version is 1.4.0.

        However for 3D graphs (xyz) I would not use Pythonista, for them I'd use other apps (like for example Visual Math 4D, I apologize for mentioning it in this forum).

        1 Reply Last reply Reply Quote 0
        • jmv38
          jmv38 last edited by

          thanks for the answer.
          I’ve just found that this example is in pythonista doc with a small change (the commented line is replaced by the next one)

          #surf = ax.plot_surface(X, Y, Z, facecolors=colors, linewidth=0)
          surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, facecolors=colors,
                  linewidth=0, antialiased=False)
          

          then it works!

          Matteo 1 Reply Last reply Reply Quote 1
          • Matteo
            Matteo @jmv38 last edited by

            @jmv38 Very good and good to know, bye

            1 Reply Last reply Reply Quote 0
            • topologist
              topologist last edited by

              I just checked and this example (both the original and edited forms) crashes immediately on the latest version of Pythonista on my iPad Pro running IOS 12.2.

              1 Reply Last reply Reply Quote 0
              • ccc
                ccc last edited by

                The code in the original post works for me in the current beta. Please try rebooting the Pythonista app.

                1 Reply Last reply Reply Quote 0
                • aidensala
                  aidensala last edited by

                  @jmv38 @ccc this should be a pretty simple fix... it's been a prevalent issue for over a year now that any graphing having to do with matplotlib running on python 2.7 will crash the pythonista app. Switching to python 3 and running the script should sort any problems.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Powered by NodeBB Forums | Contributors