Group Abstract Group Abstract

Message Boards Message Boards

Adding nothing to a graph in case of false condition?

Posted 4 years ago
POSTED BY: David Golber
4 Replies
Posted 4 years ago

Thanks so much for the help. Graphics[] is exactly what I was looking for. And of course you are right ... it says so in the documentation ... The moral is the old story "Read the documentation!"

POSTED BY: David Golber
Posted 4 years ago

Graphics[] works as well

Show[
    basegraphic,
    If[resultOK, piece, Graphics[]]
 ]

From the documentation for Graphics:

Graphics[] gives an empty graphic with the default image size.

POSTED BY: Hans Milton

You can also use {}.

POSTED BY: Sander Huisman
Posted 4 years ago

DuuuuH. Just solved it myself.

Show[
{
    baseobject,
    If[result_found,piece,Nothing]
}
]

Yes, Mathematica, has Null, Nothing, and None .... and they are all different. :)

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