Solved: ? about MatrixPlot used with ListPlot
- To: mathgroup at smc.vnet.net
- Subject: [mg107729] Solved: [mg107682] ? about MatrixPlot used with ListPlot
- From: Anne Goj <agoj at mail.uh.edu>
- Date: Thu, 25 Feb 2010 01:50:27 -0500 (EST)
Thanks for the many replies. The solution to the problem, courtesy of Maxim, was to specify the DataRange of the Matrix plot rather than the PlotRange plotB=MatrixPlot[Transpose[dataB], DataRange -> {{1, 50000}, {1, 10}}, MaxPlotPoints -> {10, 50000}, AspectRatio -> 1/1.2, ColorFunction -> StarryNightColors] plotA = ListPlot[dataA, PlotJoined -> False, PlotStyle -> {PointSize[0.04]}, PlotRange -> {{1, 50000}, {1,10}}] Show[plotA,plotB] This ensures that the coordinate range plotted in the MatrixPlot will be the same as in the ListPlot. (The AspectRatio option is needed so keep the plot from being too skinny.) -A.G. ----- Original Message ----- From: Anne Goj =3Cagoj=40mail.uh.edu> Date: Monday, February 22, 2010 6=3A10 pm Subject: [mg107729] [mg107682] Re: about MatrixPlot used with ListPlot To: mathgroup at smc.vnet.net > Hi, > I am trying to show a set of (x,y) points on top of > a matrix plot > > plotA = ListPlot[dataA, PlotJoined -> False, PlotStyle -> { > PointSize[0.04]}, PlotRange -> {{1, 50000}, {1, 10}}] > > plotB = MatrixPlot[dataB, DataReversed ->{True, False} ] > > > Show[plotB,plotA] > > but I am getting plotA back with no matrix plot underneath and > the axis > ticks look messed up like it is trying to include plotB but the > size/range is wrong. The data ranges for the 2 plots are > the same. I have fiddled with AspectRatios and other parameters > but can't find a fix. > Unfortunately, due to the large amount of data in dataB > (a 50000 x 10 matrix), ListDensityPlot doesn't work as well as > MatrixPlot. > Any help with how to show both plots together would be > appreciated.-A.G.