Group Abstract Group Abstract

Message Boards Message Boards

Clear output between successive prints of ListLinePlot - workaround needed

Posted 2 years ago
POSTED BY: Paul Newton
3 Replies
Posted 2 years ago

In response to the comment above, the relevant section of makePlot[] looks like this:

result = ListLinePlot[.....]
Return[result]

and makePlot[] is called in this section of code (aciid1 and acid2 are the source data for the PopupMenus)

Style[Dynamic[$Version], DynamicUpdating -> True];
(*Dynamic[myPlot]*)
myPlot = makePlot[];
Grid[{{"First acid", PopupMenu[Dynamic[acid1], menuData], 
   ""}, {"Second acid", PopupMenu[Dynamic[acid2], menuData], 
   Button["Display", myPlot = makePlot[]]}, {"", Dynamic[myPlot], ""}}]
(*Dynamic[myPlot]*)

I have used Dynamic[myPlot] in the third row of the grid, but the two commented lines show that it could also be used before or after the code which creates the PopupMenus and Button.

myPlot = makePlot[] is called for the initial display and then called each time the button is clicked

If asked, I can attach the entire notebook.

POSTED BY: Paul Newton

Welcome to Wolfram Community! Please make sure you know the rules: https://wolfr.am/READ-1ST

Please provide your trials in terms of Wolfram Language code. This will make it easier for other members to help you.
Showing the actual code is necessary besides describing it with text.
Please use one of the methods described in the rules above.

POSTED BY: EDITORIAL BOARD
Posted 2 years ago

I was not all hopeful that I was thinking along the right lines, hence my question, but as it turns out this was far simpler than I anticipated. It's working like a charm.

Still, somebody might find this useful (I have seen other posts about clearing output ...)

I'd be happy to provide more detail if anybody is interested.

POSTED BY: Paul Newton
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard