Group Abstract Group Abstract

Message Boards Message Boards

1
|
1.9K Views
|
2 Replies
|
3 Total Likes
View groups...
Share
Share this post:

About extracting values in DensityPlot

Posted 5 years ago

Hello I have a notebook file in which the Electric field is calculated as follows

jet[u_?NumericQ] := 
 Blend[{{0, RGBColor[0, 0, 9/16]}, {1/9, Blue}, {23/63, Cyan}, {13/21,
      Yellow}, {47/63, Orange}, {55/63, Red}, {1, 
     RGBColor[1/2, 0, 0]}}, u] /; 0 <= u <= 1

Etotal = Sum[   Gee.p /. Pd /. {x0 -> xd[[i]], y0 -> 0, z0 -> 0}, {i, 1, Nd}];
DensityPlot[Norm[Etotal] /. z -> 0, {x, -0.3, 0.3}, {y, 1, 1.5},      PlotPoints -> 150, ColorFunction -> jet, PlotRange -> Full,      AspectRatio -> Automatic]`

I want to get the values computed in Norm[Etotal] in the domain of z -> 0, {x, -0.3, 0.3}, {y, 1, 1.5} I need a table of the form

x coordinate y coordinate Enorm x1 y1 Enorm1 x2 y2 Enorm2

and so on.

Can anyone help?

POSTED BY: Toufiq Hossain
2 Replies
Posted 5 years ago

Hello Rohit,

Thank you for your help. It solved my problem.

POSTED BY: Toufiq Hossain
Posted 5 years ago

Hi Toufiq,

A table of values can be generated with whatever granularity is needed using

z0[x_, y_] = Norm[Etotal] /. z -> 0;
Table[{x, y, z0[x, y]}, {x, -0.3, 0.3, .1}, {y, 1, 1.5, .1}]

To get the same granularity / sampling that was used by DensityPlot

plot = DensityPlot[z0[x, y], {x, -0.3, 0.3}, {y, 1, 1.5},
  PlotPoints -> 150,
  ColorFunction -> jet,
  PlotRange -> Full,
  AspectRatio -> Automatic]

points = plot[[1, 1, 1]];
{First@#, Last@#, z0 @@ #} & /@ points
POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard