Use sky colormap in old Matlab version

39 vues (au cours des 30 derniers jours)
Ziwen Gu
Ziwen Gu le 18 Oct 2023
Commenté : Ziwen Gu le 18 Oct 2023
Hello everyone, I want to use colormap "sky" released in Matlab , but my Matlab is an older version. Can someone help give me the parameter to generator this colorbar, or website with source code?

Réponse acceptée

Chunru
Chunru le 18 Oct 2023
Copy the following data:
c = sky(256);
for i=1:height(c)
fprintf("%9.6f %9.6f %9.6f\n", c(i, :))
end
0.900000 0.944700 0.974100 0.896471 0.942748 0.973186 0.892941 0.940796 0.972272 0.889412 0.938845 0.971358 0.885882 0.936893 0.970444 0.882353 0.934941 0.969529 0.878824 0.932989 0.968615 0.875294 0.931038 0.967701 0.871765 0.929086 0.966787 0.868235 0.927134 0.965873 0.864706 0.925182 0.964959 0.861176 0.923231 0.964045 0.857647 0.921279 0.963131 0.854118 0.919327 0.962216 0.850588 0.917375 0.961302 0.847059 0.915424 0.960388 0.843529 0.913472 0.959474 0.840000 0.911520 0.958560 0.836471 0.909568 0.957646 0.832941 0.907616 0.956732 0.829412 0.905665 0.955818 0.825882 0.903713 0.954904 0.822353 0.901761 0.953989 0.818824 0.899809 0.953075 0.815294 0.897858 0.952161 0.811765 0.895906 0.951247 0.808235 0.893954 0.950333 0.804706 0.892002 0.949419 0.801176 0.890051 0.948505 0.797647 0.888099 0.947591 0.794118 0.886147 0.946676 0.790588 0.884195 0.945762 0.787059 0.882244 0.944848 0.783529 0.880292 0.943934 0.780000 0.878340 0.943020 0.776471 0.876388 0.942106 0.772941 0.874436 0.941192 0.769412 0.872485 0.940278 0.765882 0.870533 0.939364 0.762353 0.868581 0.938449 0.758824 0.866629 0.937535 0.755294 0.864678 0.936621 0.751765 0.862726 0.935707 0.748235 0.860774 0.934793 0.744706 0.858822 0.933879 0.741176 0.856871 0.932965 0.737647 0.854919 0.932051 0.734118 0.852967 0.931136 0.730588 0.851015 0.930222 0.727059 0.849064 0.929308 0.723529 0.847112 0.928394 0.720000 0.845160 0.927480 0.716471 0.843208 0.926566 0.712941 0.841256 0.925652 0.709412 0.839305 0.924738 0.705882 0.837353 0.923824 0.702353 0.835401 0.922909 0.698824 0.833449 0.921995 0.695294 0.831498 0.921081 0.691765 0.829546 0.920167 0.688235 0.827594 0.919253 0.684706 0.825642 0.918339 0.681176 0.823691 0.917425 0.677647 0.821739 0.916511 0.674118 0.819787 0.915596 0.670588 0.817835 0.914682 0.667059 0.815884 0.913768 0.663529 0.813932 0.912854 0.660000 0.811980 0.911940 0.656471 0.810028 0.911026 0.652941 0.808076 0.910112 0.649412 0.806125 0.909198 0.645882 0.804173 0.908284 0.642353 0.802221 0.907369 0.638824 0.800269 0.906455 0.635294 0.798318 0.905541 0.631765 0.796366 0.904627 0.628235 0.794414 0.903713 0.624706 0.792462 0.902799 0.621176 0.790511 0.901885 0.617647 0.788559 0.900971 0.614118 0.786607 0.900056 0.610588 0.784655 0.899142 0.607059 0.782704 0.898228 0.603529 0.780752 0.897314 0.600000 0.778800 0.896400 0.596471 0.776848 0.895486 0.592941 0.774896 0.894572 0.589412 0.772945 0.893658 0.585882 0.770993 0.892744 0.582353 0.769041 0.891829 0.578824 0.767089 0.890915 0.575294 0.765138 0.890001 0.571765 0.763186 0.889087 0.568235 0.761234 0.888173 0.564706 0.759282 0.887259 0.561176 0.757331 0.886345 0.557647 0.755379 0.885431 0.554118 0.753427 0.884516 0.550588 0.751475 0.883602 0.547059 0.749524 0.882688 0.543529 0.747572 0.881774 0.540000 0.745620 0.880860 0.536471 0.743668 0.879946 0.532941 0.741716 0.879032 0.529412 0.739765 0.878118 0.525882 0.737813 0.877204 0.522353 0.735861 0.876289 0.518824 0.733909 0.875375 0.515294 0.731958 0.874461 0.511765 0.730006 0.873547 0.508235 0.728054 0.872633 0.504706 0.726102 0.871719 0.501176 0.724151 0.870805 0.497647 0.722199 0.869891 0.494118 0.720247 0.868976 0.490588 0.718295 0.868062 0.487059 0.716344 0.867148 0.483529 0.714392 0.866234 0.480000 0.712440 0.865320 0.476471 0.710488 0.864406 0.472941 0.708536 0.863492 0.469412 0.706585 0.862578 0.465882 0.704633 0.861664 0.462353 0.702681 0.860749 0.458824 0.700729 0.859835 0.455294 0.698778 0.858921 0.451765 0.696826 0.858007 0.448235 0.694874 0.857093 0.444706 0.692922 0.856179 0.441176 0.690971 0.855265 0.437647 0.689019 0.854351 0.434118 0.687067 0.853436 0.430588 0.685115 0.852522 0.427059 0.683164 0.851608 0.423529 0.681212 0.850694 0.420000 0.679260 0.849780 0.416471 0.677308 0.848866 0.412941 0.675356 0.847952 0.409412 0.673405 0.847038 0.405882 0.671453 0.846124 0.402353 0.669501 0.845209 0.398824 0.667549 0.844295 0.395294 0.665598 0.843381 0.391765 0.663646 0.842467 0.388235 0.661694 0.841553 0.384706 0.659742 0.840639 0.381176 0.657791 0.839725 0.377647 0.655839 0.838811 0.374118 0.653887 0.837896 0.370588 0.651935 0.836982 0.367059 0.649984 0.836068 0.363529 0.648032 0.835154 0.360000 0.646080 0.834240 0.356471 0.644128 0.833326 0.352941 0.642176 0.832412 0.349412 0.640225 0.831498 0.345882 0.638273 0.830584 0.342353 0.636321 0.829669 0.338824 0.634369 0.828755 0.335294 0.632418 0.827841 0.331765 0.630466 0.826927 0.328235 0.628514 0.826013 0.324706 0.626562 0.825099 0.321176 0.624611 0.824185 0.317647 0.622659 0.823271 0.314118 0.620707 0.822356 0.310588 0.618755 0.821442 0.307059 0.616804 0.820528 0.303529 0.614852 0.819614 0.300000 0.612900 0.818700 0.296471 0.610948 0.817786 0.292941 0.608996 0.816872 0.289412 0.607045 0.815958 0.285882 0.605093 0.815044 0.282353 0.603141 0.814129 0.278824 0.601189 0.813215 0.275294 0.599238 0.812301 0.271765 0.597286 0.811387 0.268235 0.595334 0.810473 0.264706 0.593382 0.809559 0.261176 0.591431 0.808645 0.257647 0.589479 0.807731 0.254118 0.587527 0.806816 0.250588 0.585575 0.805902 0.247059 0.583624 0.804988 0.243529 0.581672 0.804074 0.240000 0.579720 0.803160 0.236471 0.577768 0.802246 0.232941 0.575816 0.801332 0.229412 0.573865 0.800418 0.225882 0.571913 0.799504 0.222353 0.569961 0.798589 0.218824 0.568009 0.797675 0.215294 0.566058 0.796761 0.211765 0.564106 0.795847 0.208235 0.562154 0.794933 0.204706 0.560202 0.794019 0.201176 0.558251 0.793105 0.197647 0.556299 0.792191 0.194118 0.554347 0.791276 0.190588 0.552395 0.790362 0.187059 0.550444 0.789448 0.183529 0.548492 0.788534 0.180000 0.546540 0.787620 0.176471 0.544588 0.786706 0.172941 0.542636 0.785792 0.169412 0.540685 0.784878 0.165882 0.538733 0.783964 0.162353 0.536781 0.783049 0.158824 0.534829 0.782135 0.155294 0.532878 0.781221 0.151765 0.530926 0.780307 0.148235 0.528974 0.779393 0.144706 0.527022 0.778479 0.141176 0.525071 0.777565 0.137647 0.523119 0.776651 0.134118 0.521167 0.775736 0.130588 0.519215 0.774822 0.127059 0.517264 0.773908 0.123529 0.515312 0.772994 0.120000 0.513360 0.772080 0.116471 0.511408 0.771166 0.112941 0.509456 0.770252 0.109412 0.507505 0.769338 0.105882 0.505553 0.768424 0.102353 0.503601 0.767509 0.098824 0.501649 0.766595 0.095294 0.499698 0.765681 0.091765 0.497746 0.764767 0.088235 0.495794 0.763853 0.084706 0.493842 0.762939 0.081176 0.491891 0.762025 0.077647 0.489939 0.761111 0.074118 0.487987 0.760196 0.070588 0.486035 0.759282 0.067059 0.484084 0.758368 0.063529 0.482132 0.757454 0.060000 0.480180 0.756540 0.056471 0.478228 0.755626 0.052941 0.476276 0.754712 0.049412 0.474325 0.753798 0.045882 0.472373 0.752884 0.042353 0.470421 0.751969 0.038824 0.468469 0.751055 0.035294 0.466518 0.750141 0.031765 0.464566 0.749227 0.028235 0.462614 0.748313 0.024706 0.460662 0.747399 0.021176 0.458711 0.746485 0.017647 0.456759 0.745571 0.014118 0.454807 0.744656 0.010588 0.452855 0.743742 0.007059 0.450904 0.742828 0.003529 0.448952 0.741914 0.000000 0.447000 0.741000
  3 commentaires
Walter Roberson
Walter Roberson le 18 Oct 2023
I abstracted the official function and simplified the math slightly to produce my Answer. I suspect that older versions do not have the internal routine used here.
Ziwen Gu
Ziwen Gu le 18 Oct 2023
Thanks , it works well :)

Connectez-vous pour commenter.

Plus de réponses (1)

Walter Roberson
Walter Roberson le 18 Oct 2023
Generation:
C = [0, 447/1000, 741/1000];
now for any fraction F between .1 and 1,
1-(1-baseColor)*F
subdivide the range .1 to 1 by as many steps as you want in the color map.
  1 commentaire
Ziwen Gu
Ziwen Gu le 18 Oct 2023
Grateful for your help! Both of your answers work well

Connectez-vous pour commenter.

Catégories

En savoir plus sur Orange dans Help Center et File Exchange

Tags

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by