I have a set of experimental data that I wish to make into a density plot. Then I have to overlay an image of a model function f(x, y, z) = Sin(x/z)Sin(y) on the density image such that parameters a, b and `w are used to control the size and position of the model image on the density image. I actually succeeded halfway as shown in the following code:

canto = Import["forcemapf.xls"];
ListDensityPlot[canto, Axes -> False, Frame -> False]

This produce image1. I now used comton in:

          DensityPlot3D[Sin[x/z] Sin[y], {x, -3, 3}, {y, -3, 3}, {z, -3, 3},
            Axes -> False, Boxed -> False, ColorFunction -> Hue]], 
        White -> Transparent], 
  {s, 50, 300, 1}]

However, I still got the following problems

  1. I currently have only s (controlling the size of the model image) and could not get the other control parameters to work.
  2. I would love to use ListPlotDensity after ImageCompose instead of an image (comton). I am not really sure if this is even possible.
  3. I wish to have legend (probably using PlotLegends) of the model function f(x, y, z) placed by the right hand side. I tried several methods but still did not succeed; one of the methods gave the legend but the model image disappeared. Another method meanwhile worked with the image overlay but the legend did work with ImageCompose.
  4. I could not use other control parameters (w, a and b) unless the objects are certain types of images. My attempt is as follows (image2 is here):

    Manipulate[ ImageCompose[ comton, ImageResize[ ColorReplace[comtona, White -> Transparent], White -> Transparent, w], {a, b}], {w, 50, 300, 1}, {a, 50, 130,10}, {b, 50, 130, 10}]

I would be grateful if you guys can help in checking out where I am getting it wrong.

  • $\begingroup$ Does the data canto match the set of 3D points {x,y,z}? $\endgroup$ – Alex Trounev Jan 28 '19 at 12:48
  • $\begingroup$ @Alex Trounev, thanks. canto represent a 3D data imported to be plotted. It has nothing to do with 3D points {x,y,z}; these points are for the function f(x,y,z)=Sin(x/z)Sin(y)! $\endgroup$ – Dean Jan 28 '19 at 13:15
  • 1
    $\begingroup$ Then the data should look like {x,y,z,f[x,y,z]} $\endgroup$ – Alex Trounev Jan 28 '19 at 13:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.