didn't show plot with J.draw_ellipse() and error message S.draw_poincare()

Issue #11 resolved
飛飛害羞熊 created an issue

Hi,

I try to follow the simple example of 5.1.1.1 [12] and [13], but it doesn’t show any plot and no error message. And then try [24], it shows following error messages:

Warning (from warnings module):
File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\site-packages\py_pol-1.0.2-py3.7.egg\py_pol\drawings.py", line 173
plt.tight_layout()
UserWarning: Tight layout not applied. The left and right margins cannot be made large enough to accommodate all axes decorations.
Traceback (most recent call last):
File "<pyshell#12>", line 1, in <module>
S.draw_poincare()
File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\site-packages\py_pol-1.0.2-py3.7.egg\py_pol\stokes.py", line 1832, in draw_poincare
ax, fig = draw_poincare(self, *args, **kwargs)
File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\site-packages\py_pol-1.0.2-py3.7.egg\py_pol\drawings.py", line 261, in draw_poincare
draw_empty_sphere(axis, angle_view=angle_view, axis_equal=axis_equal)
File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\site-packages\py_pol-1.0.2-py3.7.egg\py_pol\drawings.py", line 176, in draw_empty_sphere
ax.set_aspect('equal')
File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\site-packages\matplotlib-3.3.2-py3.7-win-amd64.egg\mpl_toolkits\mplot3d\axes3d.py", line 324, in set_aspect
"Axes3D currently only supports the aspect argument "
NotImplementedError: Axes3D currently only supports the aspect argument 'auto'. You passed in 'equal'.

Can you kindly advise what are possible causes?

Python 3.7.4 64-bit

py_pol 1.0.2

matplot 3.3.2

I’m a inexperienced user of Python and first try on py_pol. Sorry for my disturbance and thanks for your patient.

Willie

Comments (4)

  1. JESUS DEL HOYO MUÑOZ

    Dear Willie.

    Thank you for using our module. The problem you have appear in some versions of matplotlib. We have uploaded a new version (1.0.3) of pypol which should avoid it. Please download it and let us know if it works.

    Jesús del Hoyo

  2. 飛飛害羞熊 reporter

    Dear Jesús,

    Thank you for prompt reply. Below are the messages after executing [24] (section 5.1.1.2).

    Warning (from warnings module):
    File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\site-packages\py_pol-1.0.3-py3.7.egg\py_pol\drawings.py", line 173
    plt.tight_layout()
    UserWarning: Tight layout not applied. The left and right margins cannot be made large enough to accommodate all axes decorations.
    Axis equal not supported by your current version of Matplotlib
    ([<Axes3DSubplot:title={'center':'Linear light'}, xlabel='$S_1$', ylabel='$S_2$'>], <Figure size 600x600 with 1 Axes>)

    And if I replace with another command “ax,fig = S.draw_poincare(axis_equal=False)“, it appears only Warning but didn’t pop-up any plot window, just like the execution result of “J.draw_ellipse(draw_arrow=True, figsize=(5,5))” in Jones object.

    Warning (from warnings module):
    File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\site-packages\py_pol-1.0.3-py3.7.egg\py_pol\drawings.py", line 173
    plt.tight_layout()
    UserWarning: Tight layout not applied. The left and right margins cannot be made large enough to accommodate all axes decorations.

    I’m not sure if it’s useful. Another clue is I can see one pop-up chart with the execution of “I_perfect = E_final.parameters.intensity(draw=True)” ([23] in Example section)

    Thanks.

    Willie

  3. 飛飛害羞熊 reporter

    Dear Jesús,

    My colleague can use it without any issue, so I will follow his steps to install again with pip. Will query on you, if there are questions. Thank you!!

    Willie

  4. JESUS DEL HOYO MUÑOZ

    Dear Willie

    Thank you for your feedback. That is exactly what we expected, the error is replaced by a warning.

  5. Log in to comment