ZedGraph problem with document

ZedGraph problem with document - a function with an if in it won't plot. x not defined - Сообщения

#1 Опубликовано: 21.12.2019 17:30:09
charles esson

charles esson

0 сообщений из 9 понравились пользователям.

Группа: User

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 КиБ) скачан 41 раз(а).
#2 Опубликовано: 21.12.2019 18:09:32
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

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.png
zedgraph%20example_Kr.sm (34 КиБ) скачан 43 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
frapuano 22.12.2019 05:35:00
#3 Опубликовано: 21.12.2019 18:25:56
charles esson

charles esson

0 сообщений из 9 понравились пользователям.

Группа: User

Thank you for your help.
#4 Опубликовано: 21.12.2019 21:30:33
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

It 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 КиБ) скачан 50 раз(а).


#5 Опубликовано: 22.12.2019 05:20:26
charles esson

charles esson

0 сообщений из 9 понравились пользователям.

Группа: User

Hi Jean
The example I gave was to highlight the issue. I am plotting protection functions, these are very much piecewise functions.
#6 Опубликовано: 22.12.2019 05:24:19
charles esson

charles esson

0 сообщений из 9 понравились пользователям.

Группа: User

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)
#7 Опубликовано: 22.12.2019 05:43:33
charles esson

charles esson

0 сообщений из 9 понравились пользователям.

Группа: User

Hi mkraska
worked it out. types in cases; thank
#8 Опубликовано: 22.12.2019 10:01:57
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

Hi 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 Опубликовано: 22.12.2019 19:20:34
charles esson

charles esson

0 сообщений из 9 понравились пользователям.

Группа: User

Hi mkraska
I stuck with zedgraph,
curves_example.sm (60 КиБ) скачан 43 раз(а).
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 Опубликовано: 22.12.2019 20:54:22
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

I'm stuck with zedgraph,


... freak here too.
Native Quick plot is as well educative.

curves_example Native QuickPlot.sm (88 КиБ) скачан 48 раз(а).
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений