HP Forums

Full Version: plotting functions but not for return values outside specified range
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'd like to do a polar plot of the logarithm of expressions, when the logarithm can attain values down to -infinity.

I want to plot only for those values that do not reach too large negative values.

And I want to use the included polar plot app.

A typical example is

R = 40 + 20*log(0.5+0.5*cos(theta))

where I'd like to plot only those values of R that are greater than 0, I e for thetas that keeps the logarithm part above -30 or so.

(The expression shown is the polar plot of an idealised cardioid microphone, plotted in dB relative to the response at 0 degrees, and is a typical example of the plots I want to do)

Is there any way to specify limits for what values to plot, w/o writing a rather complex function encapsulation?
try this:

[attachment=4441]

-road
OK, that is a form of encapsulation, but of an acceptable simplicity.

Can one change plot color dependent on some calculation or plotted value?
I don't know of any settings that will allow you to change the plot color based on a calculated value, but you can do that thru programming.

-road
Sometimes using "" for the undefined value has caused me to have 'unexpected results'. I prefer to use 0/0 or to just remove the default in the piecewise template by using backspace on the last filled square. (a comma at the end of the line will bring the next line back)

Either solution works well, but I think that the one line piecewise template is easier to read.

{R1(Theta) if R1(Theta)>-30
Hello,

>Can one change plot color dependent on some calculation or plotted value?

I have no clue if it would work or not, but has someone tried to use a user program for the function calculation and to change the function color programmatically in said program? I would give it a 30% chance of working, but worth a try...

Cyrille
The encapsulation in a call to ifte() works very well.
Reference URL's