Scale bar without axis

18 ビュー (過去 30 日間)
Ilmnic
Ilmnic 2015 年 4 月 27 日
コメント済み: Lee Key 2020 年 10 月 2 日
I am looking to include a scale bar (like for maps except for a variable of my own choosing) while turning off the axis (Picture worth 100 words: See attached image). Would anyone know how to do this or point me out to the appropriate resource?

採用された回答

Star Strider
Star Strider 2015 年 4 月 27 日
I strongly recommend Add a scale bar to my plot!

その他の回答 (1 件)

Chad Greene
Chad Greene 2015 年 4 月 27 日
Do it manually by plotting a line and adding text:
plot(1:100,cosd(1:100),'b');
hold on
plot([80 80 90],[.9 .8 .8],'k-','linewidth',3);
text(85,.8,'10 x units','horiz','center','vert','top');
text(80,.85,'0.1 y units ','horiz','right','vert','middle');
  2 件のコメント
Muhammad Usman Saleem
Muhammad Usman Saleem 2017 年 12 月 14 日
good answer
Lee Key
Lee Key 2020 年 10 月 2 日
Hi
How to add scale bar to a map (plot) with latitudes and longitudes? I produce the map and would like to add scale bar and overlay onto the map bottom left hand corner.
Below is my code that produces the map. Would kindly appreciate your kind support.
S = gshhs('gshhs_i.b');
levels = [S.Level];
L1 = S(levels == 1);
latlim = [-20 0];
lonlim = [145 180];

サインインしてコメントする。

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by