フィルターのクリア

How do I control the min and max values for colorbar within an m-file.

244 ビュー (過去 30 日間)
Joshua
Joshua 2011 年 2 月 3 日
回答済み: Long Hoang Van 2021 年 11 月 12 日
I am currently writing a program that produces a movie of the position and energy level of numerous electrons in a device. I am currently using the colorbar to display the energy level but can't figure out how to set the min and max levels within the m-file. I know you can do this within the plot of each frame, but this obviously won't work for me. I'm using the plot command "scatter3". Any suggestions would be greatly appreciated.
All the best,
Josh

回答 (3 件)

Patrick Kalita
Patrick Kalita 2011 年 2 月 3 日
Try using the caxis command. This command adjusts the CLim property of an axes. You can that property directly if you want more low-level control. But caxis is a quick, convenient way of doing it.
Here's a quick example:
scatter(2:9, 2:9, [], 2:9, 'filled')
colorbar
caxis([1 10])

Joshua
Joshua 2011 年 2 月 3 日
I think this should work for my application. Thank you so much.

Long Hoang Van
Long Hoang Van 2021 年 11 月 12 日
scatter(2:9, 2:9, [], 2:9, 'filled')
colorbar
caxis([1 10])

カテゴリ

Help Center および File ExchangeBlue についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by