-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
version5.4.3 PSXY could not plot vector arrows and pens in the desired colours #149
Comments
👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. We appreciate that you took the time to contribute! |
We may have a bug but can't check your case because you didn't provide the Also notice that your makecpt command says
|
1 similar comment
We may have a bug but can't check your case because you didn't provide the Also notice that your makecpt command says
|
The file has now been attached, and the descriptions updated. Thanks for the comments. Could you try it again to see if you can reproduce the pictures ? |
Thanks for posting the file. Your commands work fine once you fix your makecpt -T range to be a multiple of 0.2. E.g., -T-4.6/-1.4/0.2. As it is the command fails and no CPT is used in psxy. |
Well, I can't really say its working. With the plot size given in the example I see only tiny squares, so I increased things and than found that heads are lost and need to really shrink the head size to colored lines
when I remove the
But heads are still colored although we now are not asking for color.
|
In your enlarged version (by using Also, the length of the vector pens is set to be 0.15c, which is provided in the last column of the attached temp.txt file. So when the size of the vector arrows is set too large compared to 0.15c, you will not see the pens. Sorry for this inconvenience. |
Sorry for delay, but there still things that I don't understand either. And I'm using GMT6dev so there might some other differences due to it. What I get with my updated version 2) is
But I puzzled with this too because:
|
I can solve no. 2 for you: Since the dawn of man, GMT has used the z-column when -C is used. For psxy that means the 3rd column, i.e., x, y, z, .... For psxyz it means the 4th column, i.e., it is the column after the point coordinate. |
Hi Joaquim, for your 'puzzles', this is my understanding when using version 5.4.3 (there might be some difference if using version 6-dev, but that's beyond my test knowledge at the moment...)
I think the default option is to paint (fill) the symbol if a CPT is provided. the -W is more about changing the pens (lines). But according to the doc about PSXY, -W+cf also does the symbol fill job, however, it does not necessarily conflict with the default painting option, I guess.
I just saw Paul's comment as writing this, yes, the variable colour is from CPT file as there is a -C. The 0.15 value as the 5th column in the data file is to control the length of the pen of the vector (as I tested)
The pen of vector is just too small (0.15c) compared to your -Sv0.5c for the vector arrows (heads). |
Correct, if -C is given then the heads are filled. However, you can use the +c modifier to -W to tell it to use the color for the stem instead. And, if you also want both stem and head to be colored that way then you need to use +c or +clf. |
This is actually what I wanted, to put both the stem and head be coloured using CPT file. The problem is when using +c for -W, I got the error (version 5.4.3 PSXY):
And when using +cf or +clf for -W, I only got the stems of the vectors, the heads are missing somehow, although in this case, the stems are coloured properly |
Than that means vectors are always colored by azimuth, which is a redundant info with respect to the heads direction. And if -C always fill the head then there is no need for a -W+cf (BTW, there is no +clf in the docs, only +c to do both).
No, as per the manual 5th column is the header length when ... |
No, you are free to place whatever you want in col 3. If your "z" value is kept in some other column then you are expected to use -i to say so. Giving x y az length with -C will give an error (not enough cols) but in your case there are more cols and everything is shifted over by one, as per the way -C works. If you give x y az length value and -C then you are saying "I want az to be used for color, my azimuth to be length and length to be value. You get what you ask for. |
So the manual clearly needs to provide that information because now it only says (no mention to shuffling the z column around)
|
Well, it is already spelled out in detailed: -Ccpt |
For the Length that is after Direction, I think it's the length of the stem, right ? |
So my question now is, when -S is set, how can we let both the stem and head of the vector be coloured via the z-value in the third column ? |
echo "0 red 10 blue" > t.cpt seems to work find (gives you a purple vector stem and head. |
Thank you for the comment, Paul. I tested your suggestion with GMT version 5.4.3, but still got the error
Any idea of this ? |
I cannot fix bugs in 5.4.3 but they are fixed in 6. |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions. |
Try to make codeclimate less annoying but still useful. Borrow some configuration from MetPy. Fix some of the new issues that have popped up regarding code format.
temp.txt
Description of the problem
In using the psxy from version 5.4.3 to plot a 2-D vector arrow map, the arrow and its pen (or tail) can not be set the desired colour at the same time using a CPT (colour) file. In my case, the arrows can be set the desired colours according to the CPT file, if using the plot command without additional colour specification in the flag -W
gmt psxy temp.txt -R-1.1/1.1/-1.5/1.5 -JX5c/7c -Sv0.15c+ea+p-+h0.4 -W0.85p -Ccolourbar.cpt -Baf -Bx+l"X / km" -By+l"Y / km" -BWSne -i0,1,2,3,4 -Vd -P > ${PS_FILE}
but the pens remain black, which is not what I want. If, however, the -W0.85p is modified as -W0.85p+cl, then the pens can be set the desired colours from the CPT file, but the arrows are missing in this case:
gmt psxy temp.txt -R-1.1/1.1/-1.5/1.5 -JX5c/7c -Sv0.15c+ea+p-+h0.4 -W0.85p+cl -Ccolourbar.cpt -Baf -Bx+l"X / km" -By+l"Y / km" -BWSne -i0,1,2,3,4 -Vd -P > ${PS_FILE}
This is not what I expect, according to the descriptions about -W for the programme psxy in the document http://gmt.soest.hawaii.edu/doc/5.4.4/psxy.html
Now I am not sure if there're some bugs in the psxy, or I misunderstood something. Any help would be useful !
Full script that generated the error
Full error message
System information
The text was updated successfully, but these errors were encountered: