Home

Plotting spectral data in Access

%3CLINGO-SUB%20id%3D%22lingo-sub-918058%22%20slang%3D%22en-US%22%3EPlotting%20spectral%20data%20in%20Access%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-918058%22%20slang%3D%22en-US%22%3E%3CP%3EMy%20table%20has%20the%20following%20structure%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFieldName%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20Value%3C%2FP%3E%3CP%3Enm380%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%201.23%3C%2FP%3E%3CP%3Enm390%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B2.67%3C%2FP%3E%3CP%3Enm400%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B3.87%3C%2FP%3E%3CP%3Enm410%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%203.45%3C%2FP%3E%3CP%3E...%3C%2FP%3E%3CP%3Enm710%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B1.45%3C%2FP%3E%3CP%3Enm720%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B2.45%3C%2FP%3E%3CP%3Enm730%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B0.67%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEach%20record%20contains%20spectral%20data%20extending%20from%20380%20nanometer%20(nm380)%20to%20730%20nanometer%20(nm730).%20How%20can%20I%20plot%20this%20data%20in%20Access%3F%20I%20have%20experimented%20with%20many%20different%20approaches%20to%20no%20avail.%20I%20suppose%20I%20have%20to%20%22massage%22%20the%20data%2C%20somehow%2C%20so%20that%20they%20become%20in%20a%20form%20of%20X%2CY%20data%3F%20So%20that%2C%20the%20%22nm%22%20column%20becomes%20X%3F%20The%20Value%20column%20is%20already%20in%20a%20form%20directly%20usable%20as%20Y.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20was%20thinking%2C%20perhaps%2C%20to%20extract%20the%20%22number%22%20380%2C%20390%2C%20400%20and%20so%20on%20out%20of%20the%20field%20name%3F%20So%20that%20it%20could%20become%20a%20%22number%22%20and%20show%20up%20on%20the%20X%20axis%3F%20But%20I%20have%20found%20a%20function%20to%20do%20this%20in%20the%20Query%20Editor%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-918058%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAccess%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-918319%22%20slang%3D%22en-US%22%3ERe%3A%20Plotting%20spectral%20data%20in%20Access%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-918319%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F402724%22%20target%3D%22_blank%22%3E%40RogerBreton%3C%2FA%3E%26nbsp%3BWhat%20exactly%20you%20mean%20%22plotting%22%3C%2FP%3E%3CP%3EIf%20actual%20plotting%20is%20required...then%3C%2FP%3E%3CP%3EEither%20use%20a%20chart%20to%20host%20the%20data%3C%2FP%3E%3CP%3Eor%20a%20Report%2FForm%20and%20the%20Line%20Control%20to%20make%20some%20kind%20of%20pseudo%20chart%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-918074%22%20slang%3D%22en-US%22%3ERe%3A%20Plotting%20spectral%20data%20in%20Access%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-918074%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F402724%22%20target%3D%22_blank%22%3E%40RogerBreton%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20meant%20to%20write%20%22%3CSPAN%3EBut%20I%20have%20%3CSTRONG%3ENOT%3C%2FSTRONG%3E%20found%20a%20function%20to%20do%20this%20in%20the%20Query%20Editor%3F%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
RogerBreton
Occasional Contributor

My table has the following structure:

 

FieldName        Value

nm380              1.23

nm390               2.67

nm400               3.87

nm410                3.45

...

nm710               1.45

nm720               2.45

nm730               0.67

 

Each record contains spectral data extending from 380 nanometer (nm380) to 730 nanometer (nm730). How can I plot this data in Access? I have experimented with many different approaches to no avail. I suppose I have to "massage" the data, somehow, so that they become in a form of X,Y data? So that, the "nm" column becomes X? The Value column is already in a form directly usable as Y. 

 

I was thinking, perhaps, to extract the "number" 380, 390, 400 and so on out of the field name? So that it could become a "number" and show up on the X axis? But I have found a function to do this in the Query Editor?

4 Replies

@RogerBreton 

 

I meant to write "But I have NOT found a function to do this in the Query Editor?

@RogerBreton What exactly you mean "plotting"

If actual plotting is required...then

Either use a chart to host the data

or a Report/Form and the Line Control to make some kind of pseudo chart

I found ONE way to do it, and it does not work with the "new" Chart control. I had to use the "old" chart control for this approach to work. Essentially, the "trick" revolves around using "ALIAS" for each of the original field names. So, instead of "nm380", I used the following, in a query, and use THAT as the RowSource :

 

SELECT Mesures.ID, Mesures.nm380 AS 380, Mesures.nm390 AS 390, Mesures.nm400 AS 400, Mesures.nm410 AS 410, Mesures.nm420 AS 420, Mesures.nm430 AS 430, Mesures.nm440 AS 440, Mesures.nm450 AS 450, Mesures.nm460 AS 460, Mesures.nm470 AS 470, Mesures.nm480 AS 480, Mesures.nm490 AS 490, Mesures.nm500 AS 500, Mesures.nm510 AS 510, Mesures.nm520 AS 520, Mesures.nm530 AS 530, Mesures.nm540 AS 540, Mesures.nm550 AS 550, Mesures.nm560 AS 560, Mesures.nm570 AS 570, Mesures.nm580 AS 580, Mesures.nm590 AS 590, Mesures.nm600 AS 600, Mesures.nm610 AS 610, Mesures.nm620 AS 620, Mesures.nm630 AS 630, Mesures.nm640 AS 640, Mesures.nm650 AS 650, Mesures.nm660 AS 660, Mesures.nm670 AS 670, Mesures.nm680 AS 680, Mesures.nm690 AS 690, Mesures.nm700 AS 700, Mesures.nm710 AS 710, Mesures.nm720 AS 720, Mesures.nm730 AS 730
FROM Mesures;

 

This way, the horizontal X axis was displayed "correctly", in a "meaningful" way. It worked beautifully. 

 

I tried the same technique with the "new" chart control and it did not work? If there is a, "better" technique, anyone, please! I am opened to suggestions.

@tsgiannis Yes, of course, I used a "Chart" control.

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
29 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies