Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1998
*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 1998

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

Search the Archive

How to create a color contour plot with color table?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg14339] How to create a color contour plot with color table?
  • From: hsg at lem.phy.duke.edu (Henry S. Greenside)
  • Date: Thu, 15 Oct 1998 00:28:44 -0400
  • Organization: Duke University, Durham, NC, USA
  • Sender: owner-wri-mathgroup at wolfram.com

I am having trouble getting Mathematica to create a plot of the intended
sort, wanted to see if I could get some help from the net:

I have a MxN rectangular matrix of floating point numbers that I want to
plot as a rectangular color contour plot (ListDensityPlot) with an
associated thin color strip showing which colors are associated with
which range of values, something likes this:

   
                --------------------------
                |                        |
                |                        |
                |                        |
                |                        |
                |                        |
                |                        |
                |                        |
                --------------------------

                       -------------  
                       |           |
                       -------------


I am able to generate both ListDensityPlots fine but then get into
trouble when trying to combine them into a single plot: Mathematica
overrides the specified size of each plot when combining them and the
color strip ends up being too small.

Does anyone know tricks for fine-tuning the combination of two separate
plots into a single overall plot?

In particular, if I use ImageSize to specify the size of each plot
separately, how do I get Mathematica to preserve ImageSize when
combining plots? It is most frustrating that Mathematica overrides the
ImageSize specification.

I include some parts of my code below.

	Thanks,

	Henry


=================================================================

g1 = ListDensityPlot[ 
    EEGdata ,
    ColorFunction -> mycolorfn,
    Mesh ->False,
    AspectRatio ->0.4,
    FrameTicks ->{timeLabelsBottom, tickfn[electrodeLabels], 
                  timeLabelsTop, tickfn[electrodeLabels] } ,
    FrameLabel ->{
      StyleForm["Window Index",FontSize ->myfontsize, FontWeight -> Bold
],
      None,
      StyleForm[ "Time", FontSize -> myfontsize, FontWeight -> Bold] ,
      None
    } ,
    ImageSize ->{8.0(72), 5.0 (72) } (* size in printer points, 72 = 1
inch *) ]

g2 = ListDensityPlot[      (* Make color chart based on range of data *)
      colortable, 
      ColorFunction ->mycolorfn,
      Mesh->False,
      Axes->False,
      AspectRatio -> 0.05,
      ImageSize -> { 6.5(72) , 1.5 (72) }  ,
      FrameTicks -> {frameTicksBottom, None, frameTicksTop, None },
      FrameLabel -> { StyleForm[ "Range of Values", FontSize
->myfontsize, 
         FontWeight -> Bold ]  ,
         None,
         None,
        None
      }
]

Show[            (* one attempt to combine graphics *)
  Graphics[
    {
      Rectangle[ {0,0}, {1,1}, g1 ] ,
      Rectangle[ {0.2,-0.4}, {0.8,0} , g2 ] 
    },
  ]
]




  • Prev by Date: Re: Mathmatica Problem...
  • Next by Date: Re: Error in CrossProduct at spherical coordinates  (Version 2.2)
  • Previous by thread: Re: Recommended books for Mathematica
  • Next by thread: loading packages-followup