Skip to content

Clarify MOVIE_WIDTH and warn about MAP_FRAME_TYPE - #3342

Merged
PaulWessel merged 1 commit into
masterfrom
movie-docs-update
May 16, 2020
Merged

PaulWessel merged 1 commit into
masterfrom
movie-docs-update

Conversation

@PaulWessel

Copy link
Copy Markdown
Contributor

Addresses and closes #3341.

@PaulWessel
PaulWessel merged commit fd744e5 into master May 16, 2020
@PaulWessel
PaulWessel deleted the movie-docs-update branch May 16, 2020 20:25
@Esteban82

Copy link
Copy Markdown
Member

I don't know if I a was clear with the issue of MOVIE_WIDTH.

What I meant is that if the parameter MOVIE_WIDTH is used to set the width of the map (as in the example of manpages copied below), then the frame (outside type) of the maps (and hence of the animation) would be left outside of the canvas and would not appear in the final animation.

gmt coast -Rg -JG${MOVIE_FRAME}/20/${MOVIE_WIDTH} -Gmaroon -Sturquoise -Bg -X0 -Y0

That is why in the figure #3341 the circle of the frame discontinous (cut in up/down/left/rigth sides). So to avoid this I have to set an slightly smaller width for the map. For example with the next scripts:

gmt movie globe.bat -Nglobe -T360 -Agif -C6ix6ix100 -Lf
gmt coast -Rg -JG${MOVIE_FRAME}/20/5.9i -Gmaroon -Sturquoise -Bg -X0 -Y0

@PaulWessel

Copy link
Copy Markdown
Contributor Author

Yes, but that is tied into the concept of a plot margin. This could perhaps need some improvement. You are right that MOVIE_WIDTH is not suitable as argument to -J because annotations will be clipped. There is also -X -Y that moves the origin and then using MOVIE_WIDTH really clips your map. However, this is exactly the same thing users go through when maping a plot for an A4 paper, no? If you pick a too large width then clipped. The only way I could offer a MOVIE_WIDTH that would work fine would be to compute it from the canvas width minus the margins on either side. But we have no concept of margin dimensions in movie (we do in subplot for instance). We do have a left/bottom margin via -X -Y, but no similar "margin" for right and top.

I have hesitated to introduce new concept for plotting in movie that are not used in other plotting.

@Esteban82

Copy link
Copy Markdown
Member

I wasn't asking to have a new concept for plotting should be add. It seems like to many work.

But I think that a warning like: "using MOVIE_WIDTH may not be suitable as argument to -J because annotations will be clipped" could be add to the manpage.

And also I think it might be prudent to remove the -Bg from the examples of the manpage of movie to avoid any other user to have this issue.

@PaulWessel

Copy link
Copy Markdown
Contributor Author

Hi Federico, I understood what you meant. I was just thinking out load for a solution. I can certainly add that warning the the man page. We may be addressing the -X -Y situation via the new gmt themes we are working on (#3344), and I am thinking about a margin option...

@PaulWessel

Copy link
Copy Markdown
Contributor Author

I have added language on MOVIE_WIDTH etc to the man page.

@PaulWessel

Copy link
Copy Markdown
Contributor Author

Here are my thoughts on canvas composition. First, the current system, which follows standard GMT layout given the size of your paper: Design your layout on the given page. Instead of an actual A4 or letter paper, you have a slightly smaller paper, say 21.6 x 10.8 cm for a 16:9 movie. As with any paper you want to move the plot origin away from the actual lower left corner. This is done with -X and -Y and these have 72 points as default (~2.5 cm). You then use a reasonable fraction of the remaining area to plot. The movie module does not provide much help here: It inherits the standard GMT (72p, 72p) origin offset, and it produces two script variables available to users: MOVIE_WIDTH and MOVIE_HEIGHT. However, as pointed out by @Esteban82, these dimensions are not really suitable as projection dimensions since the plot will be clipped, severely so if you have annotations. You have to decide on the green plot dimensions manually.The figure below indicates the situation:

canvass

A possible new way of doing things is illustrated below. Here, we would rely on the movie theme which changes the default origin to (0,0) (and probably set slightly smaller annotation fonts etc given the smaller paper). In addition, it would introduce a new -O option to movie, based on similar option in subplot:

-Ooff | xoff/yoff | woff/eoff/soff/noff

You can then specify a constant margin width, one that differs for x and y, or different margins for all four sides. In addition, MOVIE_WIDTH and MOVIE_HEIGHT will be written out as the actual dimensions of the green rectangle, now suitable for plot dimensions:

canvas

The -O option, if not given, sets no margins, i.e., origin remains at (0,0). If -O is given with no arguments we could decide on some sensible defaults, perhaps 7.5%/2.5/5%/5% of the canvas dimensions.

Pro: This scheme would make MOVIE_WIDTH and MOVIE_HEIGHT usable parameters (they are currently not even used by our own animations), and it may be simpler to think about layout in terms of margins. This is how word processors work as well (i.e., set margins). It also hides the use of -X -Y for most simple layouts since the margins sets those implicitly. Unlike plotting in modern mode in general, where there is no paper size at all, a movie actually has a strict paper size, hence a different approach is needed.
Con: This scheme treats movie plot layouts differently than for any other GMT plot. Suddenly, we no longer talk about -X and -Y but of margins! While classic mode people still think of media sizes, the modern crowd do not, hence margins may be a bit odd for them.

In conclusion, I am not sure if this is a good solution, but I think the above at least lays out the issue.

@seisman

seisman commented May 19, 2020

Copy link
Copy Markdown
Member

@PaulWessel Perhaps you should open a new PR and repost it so that we won't forget it.

@PaulWessel

Copy link
Copy Markdown
Contributor Author

OK, now at #3357.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug with -JG North/South Pole and -B0 and issues with MOVIE_WIDTH

3 participants