Skip to content

Conversation

@VolkerMuehlhaus
Copy link

Modified to use matplotlib.pyplot instead of outdated pylab

modified to use matplotlib.pyplot instead of pylab
@thliebig
Copy link
Owner

Hello @VolkerMuehlhaus, in principle I agree with this change. But I guess if we do this, we should do all tutorials together?

@VolkerMuehlhaus
Copy link
Author

Hello @VolkerMuehlhaus, in principle I agree with this change. But I guess if we do this, we should do all tutorials together?

Hi Thorsten @thliebig,

[x] done

You might want to double check, I tested all examples here on Windows. The axis gridlines are not always nice, but I didn't know change that.

BR, Volker

@thliebig
Copy link
Owner

The axis gridlines are not always nice, but I didn't know change that.

Has anything changed? I mean pylab was only a shortcut for matplotlib.pyplot but all the method used ultimately should not have changed at all now? Thus I would not expect any visible change to the plots?

This is maybe my only remaining issue with this PR, that both commit messages are a bit misleading...

Restored the formatted labels/captions, with proper escape characters
@VolkerMuehlhaus
Copy link
Author

VolkerMuehlhaus commented Jan 4, 2026

Has anything changed? I mean pylab was only a shortcut for matplotlib.pyplot but all the method used ultimately should not have changed at all now? Thus I would not expect any visible change to the plots?

Yes, the sometimes ugly scale existed before, I left this unchanged.

Now back from vacation, I updated all sources again to restore the exact format of captions/labels, but without these errors:

/home/volker/openEMS_work/Python_examples/Rect_Waveguide.py:115: SyntaxWarning: invalid escape sequence '\R'
  plot(freq*1e-6,real(ZL), linewidth=2, label='$\Re\{Z_L\}$')
/home/volker/openEMS_work/Python_examples/Rect_Waveguide.py:117: SyntaxWarning: invalid escape sequence '\I'
  plot(freq*1e-6,imag(ZL),'r--', linewidth=2, label='$\Im\{Z_L\}$')
/home/volker/openEMS_work/Python_examples/Rect_Waveguide.py:119: SyntaxWarning: invalid escape sequence '\O'
  ylabel('ZL $(\Omega)$')

by \\ instead of r-string used before.

One other detail that I considered changing (but did not change) is the debug switch for showing the model/mesh in AppCSXCAD. In the forum I see many new users who completely miss the importance of checking the mesh lines,so my persomal preference would be to always show the model & mesh. Naming that switch "debug" is misleading in my opinion, but never mind, you are the project owner so it's up to you.

TL;DR: All models show similar plots now, but using matplotlib.pyplot instead of pylab

@VolkerMuehlhaus
Copy link
Author

@thliebig push :-)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants