View previous topic :: View next topic |
Author |
Message |
BColbert
Joined: 02 Jun 2010 Posts: 1
|
Posted: Wed Jun 02, 2010 10:49 am Post subject: 4D Scatter Plot - Visual Basic - DPLOT.DLL |
|
|
I am trying to add some VB code to automatically create 4D Scatter plots. Currently, this is not even program in the Excel add-in either because I have had to do the steps manually in DPlot to create this type of 4d scatter plot.
Is it possible to create this type of plot with the current version of the DPLOT.DLL? Or alternatively, can a Dplot Macro be created to do so? Apprarently DPLOT doesnt have a "record macro" function like Excel, so I guess I would have to learn those commands to do so? Where do I start?
Can a Dplot Macro be automatically called from a VB code? Basically I want to open DPlot, create the 4d Scatter with the appropriate settings for my type of plot, and then output a JPG. Is this possible?
Thanks,
Bob Colbert |
|
Back to top |
|
 |
DPlotAdmin Site Admin

Joined: 24 Jun 2003 Posts: 2306 Location: Vicksburg, Mississippi
|
Posted: Wed Jun 02, 2010 12:35 pm Post subject: |
|
|
Quote: | Is it possible to create this type of plot with the current version of the DPLOT.DLL? |
Yes, with a couple of minor changes. Open the btest project and the file Global.bas. Find the line
Global Const DATA_3DS = 7 ' 3D scatter plot
and add
Global Const DATA_4D = 8
Global Const DATA_4DS = 9
The data organization with a 4D scatter plot is identical to that of a 3D scatter plot with an additional value/point, so the 3D example is a good place to start. I'd suggest copying Command7_Click to a new routine and making these changes:
ReDim Node(2, Ntotal - 1)
to
ReDim Node(3, Ntotal - 1)
In the loop assigning values to X,Y,Z, add a line assigning some amplitude to Node(3,k)
Change
d.DataFormat = DATA_3DS
to
d.DataFormat = DATA_4DS
and in the command string change [ColorBasis(1)] to [ColorBasis(0)].
Quote: | Basically I want to open DPlot, create the 4d Scatter with the appropriate settings for my type of plot, and then output a JPG. Is this possible? |
Yes. After calling DPlot_Plot8, call
DPlot_Command(doc,"[FileSaveAs(""JPEG Picture"",""filename.jpg"")]")
where doc is the return value of DPlot_Plot8.
(This must be done in a separate call to DPlot_Command as suggested here, not included in the command string sent to DPlot_Plot.) _________________ David Hyde
support@dplot.com |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|