Applying a fourth variable to a stem3 plot

3 visualizzazioni (ultimi 30 giorni)
I am trying to impose a fourth variable on a stem3 plot. I currently have two position variables, and the third variable is a binning of how many objects are in one 'square degree'. My fourth variable is supposed to link directly to the first and second variables (position variables) by corresponding a specific numerical value to each set of two position variables. The purpose of the fourth variable is to introduce colors (similar to the jet color scheme) that corresponds to each individual value of the fourth variable. For example, if the two position variables have a negative number as the fourth variable, the color displayed in the plot is more red than if the two variables had a positive number as the fourth variable (for then the color in the plot should be more blue).
Below is the code so far:
fid = fopen( 'GWGCCatalogrm.txt');
%trashLine = fgets(fid); %Skips the first line
data = textscan(fid, '%f%s%f%f%s%f%f%f%f%f%f%f%f%f%f%f%f%f', 'Delimiter', '|', 'TreatAsEmpty','~');
fclose(fid);
M1=data;
GalList.pgc = data{1};
GalList.name = data{2};
GalList.ra = data{3};
GalList.dec = data{4};
GalList.major = data{7};
GalList.abs_mag = data{14};
GalList.dist = data{15};
GalList.mass =(10.^( (-20.8 - GalList.abs_mag)./ 2.5 )) ; % Converts Absolute Magnitude into (blue luminosity) mass in units of Milky Way (luminosity) mass (how many potential forming stars in region using the blue luminosity which is rough estimate of mass).
GalList.ra = GalList.ra.*15;
GalList.dec = GalList.dec ;
GalaxyList = GalList;
C1 = GalList.ra;
S1 = GalList.dec;
C12 = round(C1);
S12 = round(S1);
A = accumarray([C12+1, S12+90], 1);
A = A(1:360, :);
A(A==0)=NaN;
cm = flipud(colormap(jet(17)));
c = cell2mat(cellfun(@str2num, data{5}, 'Uni',0))+7; % Define Colour References
[S12M,C12M] = meshgrid([-89:89], [-0:359]);
figure(1)
mesh(S12M, C12M, A)
axis tight
veclens = [size(C12M(:)); size(S12M(:)); size(A(:))]; % Check Vector Lengths
figure(2)
stem3(C12M(:), S12M(:), A(:), '.')
axis tight
Attached is the text file I am working off of.

Risposta accettata

Star Strider
Star Strider il 5 Lug 2015
(This is a continuation of a discussion going back several weeks.)
You can use the stem3 (or scatter3) plot to plot the histogram output, and you can colour the markers individually. (The plot doesn’t care a whit where the data came from.) However in the histogram, you are binning and counting several galaxies that have nothing more in common than sharing similar declinations and right-ascensions, and want to depict the morphology as the ‘fourth dimension’ (marker shape and colour).
I know virtually nothing about astronomy, but if apples, oranges, and bananas all shared the same declination and right-ascension, how would you depict the colour of the marker (the ‘fourth dimension’)? Red? Orange? Yellow?
  6 Commenti
jgillis16
jgillis16 il 6 Lug 2015
OK. I am going to play around with this today to see if I can get it to represent what I want. But, yes. This is roughly what I was looking for! Now, the problem is to get it to visually represent the data in correct astronomical terms. But, I will work on it and update you once I have the correct format (if you want).
Thank you again!
Star Strider
Star Strider il 6 Lug 2015
I would appreciate the update, not only because I’m still doing my best to understand what analysis you’re doing, but because I want to see what you actually want.
Also, it it’s not too sensitive (I understand you wouldn’t want to discuss your research in detail), what hypothesis are you testing?

Accedi per commentare.

Più risposte (1)

Gareth Thomas
Gareth Thomas il 5 Lug 2015
Hi,
I am not sure if you have seen on MATLAB Examples the following entry:
This could be a good starting point to solve your question.
Gareth

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by