0

What I really want to do is what this question is all about: matlab remove only top and right ticks with leaving box on

To paraphrase the original question, I want to have a plot with tick marks on the left and bottom axes but NO ticks on the top and right axes, but with the box outlining the plot still intact.

Since I don't have enough reputation, I wasn't able to simply comment to follow up. Anyway, I execute the same code given in the answer by mc2, and what I get is the figure below. The logic of the method is to use 2 axes that have the same dimensions and overlay them on top of each other. The first axis has the 'box' property turned off, the second one does not. The code is:

a = gca;
set(a,'box','off','color','none')
b = axes('Position',get(a,'Position'),'box','on','xtick',[],'ytick',[]);
axes(a)

Assume that the axis that represents "a" already exists. That's the initial figure. (I added the blacked out part on top of the screen shot.) The second axis that was created is clearly not the same dimensions as the initial one--it's the bigger, nearly-square box that surrounds the smaller, rectangular one. Instead, I want the big, nearly-square box to be same dimensions as the smaller one.

enter image description here

Somehow the get(a,'Position') function is not grabbing the correct dimensions that I want it to. Why is this happening?

I didn't make the original figure myself; a collaborator generated the data and sent me *.fig file.

StormRyder
  • 11
  • 4
  • 1
    You haven't explained what you're actually trying to achieve. What about this do you want to look different? Make a [mcve] using some made-up data. – David May 07 '20 at 06:46
  • 1
    The code you showed does not print potentially sensitive data to screen, in fact it diplsays nothing. So maybe your code for protting data resizes the axes. – Ander Biguri May 07 '20 at 09:00
  • Sorry, I edited the post. Hopefully this makes more sense now? I'm already starting with a figure which I didn't even make myself, that's why there's no data or anything to print. I'm just trying to edit the existing figure. I updated my OP to clarify that the large, outer box is the wrong dimensions. – StormRyder May 07 '20 at 20:39

0 Answers0