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
 Setting Line+Symbol color and shape AND axes
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

cowsclaw

USA
Posts

Posted - 06/14/2004 :  8:52:12 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
This might actually be a Labtalk question, but maybe you can answer it anyways.

The user has already selected the data files and the data has been imported into columns and datasets. For this particular subroutine, I am trying to plot all of the data (from nnCols number of columns) from each of the data files (number of files = nnRuns). The problem is, whenever I plot it, all of the Line+Symbol plots are black and you can't distinguish between them. So, my question is, what is the code to plot each of the columns in a different color?

another, unrelated question is: if i know the maximum and minimum values (x-axis) of my plot, how do I set the axis range to match?

I am using OriginPro 7.0, btw.

Thanks

void makeSampleGraph(int nnCols, int nnRuns, Worksheet wssData)
{
for(int it = 0; it<nnRuns+1; it++) //go through each of files
{
GraphPage grph;
string strTemplate = "Z:\Origin_script_templates\sims-time_vs_count.OTP";
BOOL bOK = grph.Create(strTemplate, CREATE_VISIBLE);
GraphLayer grlay = grph.Layers(0);
ASSERT(grph.IsValid());
for(int is = 1; is < nnCols; is++) //plot each column of data
{
Curve cv(wssData, it*nnCols + is);
grlay.AddPlot(cv);
grlay.Rescale();
} //end for
} //end for
}

Mike Buess

USA
3037 Posts

Posted - 06/15/2004 :  08:42:19 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
for(int is = 1; is < nnCols; is++) //plot each column of data
{
Curve cv(wssData, it*nnCols + is);
grlay.AddPlot(cv);
grlay.DataPlots(is-1).SetColor(is-1); // plot color
grlay.Rescale();
}
Scale s(grlay.X);
s.From = minimum value;
s.To = maximum value;

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 06/15/2004 08:43:54 AM
Go to Top of Page

cowsclaw

USA
Posts

Posted - 06/15/2004 :  11:56:50 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
thanks, mike.
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