Scatter plot does not display multiplied values
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
לק"י
Hello!
I want to scatter plot some data (two vectors and two numbers). when I scatter them the plot is correct.
If I add multiplication by a constant, the vectors are scattered well with the new values, but the numbers are not, and I can't figure out why. I tried to put them in brackets, but it didnt help. and when I calculate the values they are correct. only the display is not updated (I close the figure after the code update).
The origianl code:
figure (2)
scatter(acd3sctrdata(1:end,1), acd3sctrdata(1:end,3), 'blue', 'filled')
hold on
scatter(acd45sctrdata(1:end,1), acd45sctrdata(1:end,3), 'red', 'filled')
scatter(3.5, [acd3means{10,2}], 10, 'blue', "filled")
e3=errorbar(3.5, [acd3means{10,2}],[acd3means{10,3}], 'x')
e3.Color= 'black';
scatter(1.5, [acd45means{10,2}], 10, 'red', "filled")
e45=errorbar(1.5, [acd45means{10,2}],[acd45means{10,3}], 'x')
e45.Color= 'black';
hold off
title('CD8+ CAR-T cells area of pixels > 1.5, upon aCD45(r) and aCD3(b)')
xlabel('aCD45 aCD3')
ylabel('Area of pixels > avg*1.5, um^2')
legend({'Blue = aCD3', 'Red = aCD45'},'Location','northwest')
The plot it generates:
The code with *1.66 multiplication added:
figure (2)
scatter(acd3sctrdata(1:end,1), acd3sctrdata(1:end,3)*0.166, 'blue', 'filled')
hold on
scatter(acd45sctrdata(1:end,1), acd45sctrdata(1:end,3)*0.166, 'red', 'filled')
scatter(3.5, [acd3means{10,2}]*0.166, 10, 'blue', "filled")
e3=errorbar(3.5, [acd3means{10,2}],[acd3means{10,3}]*0.166, 'x')
e3.Color= 'black';
scatter(1.5, [acd45means{10,2}]*0.166, 10, 'red', "filled")
e45=errorbar(1.5, [acd45means{10,2}],[acd45means{10,3}]*0.166, 'x')
e45.Color= 'black';
hold off
title('CD8+ CAR-T cells area of pixels > 1.5, upon aCD45(r) and aCD3(b)')
xlabel('aCD45 aCD3')
ylabel('Area of pixels > avg*1.5, um^2')
legend({'Blue = aCD3', 'Red = aCD45'},'Location','northwest')
The plot it generates, where the [acd3means{10,2}]*0.166 and [acd45means{10,2}]*0.166 are not displayed/updated well:
Please, if anyone know what am I doing wrong please let me know.
Thanks,
Amit.
0 Commenti
Risposte (1)
VBBV
il 25 Lug 2023
Modificato: VBBV
il 25 Lug 2023
If I add multiplication by a constant, the vectors are scattered well with the new values, but the numbers are not
This is something strange, May be you have to change the figure number to see the actual difference in numbers and/or values in separate figures. It seems you are using same figure number and perhaps inside a loop when viewing the outputs which can be confusing sometimes. According to your screenshots the numbers seemed to be plotted or displayed well after scaling with number 0.166. Do you actually want to use 1.66 instead ?
figure (1)
scatter(acd3sctrdata(1:end,1), acd3sctrdata(1:end,3), 'blue', 'filled')
hold on
scatter(acd45sctrdata(1:end,1), acd45sctrdata(1:end,3), 'red', 'filled')
scatter(3.5, [acd3means{10,2}], 10, 'blue', "filled")
e3=errorbar(3.5, [acd3means{10,2}],[acd3means{10,3}], 'x')
e3.Color= 'black';
scatter(1.5, [acd45means{10,2}], 10, 'red', "filled")
e45=errorbar(1.5, [acd45means{10,2}],[acd45means{10,3}], 'x')
e45.Color= 'black';
hold off
title('CD8+ CAR-T cells area of pixels > 1.5, upon aCD45(r) and aCD3(b)')
xlabel('aCD45 aCD3')
ylabel('Area of pixels > avg*1.5, um^2')
legend({'Blue = aCD3', 'Red = aCD45'},'Location','northwest')
figure (2) %// change the figure number
scatter(acd3sctrdata(1:end,1), acd3sctrdata(1:end,3)*0.166, 'blue', 'filled')
hold on
scatter(acd45sctrdata(1:end,1), acd45sctrdata(1:end,3)*0.166, 'red', 'filled')
scatter(3.5, [acd3means{10,2}]*0.166, 10, 'blue', "filled")
e3=errorbar(3.5, [acd3means{10,2}],[acd3means{10,3}]*0.166, 'x')
e3.Color= 'black';
scatter(1.5, [acd45means{10,2}]*0.166, 10, 'red', "filled")
e45=errorbar(1.5, [acd45means{10,2}],[acd45means{10,3}]*0.166, 'x')
e45.Color= 'black';
hold off
title('CD8+ CAR-T cells area of pixels > 1.5, upon aCD45(r) and aCD3(b)')
xlabel('aCD45 aCD3')
ylabel('Area of pixels > avg*1.5, um^2')
legend({'Blue = aCD3', 'Red = aCD45'},'Location','northwest')
Vedere anche
Categorie
Scopri di più su Graphics Performance 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!