Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2002
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

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

Search the Archive

Re: invisible graphics

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34018] Re: invisible graphics
  • From: aes <siegman at stanford.edu>
  • Date: Fri, 26 Apr 2002 03:27:58 -0400 (EDT)
  • Organization: Stanford University
  • References: <aa89ge$h17$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

In article <aa89ge$h17$1 at smc.vnet.net>, David.Annetts at csiro.au wrote:

> > Hi, my request is going to seem sort of silly, so I'll explain what
> > I'm trying to do.  I'm creating some fairly complex plots in
> > mathematica that are made of curves produced by ParametricPlot[] and
> > other graphics produced from Graphics[] commands.  My problem is that
> > I want to be able to easily turn certain plots "off" and "on."  


The commands and techniques I've found particularly useful for plotting include:

1)  Setting lots of default options at the start of a notebook, for example

   myOptions = Sequence[
      RotateLabel -> False,
      PlotStyle -> Thickness[0.005], 
      TextStyle -> {FontFamily -> "Helvetica", FontWeight -> "Bold", 
          FontSize -> 12},
      ImageSize -> 6*72];
   SetOptions[Plot, myOptions];
   SetOptions[ListPlot, myOptions];
   SetOptions[ParametricPlot, myOptions];

Use of Sequence is vital here.

Also, giving names to certain option values

   thick = Thickness[0.005];
   thin = Thickness[0.003];
   dashed = Dashing[{0.01, 0.01}];
   undashed = Dashing[{}];
   bigPoints = PointSize[0.015]; 
   smallPoints = PointSize[0.004];

and then in later plots using things like

   PlotStyle->{{thick, dashed}}

promotes uniformity of style, and makes notebooks much more readable.

2)  Set a global flag

      showTests = True;

and then use If[] statements:

      If[showTests, Plot - - - -}}

3)  The DisplayTogether[] command is extraordinarily handy for combining 
different types of plots, as well as adding or removing selected plots.  (Why 
did it take me so long to find it?)

You can remove plots within DisplayTogether by commenting them out using (* 
---*), and set global defaults at the end of the DisplayTogether command.

4)  As an alternative, creating and naming graphics with Display->Identity in 
the initial default option list above, and then combining and displaying these 
named graphics with Show or Show plus GraphicsArray in a separate cell,

      g1 =  Plot[---]
      g2 = ListPlot[---]
      g3 = ParametricPlot[---]
      g4 =  Plot-  - - ]

   Show[g1,g2,g3,g4, options]

or

   Show[GraphicsArray[{g1,g2},{g3,g4},options]

has the substantial advantage that you can redisplay, and change many options, 
without having to recalculate the basic plots, which may be time-consuming.


  • Prev by Date: Re: DSolve validation
  • Next by Date: Re: DSolve validation
  • Previous by thread: RE: invisible graphics
  • Next by thread: Re: invisible graphics