Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

27 Pages«<24252627>
Options
Go to last post Go to first unread
Offline mkraska  
#501 Posted : 10 August 2023 19:04:03(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,999
Germany

Was thanked: 1136 time(s) in 730 post(s)
When opening old files with X-Y plots, I get spurious empty legend boxes in the plots.

Switching legend visibility off doesn't work, as soon as I click the canvas, the box re-appears. Copying the region to a new sheet (in version 8348) helps. There I can switch the legend off and it keeps off upon re-opening the file.

So a mitigation strategy would look like this:
- copy all content of the old file
- close the old file
- paste it into an empty new file
- switch off all the legends where required
- save the new file in place of the old one

Yet that doesn't work. If I copy all in one, the problem persists. My current hypothesis is that this might be some side effect of having too many plots or some malicious variable or whatever.

Can anyone reproduce this?

2023-08-10 17_43_25-SMath Solver - [xyplot.sm].png
xyplot.sm (240kb) downloaded 33 time(s).



Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline CBG  
#502 Posted : 11 August 2023 03:29:42(UTC)
CBG


Rank: Advanced Member

Groups: Registered
Joined: 14/10/2015(UTC)
Posts: 308

Was thanked: 77 time(s) in 58 post(s)
Hello

Hello, when I open the file I get the following:

Click to enlarge

Best Regrads

Carlos

Edited by moderator 11 August 2023 10:47:46(UTC)  | Reason: Not specified

thanks 1 user thanked CBG for this useful post.
on 11/08/2023(UTC)
Offline uni  
#503 Posted : 11 August 2023 07:47:29(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,498
Man
Russian Federation

Was thanked: 1279 time(s) in 747 post(s)
Originally Posted by: manolo Go to Quoted Post
It is possible to change the behavior of the legend? Entries without names should not be displayed in the legend.

Five years ago, I changed the behavior of the legend. Since then, empty names hide elements of the legend. To return them, it is enough to have a space as the name.

Click to enlarge

