Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #9708 > unrolled thread

How to change graph options?

Started byJames Stein <james@stein.org>
First post2012-04-20 11:44 +0000
Last post2012-04-21 04:30 +0000
Articles 4 — 3 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  How to change graph options? James Stein <james@stein.org> - 2012-04-20 11:44 +0000
    Re: How to change graph options? Helen Read <readhpr@gmail.com> - 2012-04-21 04:31 +0000
    Re: How to change graph options? A Retey <awnl@gmx-topmail.de> - 2012-04-21 04:31 +0000
    Re: How to change graph options? A Retey <awnl@gmx-topmail.de> - 2012-04-21 04:30 +0000

#9708 — How to change graph options?

FromJames Stein <james@stein.org>
Date2012-04-20 11:44 +0000
SubjectHow to change graph options?
Message-ID<jmri7r$la4$1@smc.vnet.net>
This code fails to achieve its purpose:

   ClearAll [ g ] ;
   g = Graph [ { 1, 2 } , { 1 -> 2 } , ImageSize -> Tiny]
   Options [ g ]
   SetOptions [ g, ImagePadding -> 10 ] ;

The reason, I assume, is that 'g' is neither a user-defined nor built-in
function.
The only work-around I can think of is too ugly to describe.
Is there any clean way to change or append the option settings of a Graph?

[toc] | [next] | [standalone]


#9728

FromHelen Read <readhpr@gmail.com>
Date2012-04-21 04:31 +0000
Message-ID<jmtd6j$shc$1@smc.vnet.net>
In reply to#9708
On 4/20/2012 7:44 AM, James Stein wrote:
> This code fails to achieve its purpose:
>
>     ClearAll [ g ] ;
>     g = Graph [ { 1, 2 } , { 1 ->  2 } , ImageSize ->  Tiny]
>     Options [ g ]
>     SetOptions [ g, ImagePadding ->  10 ] ;
>
> The reason, I assume, is that 'g' is neither a user-defined nor built-in
> function.
> The only work-around I can think of is too ugly to describe.
> Is there any clean way to change or append the option settings of a Graph?
>
>

Why not use Show?

Show[g, ImagePadding -> 10]


-- 
Helen Read
University of Vermont

[toc] | [prev] | [next] | [standalone]


#9729

FromA Retey <awnl@gmx-topmail.de>
Date2012-04-21 04:31 +0000
Message-ID<jmtd7i$shs$1@smc.vnet.net>
In reply to#9708
Am 20.04.2012 13:44, schrieb James Stein:
> This code fails to achieve its purpose:
>
>     ClearAll [ g ] ;
>     g = Graph [ { 1, 2 } , { 1 ->  2 } , ImageSize ->  Tiny]
>     Options [ g ]
>     SetOptions [ g, ImagePadding ->  10 ] ;
>
> The reason, I assume, is that 'g' is neither a user-defined nor built-in
> function.
> The only work-around I can think of is too ugly to describe.
> Is there any clean way to change or append the option settings of a Graph?
>

Sorry, my last answer was probably not exactly what you need, for Graphs 
there is SetProperty, which will return the changed graph object, while 
Show will convert to a Graphics, which is probably not what you wanted. 
This should be better:

SetProperty[g, ImagePadding -> 10]


hth,

albert

[toc] | [prev] | [next] | [standalone]


#9730

FromA Retey <awnl@gmx-topmail.de>
Date2012-04-21 04:30 +0000
Message-ID<jmtd4l$sgm$1@smc.vnet.net>
In reply to#9708
Hi,

> This code fails to achieve its purpose:
>
>     ClearAll [ g ] ;
>     g = Graph [ { 1, 2 } , { 1 ->  2 } , ImageSize ->  Tiny]
>     Options [ g ]
>     SetOptions [ g, ImagePadding ->  10 ] ;
>
> The reason, I assume, is that 'g' is neither a user-defined nor built-in
> function.
> The only work-around I can think of is too ugly to describe.
> Is there any clean way to change or append the option settings of a Graph?

I think this is what you want:

Show[g, ImagePadding -> 10]

hth,

albert

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web