-
Notifications
You must be signed in to change notification settings - Fork 224
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
Drawing rectangles #392
Comments
Hi Nasuyo, Sorry for the really late reply, only got back into the flow quite recently 😳. I've had a look at the code and you're right, it only works with squares because you can pass a size argument directly into the One solution I can think of at the moment would be to put your x, y, length, width numbers into a textfile, and call something like Lines 321 to 436 in 320a728
Alternatively, if you know the West/South/East/North coordinates of your area of interest, you can supply them directly and use import numpy as np
import pygmt
fig = pygmt.Figure()
fig.coast(region=[0, 26, 44, 62], projection='S13/90/6i', frame="ag", shorelines="0.3p,black", borders="1/0.5p,black")
fig.plot(data=np.array([[5,47,15,52]]), style='r+s', pen="3p,yellow")
fig.show() |
FYI, GMT recently allows specifying rectangle's width and height from command line in GenericMappingTools/gmt#4164. It will be available in GMT 6.2.0. Before that, the rectangle width and height must be given from the input data. |
I just tested this with the development version of gmt (6.2.0_d8a7766_2021.02.11). This now produces a rectangle:
And the rounded rectangle style produced an error because the corner radius is required. This works for a rounded rectangle:
Does the issue stay open until GMT 6.2 is released or does it get closed as soon as the problem is fixed in the main gmt branch? |
We will keep the issue open until we bump the minimum required GMT version to 6.2.0 in PyGMT v0.4.0. |
Would it be possible to use a label for these types of issues (i.e., upstream problems that are solved but require an update to the minimum required GMT version)? In reading through PyGMT issues, it appears there are at least a couple of this type of issue currently open. I think a tag would help for keeping track and quickly identifying which issues do not require any action. |
Yeah there are quite a few of these. I think labeling it 'upstream' and adding it to the v0.4.0 milestone should suffice, but feel free to suggest a new label. |
Perhaps add a new gallery example to mention the |
Could I help with this example? |
Yes please, go for it! I'll assign this issue to you @core-man. |
Please note that we already have an example for rectangles (https://www.pygmt.org/latest/gallery/symbols/multi_parameter_symbols.html), but in this example we read the "sizes" from the input file, rather than in the I feel we can simply update that example, rather than adding a new gallery example. |
Hello,
I am currently out of office. I will be back on Monday, 07.06.
Stefan
|
Hello,
When trying to plot (fig.plot()) rectangles, basically nothing happens..^^
Following code -- with squres -- works:
This should do the exact same thing, shouldn't it?:
Problem: No rectangle is drawn. Alterations fomo the style command like 'r1', 'r1,1', 'r1c', 'r1c/1c' etc. neither work.
Problem 2: Substituting r by R for a rounded rectangle produces an error:
I'm not sure whether this is actually a bug or just my own lack of knowledge.
Thanks in advance,
Stefan
The text was updated successfully, but these errors were encountered: