Maple 12: Embedded plot does not update

I have an embedded plot in View 1292_Embedded plot does not update correctly.1.0.mw on MapleNet or Download 1292_Embedded plot does not update correctly.1.0.mw
View file details

When I open the plot, the vertical red line is missing from the plot. If I edit the component properties, delete the Plot Expression, select OK, edit the component properties again, insert the very same code into Plot Expression and select OK, the red line appears.

Why is the embedded plot not updating when the doc is opened or executed?

~Rich~

Which plot

When I open this worksheet in Maple 12 I see two embedded plots. The first (the 3D) has a red line in when I open it. The second is 2D and since the red line has no X or Y variation so it shows up as a dot.

When you open a worksheet with an embedded plot in Maple 12 the contained plot should look exactly like it did when the worksheet was saved. Did you both save and open the worksheet in Maple 12? What platform are you on?

David Clayworth Maplesoft GUI Developer

Maple 12: Embedded plot does not update

Good morning, David,

Thanks for the reply. I am new to Maple...I understand the difference between the 1st and 2nd plot...my concern is with the first plot in the plot component.

I am running Windows XP Pro SP2.

When I open this doc on my system, I see the inline plot displayed correctly, but the embedded plot is not. There is no red line.

If I change plot p13 and re-execute the doc, I expect to see the embedded plot update. It does not. I am beginning to suspect that it does not by design; rather, the component takes a /snapshot/ of the last time the Plot Expression was changed and displays that. This means that I must remember to edit the embedded component each time I change something that affects what it contains.

It would be so much easier if I didn't need to use the embedded component, but I suspect that I will use the components more as I get better with Maple and my docs become more sophisticated.

~Rich~

http://pubpages.unh.edu/~rlo9/index.html

Doug Meade's picture

need to use component?

Rich,

Your last message included the following:

It would be so much easier if I didn't need to use the embedded component, but I suspect that I will use the components more as I get better with Maple and my docs become more sophisticated.

Why do you think you "need to use the embedded component"? The plots[display] command immediately above the component displays the same information directly in the document.

Now, this plot is not going to update automatically. It will be updated each time the command is executed. You might be able to put all of your commands in the startup code for the document and then re-execute the entire document (by clicking on !!! icon). That's the closest I can come to auto-updating within Maple.

Have I addressed your comment about feeling that you need to use components?

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.ed

need to use component?

Good question, Doug. I believe that I need to use the compo0nent because I want the displayed graph to be much smaller than it appears by default, and the only way I know of to get that is to put it into a Plot component and set the Height and Width in pixels. If there is a way to change the inline plot size, I'd prefer to use it.

~Rich~

http://pubpages.unh.edu/~rlo9/index.html

Doug Meade's picture

plot properties

Good points. But, you can resize an inline plot window. You cannot set the size explicitly, but you can drag a corner to resize the plot. And, I believe it's still true that if you recreate the plot without deleting the previous one, the new plot will inherit the size of the previous one.

This is not the desired way to control a plot window. I wish it were possible to set some global properties (size, orientation, axes, shading, legend, axes, ....) about a plot and have these automatically applied to any plots. I know how this can be done through the command line, up to a point, but it would be nice if the GUI really supported the professional document preparation. The document interface is a start, but there is still a long way to go, in my opinion.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.ed

inline plot properties

Thanks, Doug.  I tried resizing the plot, saving, closing, re-opening, and re-executing the document. It all worked well, thanks. I am new to Maple, and had seen another reference to using the embedded plots because the inline plots couldn't be resized. Not true, I see. I am especially happy to see that the plot retains its size when the command is re-exec'ed.

I'd be most happy if the properties you mentioned could be set on a plot-by-plot basis as will as globally, as I can well imagine that I'd want those properties to be varied on a plot-by-plot basis. In particular, I'd like control over the size of a plot.

~Rich~

http://pubpages.unh.edu/~rlo9/index.html

Scott03's picture

try style and thickness

I am not sure why the dot isn't coming up, but you may want to try to increase the thickness from 1 to 2 and change the style of the line from a surfacecontour to surface.  To update the component, just cut the code, click ok, then go back into the component and paste the code back in.

 

Scott

where is the last plot (dot) and component update

Dear Scott,

I tried surfacecontour > surface and like it much better, thanks. I also played with thickness to no avail. I had thought that the dot, as the last plot in the series, would be plotted "on top (of a 2D plot)" of the previous plots.

By changing the orientation from "orientation = [-90, 0]" to "orientation = [-90, 1]", I can get the dot appear, and the graph is not changed substantially...

Your last remark gets at the heart of the problem: the component is not automatically updated! (See the following post to see how to address that.)

~Rich~

http://pubpages.unh.edu/~rlo9/index.html

Doug Meade's picture

no auto-update, action needed

Rich,

If I understand the situation correctly, you want Maple to act like a spreadsheet. When you update the plot, you want all related elements to automatically update. This is not the way Maple works (and for good reasons, most of the time).

Some "action" is required to cause the plot to update. Within the plot component,

1. edit the "action when clicked" script to read:

use DocumentTools in 
  Do( %Plot6="plots[display]([p10, p11, p12, p13], axes = normal,
      caption = `Figure 3. Sonobuoy Pulse Propagation Over Time, 3D`,
      labels = [x, y, t], orientation = [-130, 70],
      view = [-180 .. 180, -180 .. 180, 0 .. 1.75])");
end use;

Note the use of back quotes (`) around the caption.

2. check the "make 'execute code' the default manipulator' box at the bottom of the edit window

3. click OK, to close the edit window, and once more to close the properties window.

Now. It appears you have to be very careful about where you click in the component. If you click in the middle, this is taken as a grab to rotate the plot. But, if you click close to the edge, in what is probably  the border between the plot region and the boundary of the plot component, you will see that the plot updates. (To test the action, you need to change something in the options for at least one of p10, p11, p12, and p13.)

Personally, in this type of a situation I would suggest inserting a button next to the plot. In its components, set the caption to "Update Plot" and edit the "action when clicked" to be what is listed above. Click OK to close the edit window, click OK once more to close the button properties window. Now, click on your new button and, voila, the plot is updated. One reason I like the button approach is that you can put several Do commands in its action script and update an entire collection of component properties.

I can post the worksheet if desired, but I think these directions are pretty straightforward.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.ed

 

no component auto-update available; action needed

Thanks for such a clear and detailed reply, Doug. I did exactly as you recommended, including using a button, and learned a great deal from it.

I removed the plot () command from each of the components and put them in Do () commands in the button Action. The button works as I expected.

Thanks much,

~Rich~

http://pubpages.unh.edu/~rlo9/index.html

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}