Re: ArrayPlot coordinates scaling for overlays
- To: mathgroup at smc.vnet.net
- Subject: [mg109287] Re: ArrayPlot coordinates scaling for overlays
- From: fd <fdimer at gmail.com>
- Date: Tue, 20 Apr 2010 05:52:45 -0400 (EDT)
- References: <hq9c3m$qh4$1@smc.vnet.net> <201004190648.CAA06709@smc.vnet.net>
Hi Patrick Yep, much better this way. Trying on other things I couldn't find the right syntax for putting Opacity in the ColorFunction, especially that it requires brackets "(..)" to work as in your example. Something else to put in the bag of tricks. Thanks On Apr 19, 7:58 pm, Patrick Scheibe <psche... at trm.uni-leipzig.de> wrote: > Hi, > > what about > > ArrayPlot[ > Table[With[{z = x + I y}, > With[{w = (1 + z + z^2 + z^3)/(1 + z + z^2)}, Abs[w]]], {y, -1,= 1, > 0.1}, {x, -1, 1, 0.1}], > ColorFunction -> (Opacity[0.5, ColorData["TemperatureMap"][#]] &), > DataRange -> {{-1, 1}, {-1, 1}}, Epilog :> {Arrow[{{0, 0}, {1, 1}}]}] > > ? > > Cheers > Patrick > > Am Apr 19, 2010 um 8:48 AM schrieb fd: > > > > > All > > > I've used the DataRange option and it worked quite well. A bit of a > > downside DataRange is not listed in the options of ArrayPlot. > > > Below is the code with an example of what I'm trying to do. Please let > > me know if any of you would have a neater way of doing it. Many thanks > > for the help. > > > a = ArrayPlot[ > > Table[With[{z = x + I y}, > > With[{w = (1 + z + z^2 + z^3)/(1 + z + z^2)}, Abs[w]]], {y, -1= , 1, > > 0.1}, {x, -1, 1, 0.1}], ColorFunction -> "TemperatureMap", > > DataRange -> {{-1, 1}, {-1, 1}}] > > > b = Graphics[Arrow[{{0, 0}, {1, 1}}]] > > > Show[b, Graphics[{Opacity[0.5], First@a}]] > > > On Apr 16, 7:53 pm, Patrick Scheibe <psche... at trm.uni-leipzig.de> > > wrote: > >> Hi, > > >> use DataRange to tell Mathematica about the rectangle where your > >> ArrayPlot is in > > >> img = Import["http://sipi.usc.edu/database/misc/5.1.12.tiff"]; > >> Show[{ > >> ArrayPlot[img[[1]], DataRange -> {{0, 2 Pi}, {-1, 1}}, > >> ColorFunction -> GrayLevel], > >> Plot[Sin[x], {x, 0, 2 Pi}] > >> }] > > >> and you can overlay different plots. > > >> Cheers > >> Patrick > > >> On Wed, 2010-04-14 at 23:13 -0400, fd wrote: > >>> 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}]
- References:
- Re: ArrayPlot coordinates scaling for overlays
- From: fd <fdimer@gmail.com>
- Re: ArrayPlot coordinates scaling for overlays