[Thread Prev][Thread Next][Index]
Re: [ferret_users] plot only one color bar for all viewports
- To: ferret_users@xxxxxxxx
- Subject: Re: [ferret_users] plot only one color bar for all viewports
- From: Ansley Manke <a.c.manke@xxxxxxxxx>
- Date: Tue, 16 Feb 2021 17:17:39 -0800
- Arc-authentication-results: i=4; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=g7P61cEM; arc=pass (i=2 dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of a.c.manke@xxxxxxxxx designates 209.85.160.198 as permitted sender) smtp.mailfrom=a.c.manke@xxxxxxxxx
- Arc-authentication-results: i=3; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=g7P61cEM; arc=pass (i=2 dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of a.c.manke@xxxxxxxxx designates 209.85.160.198 as permitted sender) smtp.mailfrom=a.c.manke@xxxxxxxxx
- Arc-authentication-results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=g7P61cEM; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=softfail (google.com: domain of transitioning a.c.manke@xxxxxxxxx does not designate 65.153.203.172 as permitted sender) smtp.mailfrom=a.c.manke@xxxxxxxxx
- Arc-authentication-results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=g7P61cEM; spf=pass (google.com: domain of a.c.manke@xxxxxxxxx designates 209.85.220.41 as permitted sender) smtp.mailfrom=a.c.manke@xxxxxxxxx; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
- Arc-message-signature: i=4; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-archive:list-help:list-post:list-id:mailing-list:precedence :message-id:content-language:in-reply-to:mime-version:user-agent :date:from:references:to:subject:sender:dkim-signature; bh=9rwBgCiU0BYMDzo+7BNHrpoD8Z1XD3fuJ27hQlrGm3g=; b=fk30UzeusTDXxgJnbMBHYSgeQHOzhHWBiUzvBFHj5hFw6VsfdbPkoapSXcrC/jrnVh 1hPF2QmvHfA9tGwyNrAvXSUiIzczsGM/A3PkyifuyXdvjj2hCk7+9oAGzcVlMphT121F PbGVVLOX2k0qmgsM+eZO+V7ZXr5SgGySDOZ4YKXgm6u+A1aefCbPZk2aUdLc7wbcLnHm DyNttOduKl8OY8barj/KIABym0aYv7+GuBwSmVkg7UQ9zVeSDwCxfzLBSl1QnhN8Xyhv /CkCSN4pd7srIf1AxNefpbOF0LKI2/ex4OBXsBK+VtcH4PjM5hgQZ9VUg9RoYAf8HgfM 4LoA==
- Arc-message-signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:content-language:in-reply-to:mime-version:user-agent :date:from:references:to:subject:dkim-signature; bh=9rwBgCiU0BYMDzo+7BNHrpoD8Z1XD3fuJ27hQlrGm3g=; b=nKDdYBkS6hBHyg2pCzq75n82TAfOOgCn1CcPObuSrfaPRXm7R0+L+SbbfcxCoMbcIG KSncWs4WnDDcnFBVY4TjO0S+N9iAk5+pGWdCGrNfJuzKs/RwfQCrMKsQbH64ajIgPbBf wGBlkbVwJ3g6iiCP4PHTFM1BHtgX4gJ4EH/g7Pkl/Pj7KG43DwWDjvohzGyKLWi1zwok ao1jtnJkJIF0ZART/ez3Z/b3Bl0e/hdHu7y7PH/RaDr7TL7agz/hCkjtF2Yrddr1shy7 4NXYg6Fz8CvATAJmYy64Vz10P7x+cDFE4ugmwAlvIOePNR1NU83W5ikuEoQQtjmvWJ3l i97Q==
- Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=9rwBgCiU0BYMDzo+7BNHrpoD8Z1XD3fuJ27hQlrGm3g=; b=Xz5dlHIwfTkAqgwkFim5a/SlOwNIiBLiPVQKFK/l2L6+pHEIcwQ2E/FTuZksYFptgW Gaz0hkqUm+E/rB40trT97aJT2dJmM8PsljU61svFcv/Ivszj7yQA1y1IXB06ZD5gM1Mg ZMtv1Q5QbJ/DsmUc9ocksOb6vu+yrK6AdkFhWAm/HnUXK60WFBZKOCE1868iANjyk0yX 0nS2J9u/1gNO4n9IAxiSSkc4SNPS+D2nFsJTinOs/XBmAucwdo10pBj81d1kdKIlhhSG X2sdqr4mCttd3vDKpWBLOb/sz0o/+UdlIWLnHCSAJoDG54SXiD0xAGBLb9tvwR6KDlVZ nY2g==
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=9rwBgCiU0BYMDzo+7BNHrpoD8Z1XD3fuJ27hQlrGm3g=; b=F0NrP+n5fpNYT+bMmQq9AvcoXGdnjxaVBK77+zPBCQDn2/CQlsrAjmE85tM1CKEFDP 88diU4fM6URhK3oRt4vq1Q1fqtxMqZXJg5lhQJQ1D8sAH8xai08QDFzgXhYKklRgwwPu FU0QikRJga1HSGedtAO5TWEsWzn0RqJLnYi4iXL6Jt1GHbSAFDwsuDOSs23b53wavgEU BpX7/gCuCaM/tDCbLhG2KjmCFDl+siInjeU3s25MXx279PjEr0e8vUH/QXN0KgO/I7RK b5my2D1fyQ8pOQ4NYI14QMW98ExO+JZCQInsueKOOaQDvUXiKZViPSv2JmzLG4/7F8QS BIkg==
- Arc-seal: i=4; a=rsa-sha256; t=1613524682; cv=pass; d=google.com; s=arc-20160816; b=ddWb2wnevPxgEm3maFVZ+jgQ++av4as3C964cFm6oZWVwkYJSylWAUGI45PtFqsyJk uXYY9e9I/on9CHsR82fC6uEWfx1wXqhCsGDIvKNP+lzOpiA/qC9W6Oh4lrLo93Ya9FAY rQ0H0yfAOpYri6TuRqNNQYSlsB3RNxyr1/mGGOe/EYd5sVPv10Hbh46fBxznHDcOwZ7L HC7AZokXl0UEvHOrIZcEg0wATrCgDGd/ru2TcRvfaCKDoYWD9s59nwcYwfvH7S8TfpOt vb6yQ+syEjUzOlkm4I1YoqKWErRAkElfYGY6IuzNvT3vlufeGCuHueU6gnW/QRuSW18C 9qGQ==
- Arc-seal: i=3; a=rsa-sha256; t=1613524681; cv=pass; d=google.com; s=arc-20160816; b=jgHWuzP5Wrxy//oUnF/n427jumu/daHvuX/SvFRWXRvvBQ3FfYeUq0PU+NoljQFIBH VuqwEQAXzyUjbMaBLZjv4mAAxnWtCmNHQ9HUW5ohsgmZyVPgqPRkOhHzy9/TJ4aCL883 8U0o6rZ0G0S0bF3WIde4dmrLketl1GqcLu4cq9OsmWorOyX9Maj5GUWjvB9HL+1BIJPw S6A+M+5s9xmj3ElkIBc+qsxuXUbKQGeMWio9L+pe0Vs9nW0cNkwxpb35OkwOnCtB95FO QdkPfSox2FbepYmHsHZ5XaHJGgFLMCOLhpH9LXb28d1L6G2yYJZZ6GXCW//E4R5ehS83 DgAw==
- Arc-seal: i=2; a=rsa-sha256; t=1613524678; cv=pass; d=google.com; s=arc-20160816; b=wUSDjOtT0pQqGVSRYp8OU/NCFF0WNB1+Lc5871+KYvdLju/WME54e7PNzIxXLq5/m5 RvLDw0uH3pWL+0IB2gwBCv0yfzxpiRPSTmG+dD1hWbWJA4c/3fC3LJqvtWSAGQwDW64l HRNAmPFoy1fZfpwdkxDaHlPPfBPNxPika33lqEGrQI7LVaNS5kKKO4E1AZsO/yl/GMCe XwEOg6CrRXn+bZJBrRflbPIJdzUjVjMeHKUOoD3MupbLHwdejw0LYjp3aBhsBu3KNJxW 0V1HrXyihWz6D+37B/q34wjoPnkceJ0Ge5Oplwzhw4BgvDdDT/A4xaVRW+xIBY+lSEZT 3sHg==
- Arc-seal: i=1; a=rsa-sha256; t=1613524676; cv=none; d=google.com; s=arc-20160816; b=p2e3+vtXWhUE3J8YUz00TLigPHrcyWVAnXe1sRtqc0gf2FV4GUFqVjwv7u4eGITfe7 1ysjw9OnjN7Viv7OFf7NudeW8KeExWWLYCBLo/warTyKhySE2FrqhvQEQmT/uVBgIKWh RRGQtxFFbtQQ53twwo8Srq00aWi4B/GgAhBeW4jLNdTB64spzXDq9/DWieRXVpJgt4xf VqdOsIpqeQhnzYKaihyGi1DhSm1vk1sbVxyOl15tbV+9tgjHKXD7I3DKwYleeekk9CV3 rM9WHUMhVe4A2FL+P3pWg2WC70YhKYf5ILehq3bv+J0j+Y/20715fVyKvV4mJzPUy6yT duCA==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=noaa.gov; s=google; h=sender:subject:to:references:from:date:user-agent:mime-version :in-reply-to:content-language:message-id:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive; bh=9rwBgCiU0BYMDzo+7BNHrpoD8Z1XD3fuJ27hQlrGm3g=; b=La21GKX4Y8UmxiLxGZfKbifhJ+AGumBs+PpDQMULTEoUsnAYJsMPF5lfB7WkeLhptu PmvblKKoIm4cexmMOZNwB7DibIYFyTtA/rNMj2r+z8KBvY/iZAyUF8eXkZGVh4rNH0Vf bQb3Gp8cq1Kdks4n1IERtT0cNOI8K9BvkD241Z7g0ITeYo/Qx0nQ+4EruA1qZPAWmtyk vEKhKWLQCJFdynkvuk1Z0LUrZsEEjw9C5ywleldMQZpmuWcEly8XdmFC3LYfgoixi9c2 CembaJcVOYK09kRu/jdzDcww3RITnofwy+4Kp7CCglx9QYTxTTea+GH9HyNBpB7lCt1v J7FQ==
- In-reply-to: <CAKE4FWqiCnxnCKYdLFfgT-udgMmF+eoE8f4MpoLC3tYe32Me6g@mail.gmail.com>
- List-archive: <https://groups.google.com/a/noaa.gov/group/ferret_users/>
- List-help: <https://support.google.com/a/noaa.gov/bin/topic.py?topic=25838>, <mailto:ferret_users+help@noaa.gov>
- List-id: <ferret_users.noaa.gov>
- List-post: <https://groups.google.com/a/noaa.gov/group/ferret_users/post>, <mailto:ferret_users@noaa.gov>
- Mailing-list: list ferret_users@xxxxxxxx; contact ferret_users+owners@xxxxxxxx
- References: <CAKE4FWqiCnxnCKYdLFfgT-udgMmF+eoE8f4MpoLC3tYe32Me6g@mail.gmail.com>
- Sender: owner-ferret_users@xxxxxxxx
- User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1
Hi,
Here is a message about this showing an example to define a set
of viewports and draw a colorbar along the right hand side of the
page.
https://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2000/msg00226.html
I searched the archive using "colorbar viewports" in the search
box. There may be other useful examples in the archive.
The idea can be generalized to other sets of viewports. The trick
here is that the colorbar for a plot can be located anywhere on
the page, even extending outside of the boundaries of the viewport
being drawn.
I find that for PyFerret the size and location of the colorbar is
different from that in Ferret - the message above goes back to a
time when PyFerret didn't exist. So, the script would need to
define the x-limits of the colorbar differently, perhaps,
! ppl shakey 1 1 .12 1 3 9 `($ppl$xlen)+0.8+.5`
`($ppl$xlen)+0.8+.5+.5` 1.4 14.471
It's important to use the same set of color levels for all of the
viewports, so that the colors in the common colorbar applies to
all of panels. Also, by the way, what you have done with the plot
axis labels to remove the longitude and latitude labeling in the
interior of the plot, makes a nice clean plot
Here's an example, applying the suggested set of viewports to
data in one of the sample datasets (where I have not removed the
excess longitude/latitude labeling)
! Description: sets viewports for 2 columns
and 3 rows
! allow room for a big colorbar on the right
! this works well with the following shakey in the botr panel,
! and set win/asp=1.2 (else adjust the 2.25 in the final value)
! ppl shakey 1 1 .12 1 3 9 `($ppl$xlen)+0.8+.5`
`($ppl$xlen)+0.8+.5+.5` 1.4 14.471
set win/asp=1.2
cancel mode logo
define view/xlimits=0,.51/ylimits=0,.42
botl
define view/xlimits=0,.51/ylimits=.29,.71 midl
define view/xlimits=0,.51/ylimits=.58,1.0 topl
define view/xlimits=.45,.96/ylimits=0,.42 botr
define view/xlimits=.45,.96/ylimits=.29,.71 midr
define view/xlimits=.45,.96/ylimits=.58,1.0 topr
! Plot January winds for several years
use monthly_navy_winds
set view topl;
fill/L=1/nolab/nokey/lev=(-inf)(-12,12,1)(inf)/pal=centered_diff
uwnd; go fland
set view topr;
fill/L=12/nolab/nokey/lev=(-inf)(-12,12,1)(inf)/pal=centered_diff
uwnd; go fland
...
set view botr;
fill/L=72/nolab/nokey/lev=(-inf)(-12,12,1)(inf)/pal=centered_diff/set
uwnd
ppl shakey 1 1 .12 1 3 9 `($ppl$xlen)+0.9+.5`
`($ppl$xlen)+0.9+.5+.5` 1.4 14.471
ppl fill
go fland
If you want to draw a colorbar in a viewport, with only the
colorbar but no other elements of the plot showing up, you can
define a variable with no range in the region, and then use
qualifiers such as /nolabel/noaxes work to draw a plot that is
blank other than the colorbar. For instance, plot a variable with
values far out of the range of colors. A shakey setting could be
used here. I have used key=horizontal to draw the colorbar across
the top of the viewport.
yes? set view full
yes? let no_data = 0*missing(uwnd,0) + 1000 ! this variable is
1000 everywhere
yes?
fill/L=1/lev=(-20,20,2)/key=horizontal no_data
On 2/16/2021 12:59 AM, Xiaoyu Bai
wrote:
Dear ferreters,
I have 10 viewports of precipitation difference that all
have similar but not the same levels (say levels=(-90,90,10)
and levels=(-80,80,10)). It will be too noisy if I have 10
colorbars and I want the shading color to be the same for the
same value (say red for -90 and blue for 90 no matter what
my levels are). So I tried to plot only one shakey by setting
view full after plotting all the subplots. Then I used ppl
shakey and figured that Pyferret cannot find any shakeys
because it already quit all the viewports. I am wondering if
there is a way to create a shakey that works for all viewports
(picking one viewport's shakey does not work for me because my
levels are not all the same so the shakey will not be
accurate, as attached).
Thank you in advance and stay healthy,
[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce /
NOAA /
OAR /
PMEL /
Ferret
Privacy Policy | Disclaimer | Accessibility Statement