Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 2,035 Was thanked: 1167 time(s) in 746 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? xyplot.sm (240kb) downloaded 35 time(s). |
|
|
|
|
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: Best Regrads Carlos Edited by moderator 11 August 2023 10:47:46(UTC)
| Reason: Not specified
|
1 user thanked CBG for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,619 Was thanked: 1381 time(s) in 806 post(s)
|
Originally Posted by: manolo 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. Edited by user 11 August 2023 07:53:54(UTC)
| Reason: Not specified |
Russia ☭ forever (git.io/vOZo0) Viacheslav N. Mezentsev |
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 983 time(s) in 811 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.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 2,035 Was thanked: 1167 time(s) in 746 post(s)
|
Originally Posted by: CBG Hello Hello, when I open the file I get the following: 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. |
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,619 Was thanked: 1381 time(s) in 806 post(s)
|
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. Edited by user 11 August 2023 19:45:52(UTC)
| Reason: Not specified |
Russia ☭ forever (git.io/vOZo0) Viacheslav N. Mezentsev |
1 user thanked uni for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 2,035 Was thanked: 1167 time(s) in 746 post(s)
|
Originally Posted by: uni 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. |
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,619 Was thanked: 1381 time(s) in 806 post(s)
|
Originally Posted by: mkraska 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. Edited by user 13 August 2023 09:58:21(UTC)
| Reason: Not specified |
Russia ☭ forever (git.io/vOZo0) Viacheslav N. Mezentsev |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 2,035 Was thanked: 1167 time(s) in 746 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. |
|
1 user thanked mkraska for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,473 Was thanked: 925 time(s) in 588 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.
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,619 Was thanked: 1381 time(s) in 806 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 (git.io/vOZo0) Viacheslav N. Mezentsev |
1 user thanked uni for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,473 Was thanked: 925 time(s) in 588 post(s)
|
Originally Posted by: uni 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 ... 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: 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
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,619 Was thanked: 1381 time(s) in 806 post(s)
|
Originally Posted by: Razonar But forgot the structure. Just return the XY matrix with the values. Even a regular graph can return a set of curves. Edited by user 02 November 2023 19:38:01(UTC)
| Reason: Not specified |
Russia ☭ forever (git.io/vOZo0) Viacheslav N. Mezentsev |
1 user thanked uni for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,473 Was thanked: 925 time(s) in 588 post(s)
|
Originally Posted by: uni ... 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.
|
1 user thanked Razonar for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 2,035 Was thanked: 1167 time(s) in 746 post(s)
|
Originally Posted by: mkraska 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? xyplot.sm (240kb) downloaded 35 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. |
|
1 user thanked mkraska for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,619 Was thanked: 1381 time(s) in 806 post(s)
|
Originally Posted by: mkraska 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 (git.io/vOZo0) Viacheslav N. Mezentsev |
3 users thanked uni for this useful post.
|
on 16/11/2023(UTC), on 17/11/2023(UTC), on 17/11/2023(UTC)
|
|
Rank: Member Groups: Registered
Joined: 06/09/2023(UTC) Posts: 13 Location: beijing Was thanked: 3 time(s) in 1 post(s)
|
Originally Posted by: uni 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: . 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: 2.Traces -> each trace's name , LineStyle-> LineColor, SymbolStyle->Type 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!
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,619 Was thanked: 1381 time(s) in 806 post(s)
|
Not all properties have equivalent names. They can be found in the plugin source code. Some are customizable and some are not. 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. 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 (git.io/vOZo0) Viacheslav N. Mezentsev |
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,619 Was thanked: 1381 time(s) in 806 post(s)
|
Plugin updated. Changes: - the original property names for the legend changed to make the function setprop() easier to use. 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 (git.io/vOZo0) Viacheslav N. Mezentsev |
1 user thanked uni for this useful post.
|
|
|
Rank: Member Groups: Registered
Joined: 06/09/2023(UTC) Posts: 13 Location: beijing Was thanked: 3 time(s) in 1 post(s)
|
Originally Posted by: uni Not all properties have equivalent names. They can be found in the plugin source code. Some are customizable and some are not. 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. 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.
|
|
|
|
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.