The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 How to set Line+Scatter plot type?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

liujibao

China
Posts

Posted - 05/18/2004 :  08:20:14 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
How to set Line+Scatter plot type in origin C?
I only know how to set Line or Scatter type:
AddPlot(curve,IDM_PLOT_LINESYMB)
AddPlot(curve,IDM_PLOT_SCATTER)

Mike Buess

USA
3037 Posts

Posted - 05/18/2004 :  09:09:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Plot types are defined in oPlotIDs.h. These are the common types...

#define IDM_PLOT_LINE 200 // Line
#define IDM_PLOT_SCATTER 201 // Scatter
#define IDM_PLOT_LINESYMB 202 // Line+Symbol (perhaps your symbol size was 0?)
#define IDM_PLOT_COLUMN 203
#define IDM_PLOT_AREA 204
#define IDM_PLOT_HILOCLOSE 205
#define IDM_PLOT_BOX 206

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 05/18/2004 09:54:18 AM
Go to Top of Page

evanm

Canada
Posts

Posted - 05/27/2004 :  08:12:05 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
But if you are using Origin 7, plot types are defined in the file OC_const.h
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 05/27/2004 :  08:56:50 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Yes, the definitions were moved in Origin 7.5 but haven't changed. The ID numbers are the same as those used with LabTalk's "worksheet -p" command.

Mike Buess
Origin WebRing Member
Go to Top of Page

liujibao

China
Posts

Posted - 06/09/2004 :  10:54:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
oh,Thanks a lot!

but how to set symbol size ?
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 06/09/2004 :  2:07:49 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I don't think there's an Origin C method for changing the symbol size so you need to use LabTalk (set -z)...
void SetSymbolSizes(int symbolSize)
{
GraphLayer gl = Project.ActiveLayer();
string strCmd;

foreach ( DataPlot dp in gl.DataPlots )
{
strCmd.Format("set %s -z %d;",dp.GetDatasetName(),symbolSize);
gl.LT_execute(strCmd);
}
}


Mike Buess
Origin WebRing Member
Go to Top of Page

rlewis

Canada
253 Posts

Posted - 06/14/2004 :  6:34:51 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can also try something like the following ...


bool SetSymbolSize(int SymbSize)
{
GraphPage gP=Project.Pages(-1);
GraphLayer gL=gP.Layers();
if(gL.IsValid())
{
DataPlot dP=gL.DataPlots(-1);
Tree tR;
tR=dP.Curve;
tR.Symbol.Size.nVal=SymbSize;
dP.Curve=tR;
gP.SetShow();
return (true);
}
return (false);
}
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000