aspect-ratio

matplotlib and apect ratio of geographical-data plots

不打扰是莪最后的温柔 提交于 2019-12-01 13:36:14
I process geographical information and present the results using matplotlib. All input is lattitude/longitude [degree]. I convert into x/y [meter] for my calculations. And I present my results in lattitude/longitude. The problem is to get the graphs aspect-ratio right: All graphs are too wide. Is there a standard procedure to set the correct aspect-ratio so I can simply draw my scatter and other diagrams using lat/lon and the result has the correct shape? On screen and on paper (png)? [added this part later] This is a bare-bone stripped version of my problem. I need actual lat/lon values

matplotlib and apect ratio of geographical-data plots

两盒软妹~` 提交于 2019-12-01 12:47:07
问题 I process geographical information and present the results using matplotlib. All input is lattitude/longitude [degree]. I convert into x/y [meter] for my calculations. And I present my results in lattitude/longitude. The problem is to get the graphs aspect-ratio right: All graphs are too wide. Is there a standard procedure to set the correct aspect-ratio so I can simply draw my scatter and other diagrams using lat/lon and the result has the correct shape? On screen and on paper (png)? [added

How to have ffmpeg calculate the width after modifying by set height ratio?

孤街浪徒 提交于 2019-12-01 11:57:41
After finding the resolution was the source of all my webm to MP4 codec conversion errors on my Android. I came across another problem. To break down my question: What all MP4 resolutions are supported on most devices? I know they go by p from certain height value for them to work. 720p /?X720 for example. Is there an easier way to calculate the width based from the height change while keeping the ratio? ffmpeg -i old.webm -t 00:00:03 -s 320x240 new.mp4 I currently use the -s setting perimeter from my testing example. The standard ratio for widescreens is 16:9 and the typical list of

how to use ffmpeg to apply 1:1 SAR before concat on large complex filter

一笑奈何 提交于 2019-12-01 11:23:51
I use ffmpeg to concat videos in a fashion similar to this: I ran into a weird error with my inputs [Parsed_concat_0 @ 000000002a05bb80] Input link in10:v0 parameters (size 1280x720, SAR 2049:2048) do not match the corresponding output link in0:v0 parameters (1280x720, SAR 1:1) From what I've researched I need to use setsar to force all the videos to be 1:1 before I concat, but I'm not sure how to do that in my filter. Add the setsar filter: ffmpeg -i 0.mp4 -i 1.mp4 -i 2.mp4 -filter_complex "[0:v]setsar=1[v0];[v0][1:v][2:v]concat=n=3:v=1:a=0[v]" -map "[v]" out.mp4 This example is assuming that

How to have ffmpeg calculate the width after modifying by set height ratio?

最后都变了- 提交于 2019-12-01 11:07:30
问题 After finding the resolution was the source of all my webm to MP4 codec conversion errors on my Android. I came across another problem. To break down my question: What all MP4 resolutions are supported on most devices? I know they go by p from certain height value for them to work. 720p /?X720 for example. Is there an easier way to calculate the width based from the height change while keeping the ratio? ffmpeg -i old.webm -t 00:00:03 -s 320x240 new.mp4 I currently use the -s setting

how to use ffmpeg to apply 1:1 SAR before concat on large complex filter

孤者浪人 提交于 2019-12-01 08:21:09
问题 I use ffmpeg to concat videos in a fashion similar to this: I ran into a weird error with my inputs [Parsed_concat_0 @ 000000002a05bb80] Input link in10:v0 parameters (size 1280x720, SAR 2049:2048) do not match the corresponding output link in0:v0 parameters (1280x720, SAR 1:1) From what I've researched I need to use setsar to force all the videos to be 1:1 before I concat, but I'm not sure how to do that in my filter. 回答1: Add the setsar filter: ffmpeg -i 0.mp4 -i 1.mp4 -i 2.mp4 -filter

How do I make a matplotlib scatter plot square?

你说的曾经没有我的故事 提交于 2019-12-01 08:04:55
In gnuplot I can do this to get a square plot: set size square What is the equivalent in matplotlib? I have tried this: import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt plt.rcParams['backend'] = 'TkAgg' x = [0, 0.2, 0.4, 0.6, 0.8] y = [0, 0.5, 1, 1.5, 2.0] colors = ['k']*len(x) plt.scatter(x, y, c=colors, alpha=0.5) plt.axes().set_aspect('equal', adjustable='datalim') plt.xlim((0,2)) plt.ylim((0,2)) plt.grid(b=True, which='major', color='k', linestyle='--') plt.savefig('{}.png'.format(rsID), dpi=600) plt.close() plt.clf() I get a square grid, but the plot itself is not

How do I make a matplotlib scatter plot square?

馋奶兔 提交于 2019-12-01 07:33:13
问题 In gnuplot I can do this to get a square plot: set size square What is the equivalent in matplotlib? I have tried this: import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt plt.rcParams['backend'] = 'TkAgg' x = [0, 0.2, 0.4, 0.6, 0.8] y = [0, 0.5, 1, 1.5, 2.0] colors = ['k']*len(x) plt.scatter(x, y, c=colors, alpha=0.5) plt.axes().set_aspect('equal', adjustable='datalim') plt.xlim((0,2)) plt.ylim((0,2)) plt.grid(b=True, which='major', color='k', linestyle='--') plt.savefig(

Define aspect ratio when using twinx

纵饮孤独 提交于 2019-12-01 04:33:52
问题 How do I set the aspect ratio for a plot that uses twinx ? Below, I provide three examples: without twinx to highlight how I set the aspect ratio with only twinx to illustrate how the previously defined aspect ratio is reset my attempt to define the aspect ratio for both y -axis while using twinx (which does not work) I am using matplotlib 1.3.0 The following script illustrates how I set the aspect ratio of a simple plot: import numpy as np import matplotlib.pyplot as plt x = np.linspace(0,1

How do I crop an Axes3D plot with square aspect ratio?

99封情书 提交于 2019-12-01 02:14:34
Here's a barebones example: import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D fig = plt.figure() f = fig.add_subplot(2, 1, 1, projection='3d') t = fig.add_subplot(2, 1, 2, projection='3d') # axes for d in {f, t}: d.plot([-1, 1], [0, 0], [0, 0], color='k', alpha=0.8, lw=2) d.plot([0, 0], [-1, 1], [0, 0], color='k', alpha=0.8, lw=2) d.plot([0, 0], [0, 0], [-1, 1], color='k', alpha=0.8, lw=2) f.dist = t.dist = 5.2 # 10 is default plt.tight_layout() f.set_aspect('equal') t.set_aspect('equal') r = 6 f.set_xlim3d([-r, r]) f.set_ylim3d([-r, r]) f.set_zlim3d([-r, r]) t.set_xlim3d