Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: ArrayPlot coordinates scaling for overlays

  • To: mathgroup at smc.vnet.net
  • Subject: [mg109182] Re: ArrayPlot coordinates scaling for overlays
  • From: "David Park" <djmpark at comcast.net>
  • Date: Fri, 16 Apr 2010 05:50:23 -0400 (EDT)

To me, at least, the specification of your problem seems confused or
incomplete.

Why don't you give us the statements for the two plots, and then tell us how
you want to overlay the second plot on the first plot? Do you mean you want
to Inset the second plot as a subplot? Then check out Inset. If you want to
overlay then are you going to use Opacity to prevent the second plot from
completely obscuring the first plot? 

Have you looked into the DataRange option?

I fairly certain your problem can be solve in a more direct manner, but it
needs better definition with all the starting data.


David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/  


From: fd [mailto:fdimer at gmail.com] 


All

This seems a simple problem I not finding an easy solution.

I have a plot obtained from an ArrayPlot, for which the coordinates
are the indexes of the matrix being plotted; I want to overlay to this
plot some other plot, say, from DensityPlot. I have to tell
Mathematica that the bottom left corner of the ArrayPlot is {xi,yi}
and the upper right is {xf,yf}.

It would be nice as well to know how you could do this with a raster
image in general.

I was trying to use ListDensityPlot, but for the specific problem I
dealing with it is excruciatingly slow.

I'm also working to re-scale the FrameTicks by defining a new
ArrayPlot function, with limited success. Below the code I'm working
on.

Would anyone have an idea about this? Thanks in advance for any help.
Felipe

arrayPlotScale[array_List, {xmin_, xmax_}, {ymin_, ymax_}] :=
 Module[{deltas =
    Reverse[{ymax - ymin, xmax - xmin}/Dimensions[array]],
   n = Dimensions[array] // Reverse},
  ArrayPlot[array,
   FrameTicks ->
    Reverse[{Table[{i, xmin + i deltas[[1]] }, {i, 0, n[[1]], 20}],
      Table[{n[[2]] - i, ymin + i deltas[[2]]}, {i, 0, n[[2]],
10}]}]]]

test = Table[i j, {i, 1, 100}, {j, 100, 1, -1}];

arrayPlotScale[test, {0, 16}, {0, 100}]




  • Prev by Date: Re: piecewise function
  • Next by Date: Re: Through[(a+b+b)[x]]
  • Previous by thread: Re: ArrayPlot coordinates scaling for overlays
  • Next by thread: Re: ArrayPlot coordinates scaling for overlays