custom axis at the imshow

110 visualizaciones (últimos 30 días)
José Anchieta de Jesus Filho
José Anchieta de Jesus Filho el 16 de Abr. de 2021
I am trying to add the axes in a capture made in software (as an example, I put this photo). My objective is to add the axes x = -15: 10: 15 and y = 0: 5: 20.
Let's say the figure is 1053 pixels wide and 571 pixels high. I am so grateful if anyone can help me.

Respuestas (1)

Walter Roberson
Walter Roberson el 16 de Abr. de 2021
Your tick marks are not linear in x or in y. On my monitor, the distance between the first -15 and 0 is close to 1 cm more than the distance between 0 and the second -15.
imshow() does not support nonlinear scales, so your implementation would have to be to figure out which linear positions corresponded to your desired ticks, and xtick() at the linear position, but use xticklabel() to lie about the position labels. If you needed datatips to agree with your labels, more work would have to be done to get datatips to lie for you.
This appears to be a magnetic field, so log scale is not appropriate -- magnetic fields are not symmetric on log scales.
  2 comentarios
Walter Roberson
Walter Roberson el 16 de Abr. de 2021
If your scales were linear, I would recommend using image() instead of imshow()
image([-17 19], [1.75 20], YourImageArray)
The numbers I gave are my best estimates of the positions by measuring relative distances between ticks and edges independently for each side.
José Anchieta de Jesus Filho
José Anchieta de Jesus Filho el 20 de Abr. de 2021
Even so, I appreciate your dedication.

Iniciar sesión para comentar.

Categorías

Más información sobre Specifying Target for Graphics Output 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!

Translated by