Effacer les filtres
Effacer les filtres

Unwanted marker in logarithmic boxchart

2 vues (au cours des 30 derniers jours)
Behnam
Behnam le 21 Sep 2021
Modifié(e) : Kevin Holly le 23 Sep 2021
Hello
When I use logarithmic scale for the y-axis of my box plot, a marker appears at the right-bottom corner of the axes. Here's a mininmal code to reproduce the behavior:
x = categorical(1:5);
y = rand(1, 5);
figure;
boxchart(x, y)
set(gca, 'YScale', 'log')
The result is the following:
My question is how to get rid of the unwanted marker.

Réponses (1)

Kevin Holly
Kevin Holly le 21 Sep 2021
Behnam,
The Dev team is currently working on this issue. A workaround for now is to use boxplot instead.
x = 1:5;
y = rand(1, 5);
figure;
boxplot(x, y)
xticklabels({'1','2','3','4','5'})
set(gca, 'YScale', 'log')
  2 commentaires
Behnam
Behnam le 21 Sep 2021
Modifié(e) : Behnam le 21 Sep 2021
Thank you for the answer. I use boxchart because it can conveniently handle data categories. One option for my publishing purpose is to use a vector graphics editior (e.g., Inkscape) to remove the marker. If there is a workaround within MATLAB to remove this marker, that would be much better.
Kevin Holly
Kevin Holly le 23 Sep 2021
Modifié(e) : Kevin Holly le 23 Sep 2021
Behnam,
Here is a workaround:
x = categorical(1:5);
y = rand(1, 5);
figure;
boxchart(x, y)
set(gca, 'YScale', 'log')
handle = gca;
handle.Children.MarkerStyle = 'none';
Or Alternatively,
boxchart(x, y,'MarkerStyle','none')
set(gca, 'YScale', 'log')

Connectez-vous pour commenter.

Catégories

En savoir plus sur Log Plots dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by