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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 ploting: color & size

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
ovince Posted - 09/16/2006 : 09:03:28 AM
hi All,

I would like to learn how to color the plot and change the size of symbols. Namely, I would like to have

1) data (lot of pints)
2) mean in 10 data bins and
3) median in 10 data bins

on the same Layer. So far I am doing well with few commands like

gly.AddPlot( crvAll, IDM_PLOT_SCATTER );
gly.AddPlot( crvMean, IDM_PLOT_LINE );
gly.AddPlot( crvMedian, IDM_PLOT_LINE );

But the symbol size of the data points (crvAll) is so large that it is unconvinient to see anything else on the graph. So I would like to make the symbol size smaller. Also it would be nice to put crvMean and crvMedian in different colors. How to designate all points (crvAll, crvMean and crvMedian) in the Legend?

Anybody to help me with this?

thanks many in advance
Oliver
4   L A T E S T    R E P L I E S    (Newest First)
ovince Posted - 09/17/2006 : 1:54:25 PM
thanks Mike

It works fine.

oliver
Mike Buess Posted - 09/17/2006 : 10:19:54 AM
Hi Oliver,

Try this...
void plotting_with_err_bar()
{
foreach (PageBase pg in Project.Pages)
{
if( pg.GetType()==EXIST_WKS )
{
Worksheet wks(pg.GetName());

// define curves
Curve crvMedian(wks, 0, 1);
Curve crvMean(wks, 0, 2);

// define error bars
Dataset dsErrMedian(wks, 3);
Dataset dsErrMean(wks, 4);

GraphPage gpg;
gpg.Create( "Origin.OTP" );
GraphLayer gly = gpg.Layers( 0 );

// add and format Median plot
int iMedian = gly.AddPlot( crvMedian, IDM_PLOT_LINESYMB );
DataPlot dpMedian = gly.DataPlots(iMedian);
dpMedian.Curve.Symbol.Shape.nVal = 2;
dpMedian.Curve.Symbol.Size.nVal = 3;
dpMedian.Curve.Symbol.EdgeColor.nVal = 1;
dpMedian.Curve.Line.Color.nVal = 1;

// add and format Mean plot
int iMean = gly.AddPlot( crvMean, IDM_PLOT_LINESYMB );
DataPlot dpMean = gly.DataPlots(iMean);
dpMean.Curve.Symbol.Shape.nVal = 2;
dpMean.Curve.Symbol.Size.nVal = 3;
dpMean.Curve.Symbol.EdgeColor.nVal = 0;
dpMean.Curve.Line.Color.nVal = 0;

// add error bars
gly.AddErrBar( crvMedian, dsErrMedian );
gly.AddErrBar( crvMean, dsErrMean );

gly.Rescale(); // rescale
}
}
}


Mike Buess
Origin WebRing Member
ovince Posted - 09/17/2006 : 06:51:30 AM
thanks Mike,

I was trying to apply the recommanded help to my problem and I failed. I would like to ask for detailed help?

So, I have about 40 worksheets with
- independent variable (1st column)
- median of dependent variable (2nd column)
- mean of dependent variable (3th column),
- error bars to median (4th column),
- error bars to mean (4th column).

I am trying to make 40 plots with median and mean colored differently.
What I have done so far is very simple:

void plotting_with_err_bar()
{
PageBase pg;

// Create a Project object
Project proj;

foreach (pg in proj.Pages)
{
Worksheet wks(name);

//define curves
Curve crvMedian(wks, 0, 1);
Curve crvMean(wks, 0, 2);

//define error bars
Dataset dsErrMedian(wks, 3);
Dataset dsErrMean(wks, 4);

GraphPage gpg;
gpg.Create( "Origin.OTP" );
GraphLayer gly = gpg.Layers( 0 );

// Add the first plot
gly.AddPlot( crvMedian, IDM_PLOT_LINE );

DataPlot dp = gly.DataPlots(0);
// Redefine data plot object
dp = gly.DataPlots(0);
// Get format of data plot to tree and output tree
Tree trFormat;
trFormat = dp.Curve;
dp.Curve.Symbol.Shape.nVal = 2; // filled circles
dp.Curve.Symbol.EdgeColor.nVal = 1; // red color
dp.Curve.Symbol.Size.nVal = 3; // size 12

// Add the second plot
gly.AddPlot( crvMean, IDM_PLOT_LINE );

.............................

HOW TO DEAL WITH ADDED PLOT
}
}


I have a problem to continue. I do something wrong all the time and don't know what. Please (somebody patient enough :)) to direct me

thanks
oliver
Mike Buess Posted - 09/16/2006 : 11:27:33 AM
Hi Oliver,

See the Change Plot Format example here.

Mike Buess
Origin WebRing Member

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000