510vues (au cours des 30derniers jours)
Afficher commentaires plus anciens
Mr M. le 9 Oct 2018
-
-
Lien
Utiliser le lien direct vers cette question
https://fr.mathworks.com/matlabcentral/answers/422964-how-to-use-scatter-with-transparent-dots
Commenté: Benjamin le 29 Jan 2024
Réponse acceptée: Adam Danz
facealpha is not working for me
1commentaire Afficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens
Afficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens
KSSV le 9 Oct 2018
Utiliser le lien direct vers ce commentaire
https://fr.mathworks.com/matlabcentral/answers/422964-how-to-use-scatter-with-transparent-dots#comment_619601
Show the code..which you tried.
Connectez-vous pour commenter.
Connectez-vous pour répondre à cette question.
Réponse acceptée
Adam Danz le 9 Oct 2018
⋮
Modifié(e): Adam Danz le 14 Juin 2022
Ouvrir dans MATLAB Online
MarkerFaceAlpha and MarkerEdgeAlpha are what you're looking for. Check out this example.
https://www.mathworks.com/examples/matlab/mw/graphics-ex36949892-create-scatter-chart-with-transparency
[from the link]
x = [5 10 11 13 18];
y1 = [40 80 150 80 50];
a1 = 100*[100 50 80 30 50];
scatter(x,y1,a1,'MarkerFaceColor','b','MarkerEdgeColor','b',...
'MarkerFaceAlpha',.2,'MarkerEdgeAlpha',.2)
axis([0 20 0 200])
x = [2 6 8 11 13];
y2 = [30 40 100 60 140];
a2 = 100*[30 50 30 80 80];
hold on
scatter(x,y2,a2,'MarkerFaceColor','r','MarkerEdgeColor','r',...
'MarkerFaceAlpha',.2,'MarkerEdgeAlpha',.2)
hold off
7commentaires Afficher 5 commentaires plus anciensMasquer 5 commentaires plus anciens
Afficher 5 commentaires plus anciensMasquer 5 commentaires plus anciens
Craig Puetz le 30 Juin 2021
Utiliser le lien direct vers ce commentaire
https://fr.mathworks.com/matlabcentral/answers/422964-how-to-use-scatter-with-transparent-dots#comment_1613638
Modifié(e): Image Analyst le 14 Juin 2022
Ouvrir dans MATLAB Online
I am trying this with v2020b and it simply doesn't work - no combination of parameters makes the markers transparent.
Goal:
1) Plot a group of points on a geoaxis with a 3rd dataset that varies in color: Working
2) Plot two additional groups of points with the areas covered in a lightly tinted "blob": Not working, blob is full intensity, not transparent
Code:
f1 = figure(1);
clf;
gx1 = geoaxes;
geobasemap satellite
hold on
std_scaled = paawDF.std_Alt/(max(paawDF.std_Alt)-min(paawDF.std_Alt));
h1 = scatter(gx1,paawDF.lat_dd,paawDF.lon_dd,20,std_scaled,"filled");
h2 = scatter(gx1,decBigData.Latitude(taFilter),decBigData.Longitude(taFilter),5,"filled", ...
"Marker", 'o', ...
"MarkerFaceColor", [0 1 0],"MarkerEdgeColor",'none', ...
"MarkerFaceAlpha", .3, "MarkerEdgeAlpha", .3);
% param
% set(h2.MarkerHandle, 'FaceColorType','truecoloralpha', 'FaceColorData',uint8([0;200;0; 50]));
% h2 = plot(gx1,decBigData.Latitude(taFilter),decBigData.Longitude(taFilter),'o','Color',[0 1 0 0.2]);
h3 = plot(gx1,decBigDataWheel.Latitude(taFilterWheel),decBigDataWheel.Longitude(taFilterWheel),'.r');
% h2.MarkerFaceAlpha = .2;
% h2.MarkerEdgeAlpha = .2;
% h3.MarkerFaceAlpha = .2;
% h3.MarkerEdgeAlpha = .2;
Obviously, I have not run all of these settings at the same time, those commented out are other things I have tried.
All comments are welcome!
Image Analyst le 14 Juin 2022
Utiliser le lien direct vers ce commentaire
https://fr.mathworks.com/matlabcentral/answers/422964-how-to-use-scatter-with-transparent-dots#comment_2215860
@Craig Puetz ok what you tried did not work. (I can't try it because I don't have the Mapping Toolbox.) But does @Adam Danz's original code work for you?
Adam Danz le 20 Juin 2022
Utiliser le lien direct vers ce commentaire
https://fr.mathworks.com/matlabcentral/answers/422964-how-to-use-scatter-with-transparent-dots#comment_2224565
Moving @Craig Puetz's answer here
----------------------------------------------------
I went back and ran the original code (took me a minute to remember what this was even about!).
@Adam Danz Your code works properly and produces exactly the image shown in this example. I don't know why similiar commands don't produce similiar results in my example with the Mapping toolbox.
Adam Danz le 20 Juin 2022
Utiliser le lien direct vers ce commentaire
https://fr.mathworks.com/matlabcentral/answers/422964-how-to-use-scatter-with-transparent-dots#comment_2224575
@Craig Puetz, we can't run your code without having the data (ie, paawDF, ect). Have you tried using geoscatter and geoplot instead of scatter and plot?
Jacek Wodecki le 17 Août 2022
Utiliser le lien direct vers ce commentaire
https://fr.mathworks.com/matlabcentral/answers/422964-how-to-use-scatter-with-transparent-dots#comment_2319370
markerfacealpha and markeredgealpha is not doing anything, Matlab 2021b. Anyone else?
Damon Bradley le 12 Avr 2023
Utiliser le lien direct vers ce commentaire
https://fr.mathworks.com/matlabcentral/answers/422964-how-to-use-scatter-with-transparent-dots#comment_2702394
Depends on the marker you use. If you use a dot '.', you will not see any result. With other markers, you will. I've done this on R2020a though, so please double-check with your rev. Good luck!
Benjamin le 29 Jan 2024
Utiliser le lien direct vers ce commentaire
https://fr.mathworks.com/matlabcentral/answers/422964-how-to-use-scatter-with-transparent-dots#comment_3046346
@Damon Bradley, thank you! Would have been confused for a long time without this post.
Connectez-vous pour commenter.
Plus de réponses (0)
Connectez-vous pour répondre à cette question.
Voir également
Catégories
MATLABGraphicsGraphics Performance
En savoir plus sur Graphics Performance dans Help Center et File Exchange
Tags
- scatter
- facealpha
- transparent
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Une erreur s'est produite
Impossible de terminer l’action en raison de modifications de la page. Rechargez la page pour voir sa mise à jour.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- Deutsch
- English
- Français
- United Kingdom(English)
Asie-Pacifique
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)
Contactez votre bureau local