Edited by user 11 August 2023 07:53:54(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
Offline Jean Giraud  
#504 Posted : 11 August 2023 14:08:23(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
As I open X_Y from fresh 30405, it is in default native.
1. Is Legend Visible ... False
2. Set Visible ... True ... small rectangle appears
3. Go to list ... name each trace.
4. Finish Legend properties.
Offline mkraska  
#505 Posted : 11 August 2023 15:49:07(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,999
Germany

Was thanked: 1136 time(s) in 730 post(s)
Originally Posted by: CBG Go to Quoted Post
Hello

Hello, when I open the file I get the following:

Click to enlarge

Best Regrads

Carlos


Hello, the legends haven't been lost but have't been there in the original version. So the problem is not that the contents of the legend is lost but that empty legends appear without intent.

Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline uni  
#506 Posted : 11 August 2023 19:09:27(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,498
Man
Russian Federation

Was thanked: 1279 time(s) in 747 post(s)
Do you mean some very old file? Not the one attached to the post above.

Click to enlarge

So far, no one has had problems with the legend, except for the user mentioned above.

Edited by user 11 August 2023 19:45:52(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
thanks 1 user thanked uni for this useful post.
on 11/08/2023(UTC)
Offline mkraska  
#507 Posted : 11 August 2023 21:25:15(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,999
Germany

Was thanked: 1136 time(s) in 730 post(s)
Originally Posted by: uni Go to Quoted Post
Do you mean some very old file? Not the one attached to the post above.


So far, no one has had problems with the legend, except for the user mentioned above.


I produced the first issue of the Handbuch 9 years ago and it already had a section on XYplot (just looked it up in the SMath file manager). So, yes, the file is very old. It has been edited from time to time. In 2020, when I produced the last update, the images are ok, while now I faced the issue.

My guess is that at some point in time, the legend wasn't shown if all or some entries were empty. Perhaps you had to drop that logic when using empty entries to suppress the sample trace.
At least I am sure that I didn't deliberately switch on legends in all the plots without providing proper entries.

Yet I don't see what could be done about it, I just have to fix the legends in legacy files. Thanks for having a look at the issue.


Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline uni  
#508 Posted : 13 August 2023 09:54:43(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,498
Man
Russian Federation

Was thanked: 1279 time(s) in 747 post(s)
Originally Posted by: mkraska Go to Quoted Post
My guess is that at some point in time, the legend wasn't shown if all or some entries were empty. Perhaps you had to drop that logic when using empty entries to suppress the sample trace.

In sm-files, each time it is saved, information about dependencies and their versions is recorded. The version information contains the build date of the plugin. This way we can determine exactly which version of the plugin is being used. Using the date information I can find out how the plugin worked and warn modern users.

Click to enlarge

Edited by user 13 August 2023 09:58:21(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
Offline mkraska  
#509 Posted : 13 August 2023 13:48:41(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,999
Germany

Was thanked: 1136 time(s) in 730 post(s)
I'd propose to make empty legends invisible. The help text for IsVisible could contain a hint, that if the legend should be visible, at least one trace name must not be empty.

So if one sets legend visibility to true but all trace names are empty, the names could be automatically populated with sensible names (e.g. a stringified version of the entry).

Also, in the name entry, a hint would be good that empty name removes the trace from the legend.
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 14/08/2023(UTC)
Offline Razonar  
#510 Posted : 02 November 2023 08:29:45(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,390
Uruguay

Was thanked: 845 time(s) in 534 post(s)
Hi Viacheslav. Would it be possible to have a function like M = XYPlot(F,x1,x2,y1,y2,n)? The function should return M as an n*2 array with the values of the points that the XYPlot component uses to plot. 'F' would be an explicit function like F = sin(x), or implicit like F = x^2+y^2-4, 'n' the number of points and the other arguments the edges of the graph.

Thanks in advance.
Alvaro.
Offline uni  
#511 Posted : 02 November 2023 08:53:04(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,498
Man
Russian Federation

Was thanked: 1279 time(s) in 747 post(s)
This function is already implemented in the plugin. With its help, sequential drawing of curve points occurs. The function returns sets of all detected curves consisting of a sequence of points.
The marching cubes algorithm generates a random set of pieces, I added a function for ordering them. This is necessary for high-quality printing of a PDF document. Now, when zoomed in, all lines do not contain artifacts.
The algorithm itself has not yet been optimized, but it is quite working, since no one has complained about the picture yet.
Russia ☭ forever
Viacheslav N. Mezentsev
thanks 1 user thanked uni for this useful post.
on 02/11/2023(UTC)
Offline Razonar  
#512 Posted : 02 November 2023 09:04:04(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,390
Uruguay

Was thanked: 845 time(s) in 534 post(s)
Originally Posted by: uni Go to Quoted Post
This function is already implemented in the plugin. ...

Yes, I know. I ask for have the results outside the plugin, into a SMath matrix, as a fast way for discretizing a function or for further manipulations before making a plot.

Originally Posted by: uni Go to Quoted Post
...
The algorithm itself has not yet been optimized, but it is quite working, since no one has complained about the picture yet.

Just another reason for having its results as another usual SMath function, like CreateMesh.

Best regards.
Alvaro.

Edited: Maple have it:

Clipboard04.png

But forgot the structure. Just return the XY matrix with the values.

Edited by user 02 November 2023 09:45:11(UTC)  | Reason: Not specified

Offline uni  
#513 Posted : 02 November 2023 19:33:04(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,498
Man
Russian Federation

Was thanked: 1279 time(s) in 747 post(s)
Smile

Click to enlarge

Originally Posted by: Razonar Go to Quoted Post
But forgot the structure. Just return the XY matrix with the values.

Even a regular graph can return a set of curves.

Click to enlarge

Edited by user 02 November 2023 19:38:01(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
thanks 1 user thanked uni for this useful post.
on 02/11/2023(UTC)
Offline Razonar  
#514 Posted : 02 November 2023 20:51:39(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,390
Uruguay

Was thanked: 845 time(s) in 534 post(s)
Originally Posted by: uni Go to Quoted Post
... Even a regular graph can return a set of curves.


Hi Viacheslav. I was thinking of something simple, like Mathcad does, which separates the traces with 'NaN' to be able to continue handling a single matrix. SMath doesn't have 'NaN', but someday I suppose it will. Meanwhile we can use 'NaN as a unit, although it doesn't help on graphs.

Best regards.
Alvaro.
thanks 1 user thanked Razonar for this useful post.
on 02/11/2023(UTC)
Offline mkraska  
#515 Posted : 16 November 2023 05:16:07(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,999
Germany

Was thanked: 1136 time(s) in 730 post(s)
Originally Posted by: mkraska Go to Quoted Post
When opening old files with X-Y plots, I get spurious empty legend boxes in the plots.

Switching legend visibility off doesn't work, as soon as I click the canvas, the box re-appears. Copying the region to a new sheet (in version 8348) helps. There I can switch the legend off and it keeps off upon re-opening the file.

So a mitigation strategy would look like this:
- copy all content of the old file
- close the old file
- paste it into an empty new file
- switch off all the legends where required
- save the new file in place of the old one

Yet that doesn't work. If I copy all in one, the problem persists. My current hypothesis is that this might be some side effect of having too many plots or some malicious variable or whatever.

Can anyone reproduce this?

2023-08-10 17_43_25-SMath Solver - [xyplot.sm].png
xyplot.sm (240kb) downloaded 33 time(s).





I found the reason for the problem. It is very simple. At the end of the file, I started experimenting with setprop and actually used setprop("XYPlot\002E\Legend\002E\IsLegendVisible",1). This seems to affect all plots with the name XYPlot (in the property settings), regardless if they are above or below the setprop command in the sheet. XYPlot happens to be the default name of all existing plots and setprop overrides any command from the settings dialog.

Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 16/11/2023(UTC)
Offline uni  
#516 Posted : 16 November 2023 23:15:17(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,498
Man
Russian Federation

Was thanked: 1279 time(s) in 747 post(s)
Originally Posted by: mkraska Go to Quoted Post
I found the reason for the problem. It is very simple. At the end of the file, I started experimenting with setprop and actually used setprop("XYPlot\002E\Legend\002E\IsLegendVisible",1). This seems to affect all plots with the name XYPlot (in the property settings), regardless if they are above or below the setprop command in the sheet. XYPlot happens to be the default name of all existing plots and setprop overrides any command from the settings dialog.

Yes, that's how it works now. I mentioned somewhere that the feature is experimental. The function affects all plots on all sheets with the same name. Therefore, you can't use the default name. The function has global effect throughout the entire program. Despite this defect, its use can be useful.
The method on which the function works can't be used as the main tool, because the software implementation is too crude.

Russia ☭ forever
Viacheslav N. Mezentsev
thanks 3 users thanked uni for this useful post.
on 16/11/2023(UTC),  on 17/11/2023(UTC),  on 17/11/2023(UTC)
Offline kaizh  
#517 Posted : 11 December 2023 21:17:47(UTC)
kaizh


Rank: Member

Groups: Registered
Joined: 06/09/2023(UTC)
Posts: 12
China
Location: beijing

Originally Posted by: uni Go to Quoted Post
setprop() function is just an intermediary. It knows nothing about the properties of an object. Thus, if a property is found during a call, then it will be set. Each time a function is called, it enumerates the available properties. It is possible that I will change this behavior by setting aliases for some properties, making the names shorter. For now you can use source code to get these names. As for the values, you can get them from sm file:
Code:
gridpattern="Dash"
.


Hello , thanks for your developping the setprop function , it helps me free of setting quite similar plot options manually . But there exists some propertis that i can not find corresponding function form , could you help to identify these ? thanks in advance .

these properties are :
1. Legend -> Positon , it failed to set option using this function form:
tmp5CE9.png

2.Traces -> each trace's name , LineStyle-> LineColor, SymbolStyle->Type
tmp1999.png
2023-12-11_15-09-34.png

I frequently use these options to visulize the combination of general curve and sactter curve , so it's nice to use its coreesponding setprop function form.
any help is welcome , thanks!
Offline uni  
#518 Posted : 11 December 2023 21:32:16(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,498
Man
Russian Federation

Was thanked: 1279 time(s) in 747 post(s)
Not all properties have equivalent names. They can be found in the plugin source code. Some are customizable and some are not.

Click to enlarge

setprop() function uses the original property names to access their values. It's not intuitive, but it's done that way for now. This property naming is used for compatibility with older versions of the plugin. Perhaps I'll make them easier to use while maintaining compatibility.

Click to enlarge

As for changing the properties of individual curves, this is not automated yet. I can't yet implement a universal method that would be understandable to users. In general, this is possible, but has not yet been implemented.

Edited by user 11 December 2023 21:54:34(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
Offline uni  
#519 Posted : 11 December 2023 22:27:31(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,498
Man
Russian Federation

Was thanked: 1279 time(s) in 747 post(s)
SMath Studio compatibility

Plugin updated.

Changes:

- the original property names for the legend changed to make the function setprop() easier to use.

Click to enlarge

When cloning a component and changing its name, the function setprop() doesn't work. When inserting a component, the function works fine. I didn't notice this before.
Russia ☭ forever
Viacheslav N. Mezentsev
thanks 1 user thanked uni for this useful post.
on 12/12/2023(UTC)
Offline kaizh  
#520 Posted : 11 December 2023 22:40:36(UTC)
kaizh


Rank: Member

Groups: Registered
Joined: 06/09/2023(UTC)
Posts: 12
China
Location: beijing

Originally Posted by: uni Go to Quoted Post
Not all properties have equivalent names. They can be found in the plugin source code. Some are customizable and some are not.

Click to enlarge

setprop() function uses the original property names to access their values. It's not intuitive, but it's done that way for now. This property naming is used for compatibility with older versions of the plugin. Perhaps I'll make them easier to use while maintaining compatibility.

Click to enlarge

As for changing the properties of individual curves, this is not automated yet. I can't yet implement a universal method that would be understandable to users. In general, this is possible, but has not yet been implemented.


ok, and having a nice day , thanks again uni.
Users browsing this topic
Similar Topics
X-Y Plot Region Plugin (Extensions)
by ndtma 24/06/2018 06:00:49(UTC)
X-Y Plot Region Plugin Problem (Questions)
by ndtma 20/06/2018 19:38:44(UTC)
27 Pages«<24252627>
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.