Message Boards Message Boards

GROUPS:

How do I extract data in .txt format from a DensityPlot?

Posted 5 years ago
5212 Views
|
1 Reply
|
0 Total Likes
|

Hello all,

If I have a DensityPlot of a function, how can I extract the data in .txt format?

Here is a simplistic version of what I have:

F = x^2 + y^2;
DensityPlot[(F), {x, -20, 20}, {y, -20, 20}, 
 ColorFunction -> "Rainbow", PlotPoints -> 100, PlotRange -> Full, 
 PlotLegends -> Automatic]

Thanks a lot!

POSTED BY: Sid D
Answer

Does this work for you?

F = x^2 + y^2;
Export["densitydata.tsv", Table[(F), {x, -20, 20}, {y, -20, 20}]]

I've attached a copy of the file it produces.

Attachments:
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract