1 (edited by kearnyhj 2013-11-18 21:27:53)

Topic: Local (vs Global) "Complex Number Format"

Hello, Ivan:

At present "Complex Number Format" is a global attribute under "Options" menu. Is it a major development time commitment and effort to give us the capability of a local such attribute in "Label" (much like font options)? You have provide "%()" to implement an eval embedded in the "Label's" text string; I was thinking of some options akin to the functionality of C's printf() format string "%s". I need the ability to display both polar and rectilinear formats respectively in same as well as different labels (as we are currently teaching circuit analysis and power in the phasor domain). Apologies in advance if I failed to find an existing post addressing this question. BTW, while I am interested in your response, I am currently using this workaround: set the global attribute to rectilinear and have a "Label" string like "%(Zline) = %( abs(Zline) )/_%( arg(Zline) )°" Many thanks.

Re: Local (vs Global) "Complex Number Format"

I never considered this before, but I will look into adding more possibilities for formatting numbers in labels.

Re: Local (vs Global) "Complex Number Format"

I have added support for custom formatting functions in plugins in the newest beta version:
http://padowan.dk/graph/DownloadBeta.php

You need to install Python 3.2 for the plugin interface to work. You can find it at
http://www.python.org/ftp/python/3.2.5/python-3.2.5.msi

I have added a plugin called TextFormatting.py with three formatting functions: real, rectangular and polar. They do the same as the three settings for formatting numbers.

You can use them by for example writing %polar("sin(Zline)")
Notice that you need to use quotes here. You can add a second argument to specify number of decimals: %polar("sin(Zline)", 3)

And if this is not good enough you can create your own plugin with your own text formatting.