1 Pages (10 items)
ZedGraph problem with document - a function with an if in it won't plot. x not defined - Messages
#1 Posted: 12/21/2019 5:30:09 PM
The sample code shows what works and what doesn't. I think the issue is in zed_graph as 2D works. It stops working when the if is added to the function zedgraph example.sm (151 KiB) downloaded 41 time(s).
#2 Posted: 12/21/2019 6:09:32 PM
Seems that Zedgraph can't handle if(). It also fails at non-numeric or undefined values.
A workaround for if() is the use of cases() from Customfunctions plugin. It converts into a boolean expression, which can be handled by Zedgraph.
Suppressing parts of a curve by making it undefined doesn't work. You just can set it to zero.
I am not using Zedgraph. Even setting axes limits requires a lot of scrolling through option trees. XY-Plot is much better in that respect. For log plots I use Maxima Draw regions.

zedgraph%20example_Kr.sm (34 KiB) downloaded 45 time(s).
A workaround for if() is the use of cases() from Customfunctions plugin. It converts into a boolean expression, which can be handled by Zedgraph.
Suppressing parts of a curve by making it undefined doesn't work. You just can set it to zero.
I am not using Zedgraph. Even setting axes limits requires a lot of scrolling through option trees. XY-Plot is much better in that respect. For log plots I use Maxima Draw regions.
zedgraph%20example_Kr.sm (34 KiB) downloaded 45 time(s).
Martin Kraska
Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 users liked this post
frapuano 12/22/2019 5:35:00 AM
#3 Posted: 12/21/2019 6:25:56 PM
Thank you for your help.
#4 Posted: 12/21/2019 9:30:33 PM
WroteIt stops working when the if is added to the function
AFAIK, X_Y takes no kind of conditional.
Not needed in two counts:
1. It has axis limits from user
2. plot as data set.
zedgraph example [red].sm (148 KiB) downloaded 50 time(s).
#5 Posted: 12/22/2019 5:20:26 AM
Hi Jean
The example I gave was to highlight the issue. I am plotting protection functions, these are very much piecewise functions.
The example I gave was to highlight the issue. I am plotting protection functions, these are very much piecewise functions.
#6 Posted: 12/22/2019 5:24:19 AM
Hi mkraska
I really like the afunc syntax and I am sorry but Newbie I am. How did you get the if after -sin(x)
I really like the afunc syntax and I am sorry but Newbie I am. How did you get the if after -sin(x)
#7 Posted: 12/22/2019 5:43:33 AM
Hi mkraska
worked it out. types in cases; thank
worked it out. types in cases; thank
#8 Posted: 12/22/2019 10:01:57 AM
WroteHi Jean
The example I gave was to highlight the issue. I am plotting protection functions, these are very much piecewise functions.
There is no issue: you can plot contiguous pieces of same function,
or any selected pieces. You can have as many different functions
as you wish of both styles.
Please, revisit just new "2D plot Piecewise" in Samples.
Cheers ... Jean
#9 Posted: 12/22/2019 7:20:34 PM
Hi mkraska
I stuck with zedgraph,
curves_example.sm (60 KiB) downloaded 43 time(s).
I think the results looks pretty good, thanks again for your help and the custom functions.
Thanks Jean,
I really like mkraska's solution. It would be nice if "if" worked but anyway.
I stuck with zedgraph,
curves_example.sm (60 KiB) downloaded 43 time(s).
I think the results looks pretty good, thanks again for your help and the custom functions.
Thanks Jean,
I really like mkraska's solution. It would be nice if "if" worked but anyway.
#10 Posted: 12/22/2019 8:54:22 PM
WroteI'm stuck with zedgraph,
... freak here too.
Native Quick plot is as well educative.
curves_example Native QuickPlot.sm (88 KiB) downloaded 49 time(s).
1 Pages (10 items)
-
New Posts
-
No New Posts