{"id":387,"date":"2020-03-29T09:56:37","date_gmt":"2020-03-29T13:56:37","guid":{"rendered":"http:\/\/blog.uvm.edu\/tbplante\/?p=387"},"modified":"2020-03-29T10:00:54","modified_gmt":"2020-03-29T14:00:54","slug":"output-a-stata-graph-that-wont-be-clipped-in-twitter","status":"publish","type":"post","link":"https:\/\/blog.uvm.edu\/tbplante\/2020\/03\/29\/output-a-stata-graph-that-wont-be-clipped-in-twitter\/","title":{"rendered":"Output a Stata graph that won&#8217;t be clipped in Twitter"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Twitter sizing<\/h2>\n\n\n\n<p>Twitter does this weird thing where it clips figures that aren&#8217;t the correct proportion. I came across this <a href=\"https:\/\/www.bluecompass.com\/blog\/tested-results-the-best-twitter-image-size\">blog post<\/a> that argues that 1100&#215;628 px is the &#8216;optimal&#8217; Twitter image size. <\/p>\n\n\n\n<p>So, how do you output Stata figures to be 1100&#215;628?<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Output a Stata figure in Twitter size in 2 steps<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Force the width and height to be 15.3 x 9.0 inches<\/h3>\n\n\n\n<p>Stata allows you to use &#8216;xsize(##)&#8217; and &#8216;ysize(##)&#8217; to force the height and width of a figure. Assuming a 72 dpi resolution (the default resolution for monitors), that means that your width and height should be:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">twoway \/\/\/\n(scatter thing otherthing) \/\/\/\n, \/\/\/\nxsize(15.3) ysize(9.0)<\/pre>\n\n\n\n<p>&#8230;place above behind the comma of your graph<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Set the graph output to be 1100 pixels wide<\/h3>\n\n\n\n<p>In your graph export command, after the comma, place &#8216;width(1100)&#8217;. Or<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">graph export \"figurename.png\", replace width(1100)<\/pre>\n\n\n\n<p>That&#8217;s it!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Twitter sizing Twitter does this weird thing where it clips figures that aren&#8217;t the correct proportion. I came across this blog post that argues that 1100&#215;628 px is the &#8216;optimal&#8217; Twitter image size. So, how do you output Stata figures to be 1100&#215;628? Output a Stata figure in Twitter size in 2 steps Step 1: &hellip; <a href=\"https:\/\/blog.uvm.edu\/tbplante\/2020\/03\/29\/output-a-stata-graph-that-wont-be-clipped-in-twitter\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Output a Stata graph that won&#8217;t be clipped in Twitter<\/span><\/a><\/p>\n","protected":false},"author":4473,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[477491],"tags":[],"class_list":["post-387","post","type-post","status-publish","format-standard","hentry","category-stata-code"],"_links":{"self":[{"href":"https:\/\/blog.uvm.edu\/tbplante\/wp-json\/wp\/v2\/posts\/387","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.uvm.edu\/tbplante\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.uvm.edu\/tbplante\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.uvm.edu\/tbplante\/wp-json\/wp\/v2\/users\/4473"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.uvm.edu\/tbplante\/wp-json\/wp\/v2\/comments?post=387"}],"version-history":[{"count":3,"href":"https:\/\/blog.uvm.edu\/tbplante\/wp-json\/wp\/v2\/posts\/387\/revisions"}],"predecessor-version":[{"id":392,"href":"https:\/\/blog.uvm.edu\/tbplante\/wp-json\/wp\/v2\/posts\/387\/revisions\/392"}],"wp:attachment":[{"href":"https:\/\/blog.uvm.edu\/tbplante\/wp-json\/wp\/v2\/media?parent=387"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.uvm.edu\/tbplante\/wp-json\/wp\/v2\/categories?post=387"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.uvm.edu\/tbplante\/wp-json\/wp\/v2\/tags?post=387"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}