rotate an object (image) in an layout

In an layout I want to rotate an object (image) by 90°. How should I proceed? Thanks.

(I can move it, stretch it, or send it forward or backward, but I don't how to rotate it.)

(Updated note: This image was copied and pasted directly into Igor Pro in an layout. Therefore, it has no corresponding original Graph in Igor Pro.)

You could rotate the image and append it to the layout.

You can use e.g.

ImageRotate/A=90 ImageWave

to get a rotated copy M_RotatedImage.

In reply to by ChrLie

So there is no way to rotate an image that is already appended to an layout?

(By the way, this image was copied and pasted directly into Igor Pro in an layout when in the Draw Mode, so the image can be touched/modified only in the Draw Mode, not in the Operate Mode.)

As far as I can see it, there is no rotate option, neither for graphs, nor for draw objects. But you can also swap the axes in your original image (Modify Graph => swap XY, then adjust the axes to get the right orientation) and then re-insert the graph as an object into your layout. For 180 deg 'rotation' you only need to reverse the x and y axes. I think this is the most effective way for what you want to do. Maybe someone else has a better idea.

In reply to by chozo

Thank you @chozo. But I have plenty of image objects already in an layout and would like to arrange/rotate them freely inside the layout. I hope Igor Pro can consider adding the rotate option in the future. (Since there is an Rotation option for Text, I guess rotation for a Picture maybe doable?)

Now I realize that you don't have to modify the original image, since the image is fully recreated in the layout. Just select the image you want to 'rotate' (green dashed outline) and then go to Modify Graph and swap the axes or simply execute:

ModifyGraph swapXY=1

This should be a very quick way to 'rotate' images. Just select each image and keep executing above command. Note that, should you have axes displayed, this of course moves the axes around so it is not a proper rotation of the whole thing but should be good enough in most cases.

In reply to by chozo

@chozo Sorry, but how do I "Modify Graph"? I know how to open the "Modify Object" window (see attached; PICT_169 is the image I want to rotate), but I am not sure how to proceed next.

(Actually PICT_169 could no show itself in the Modify Object list until I copied it from the Draw Mode and pasted it in the Operate Mode.)

Just select the object (image) and go to the top menu row of the Igor window. There you select Graph => Modify Graph (or Modify Axes if you want to adjust the axes).

In reply to by chozo

But there is no original graph for the image in the layout, since it was copied and pasted directly into Igor Pro in an layout. So Modify Graph is not available for PICT_169.

OK, you should have said that in the first place that it is not a normal image but a pasted picture object. I have never worked with such an object and have no idea how to modify it besides resizing. Sorry, I am out of ideas here.

Page layouts are complicated. Based on the screenshot you attached earlier, it appears that you have inserted your picture into the layout layer. As far as I know, it's not possible to rotate objects in the layout layer.

However, if you insert the picture into the drawing layer, it is possible to rotate the picture.

First, I suggest that you execute the following commands and carefully read the help topics these commands bring up so you have an idea about what the differences are:

DisplayHelpTopic "Page Layout Pictures"
DisplayHelpTopic "Inserting a Picture in the Layout Layer"
DisplayHelpTopic "Pasting a Picture Into a Drawing Layer"

To demonstrate the difference, I right clicked on chozo's icon in the comment above and selected Copy Image in my browser. This copies the image to the clipboard.

I then started Igor Pro 9.01B01 and executed the Layout command to create a new page layout.

I then selected the layout window and pressed Ctrl+v. This pastes the image into the layout layer. You can resize this image using the drag handles but you cannot rotate it.

Next I clicked the drawing icon in the layout's tool bar. This is the icon with the square, triangle, and circle. That puts the layout into drawing mode. I then pressed Ctrl+v again. This pastes the image into the drawing layer of the layout. Now, if I position the mouse cursor at one of the corners of the image, I can get the mouse cursor to change into a double arrow that indicates rotate mode (for example, at the lower right corner this means arrow heads pointing to the upper-right and lower-left). If I click+drag I can now rotate the image object.

If you previously inserted your picture into the layout layer, you can click the operate mode button in the tool bar (the one above the Draw Mode button) and select the object you want to copy. Then press Ctrl+c to copy, click Draw Mode button, and press Ctrl+v to paste. You will then need to delete the layout object in the layout later.

That's the resize double arrow, not the rotate arrow. Previously I said "...a double arrow that indicates rotate mode (arrow heads pointing to the upper-right and lower-left)". That's the case for the bottom right point of the image, but not the top right point you are using. You want the cursor that is perpendicular to the line between the center of the object and the corner of the object you have selected.

In reply to by aclight

@aclight Great! I never realized that, if I move the cursor just a little away from the bottom right corner, it will change from an upper-left and lower-right double arrow to an upper-right and lower-left one! That's new to me. Thank you.

All four corners of a draw object have rotation handles, but as you have discovered, the hit rectangle for rotation is a bit outside the resize handle. The little square you see at the corner of a selected draw object is the resize handle, and the rotate "handle" is outside of that square. That region has no visible manifestation, unfortunately, except for the change in the cursor.

If that isn't sufficiently confusing, there are also rules applied to decide if a draw object CAN be rotated. Mostly, a draw object can be rotated only if it is in the Absolute coordinate system in both vertical and horizontal directions. Otherwise, the coordinate system is probably not isotropic and rotations introduce distortions.

In reply to by johnweeks

I am still a little confused about the rotation behavior. For a rectangular image, I drag the rotation arrow to rotate it and press Shift at the same time to rotate about the image center by exactly 45°, 90°, ... etc. Sometimes it behaves as I expected. Sometimes it doesn't – the image does *not* rotate about its center but about somewhere else (try the image in Layout4_5 in the following example) , or the image first tilts a little by ~15° immediately when I press Shift, making it difficult to rotate the image by exactly 90° (try the image in Layout0).

Example: https://drive.google.com/file/d/15r12szBu9Tizbj2qxck7kJjDSoF8KfDO/

How should I rotate a rectangular picture properly?

In reply to by isend

isend wrote:

I am still a little confused about the rotation behavior. For a rectangular image, I drag the rotation arrow to rotate it and press Shift at the same time to rotate about the image center by exactly 45°, 90°, ... etc. Sometimes it behaves as I expected. Sometimes it doesn't – the image does *not* rotate about its center but about somewhere else (try the image in Layout4_5 in the following example) , or the image first tilts a little by ~15° immediately when I press Shift, making it difficult to rotate the image by exactly 90° (try the image in Layout0).

Example: https://drive.google.com/file/d/15r12szBu9Tizbj2qxck7kJjDSoF8KfDO/

How should I rotate a rectangular picture properly?

I can't reproduce any problems rotating the image in the layout of your experiment. Everything works as expected, both with and without holding down the shift key.

With that said, when I was playing around with this yesterday, at least once I did get into a situation where I had the shift key pressed but I couldn't get the rotation to be exactly 90°. I couldn't reproduce that behavior, and it is possible that I accidentally rotated the image a few degrees, released the mouse, and then clicked again with the shift key held. In that situation Igor would be rotating an already slightly rotated object, but it would could 90° based on the object's rotation at the beginning of that rotation attempt.

If you are able to reproduce improper rotation behavior, please report it as a bug to support@wavemetrics.com and include a recipe to reproduce the problem and your system information (Help->System Information dialog).

Sometimes it doesn't – the image does *not* rotate about its center but about somewhere else (try the image in Layout4_5 in the following example)

PICT_133 in Layout 4_5 has gotten itself into a weird situation, as seen in the layout window's recreation macro:

Window Layout4_5() : Layout
    PauseUpdate; Silent 1       // building window...
    NewLayout/W=(3,38.75,1196.25,727.25)
    if (IgorVersion() >= 7.00)
        LayoutPageAction size=(1600,600),margins=(18,18,18,18)
    endif
    ModifyLayout mag=1
    SetDrawLayer UserFront
    SetDrawEnv translate= 265,299,rotate= 90,rsabout // <<<<<<< HERE
    DrawPICT 205,239,1,1,PICT_133
EndMacro

 

The translate and rotate was improved in Igor 9, but an experiment saved by Igor 8 (as yours was) with a draw object already translated and rotated won't benefit from the changes.

One workaround is to delete the object and add it again with Igor 9, and then the rotation shouldn't accumulate rsabout commands like that.

Another workaround is to save the recreation macro, delete the lines similar to the one marked <<<< HERE above, then execute the recreation macro, then move the object to the desired location, and rotate it there.