MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to change graph options?


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



  • Prev by Date: evaluating functions and displaying results numerically
  • Next by Date: Controlling scale of Graphics on paper
  • Previous by thread: Re: How to change graph options?
  • Next by thread: Find all roots with FindRoot