Meshgrid for logarithmic scales
Mostra commenti meno recenti
I would like to make 3-D plot using mesh in which one axis should be on a logarithmic scale. Is there a way to use meshgrid and mesh to do this?
Thanks.
Risposta accettata
Più risposte (2)
Rishabh Gupta
il 15 Ott 2017
1 voto
If you are using mesh command, just use the following:
Set(gca,'XScale','log');
Walter Roberson
il 21 Dic 2011
0 voti
It is not supported to set the [XYZ]Scale to 'log' if you are using transparency. I do not recall at the moment which of the settings takes priority.
If any of your coordinates on the log scale are 0 or less, then those points will be ignored with [XYZ]Scale is 'log', and nothing will be drawn to those points (in particular, no interpolation of the adjacent points towards the axis limit will be done.)
As far as I recall at the moment, it is allowed to use mesh with an axis set to log scale.
Are you perhaps attempting to use meshgrid to create points that will show up as-if linearly spaced when the axis is set to log scale? If so, then yes, just use exp(ThePoints) or 10.^(ThePoints) as the corresponding meshgrid argument.
Are you perhaps attempting to use meshgrid to create points that will show up as-if spaced logarithmically when the axis is set to linear -- faking a log scale? If so, then yes, just use ln(ThePoints) or log10(ThePoints) as the corresponding meshgrid argument (and watch out for original points <= 0)
1 Commento
David Koenig
il 21 Dic 2011
Categorie
Scopri di più su Graphics Performance in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!