Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » How do I make this graph?
Re: How do I make this graph? [message #39882 is a reply to message #39823] Thu, 09 May 2013 08:19 Go to previous messageGo to previous message
jerson is currently offline  jerson
Messages: 202
Registered: June 2010
Location: Bombay, India
Experienced Member

Thanks for all the help. I have been able to make a workable solution with the scatterctrl.

index.php?t=getfile&id=4180&private=0
The blue line is what I wish to draw. It interpolates between data points that are presented to scatterctrl. However, the un-initialized vector data shows up at 0,0 This is not desirable because when I turn on .plot(), lines appear connecting 0,0 to each of the points in the series. It looks like cones falling from 0,0(orange lines)

I am setting the vector like this

Vector<Pointf> LeftSeries[4];

Since I have just 12 points on X axis, I enter the data like this
	Test.scaLeft.SetRange(12, 130).SetXYMin(0, -120);
	Test.scaLeft.SetMajorUnits(1, 10).ShowLegend(true);
	Test.scaLeft.SetLabelX("Frequency (Hz)").SetLabelY("dB");
	Test.scaLeft.cbModifFormatX = THISBACK(A2001_13::FormatX);
	Test.scaLeft.cbModifFormatY = THISBACK(A2001_13::FormatY);
	Test.scaLeft.AddSeries(LeftSeries[0]).Legend("ACL").NoPlot()
				.AddSeries(LeftSeries[1]).Legend("ACLM")
				.AddSeries(LeftSeries[2]).Legend("BCL")
				.AddSeries(LeftSeries[3]).Legend("BCLM");


and to plot the points
	double f = -1;
	
	Test.stText = AsString(Test.spnFrequency.GetIndex());
	LeftSeries[0].Set(Test.spnFrequency.GetIndex(), Pointf(Test.spnFrequency.GetIndex(),f*Test.spnIntensity));
	Test.scaLeft.Refresh();


Test is a <TopWindow>, others are EditIntSpin while spnFrequency is a droplist


The user can enter any point (not necessarily in a sequence of X) and the graph would interpolate it.

Question is, can this be done?

Best regards
Jerson
  • Attachment: CropImage.jpg
    (Size: 48.17KB, Downloaded 521 times)
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: MenuBar
Next Topic: SQL + vector related question
Goto Forum:
  


Current Time: Wed Jun 05 12:13:40 CEST 2024

Total time taken to generate the page: 0.02374 seconds