Help plotting two y labels
11 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I would like to make two y labels that have no data associated with it. I have a line at y=0, and would like to label 0 to inf upwelling while 0 to -inf downwelling on a plot. This is what I have so far...but doesn't help.
dateformat = datestr(dn,'dd-mmm-yyyy');
figure(1)
clf
plot(along, '*')
hline = refline([0 0]);
hline.Color = 'r';
% hold on
% box off
% % Create second Y axes on the right.
% a2 = axes('YAxisLocation', 'Right')
% % Hide second plot.
% set(a2, 'color', 'none')
% set(a2, 'XTick', [])
% % Set scala for second Y.
% set(a2, 'YLim', [-6 2])
xlabel(['Weeks since ' num2str(dateformat(1,:))]);
ylabel('Along shore wind (m/s)')
title(['Along shore wind at ' num2str(closestLat) ' lat, ' num2str(closestLon) ' lon']);
Thanks in advance.
0 comentarios
Respuesta aceptada
dpb
el 2 de Jul. de 2015
How about instead of using another axes and futzing with legend
hTx1=text(18,-0.2,'Downwelling','horizontalalign','right','rotation',90,'verticalalign','Top');
hTx2=text(18,0.2,'Upwelling','horizontalalign','left','rotation',90,'verticalalign','Top')
Salt to suit other details, positioning, fonts/sizes, etc., etc., etc., ...
doc text % for details on textproperties
Más respuestas (0)
Ver también
Categorías
Más información sobre Axis Labels en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!