You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Convenient methods to plot horizontal and vertical lines #670
matplotlib provides two methods, hlines and vlines, for plotting horizontal and vertical lines.
In PyGMT, we can plot any lines using the plot() method. However, for plotting horizontal and vertical lines, we have to prepare the input x and y arrays, which is not elegant.
Is there any way to get basemap to return x/y min/max values to set as the endpoint values when calling hlines/vlines? I would like to give this a try but I can't get past how to plot the line to take up the range of the figure if the None defaults are used for the min/max values.
Hello! Thank you for the continued communication with our team (@cklima616@munzekm@noorbuchi and I) as we decide where to go next in our class. I would just like to inquire about the availability of this issue? It seems very interesting and we would consider working on it if it is available still. Thanks again, we really do appreciate the cooperation.
Hey @nathandloria, I'm currently working on this in #923, so maybe you can find another interesting topic or issue like #549 (Add tutorial for plotting datetime inputs) as suggested by @weiji14 ?
Activity
willschlitzer commentedon Dec 10, 2020
Is there any way to get
basemapto return x/y min/max values to set as the endpoint values when callinghlines/vlines? I would like to give this a try but I can't get past how to plot the line to take up the range of the figure if theNonedefaults are used for the min/max values.seisman commentedon Dec 10, 2020
I think this function is what you need:
pygmt/pygmt/clib/session.py
Line 1374 in 6bad810
willschlitzer commentedon Dec 10, 2020
Thanks! I assume you're talking about extract_region()?
seisman commentedon Dec 10, 2020
Yes.
michaelgrund commentedon Feb 4, 2021
Are you still working on that issue @willschlitzer? If not and if it's ok for you I would like to continue with that 😉
willschlitzer commentedon Feb 4, 2021
@michaelgrund Haven't made any progress lately; by all means have a stab at it!
Add new modules to plot horizontal and vertical lines
weiji14 commentedon Feb 20, 2021
Just two quick questions:
On organizing these higher level convenience functions. Do we want to keep them in the
pygmt/srcfolder or somewhere else?Should the implementation of
hlinesandvlinesbe reusing some part of thefig.plotcode? Or do we implement them from scratch as is being done in Add Figure.hlines for plotting horizontal lines #923?seisman commentedon Feb 20, 2021
I think we should put them in
pygmt/src. To users and developers, they are the same as other modules/functions.Do you mean
Figure.hlines()should callingFigure.plot()? Ideally yes, but I'm not sure ifFigure.hlines()can use the aliases ofFigure.plot().nathandloria commentedon Apr 7, 2021
Hello! Thank you for the continued communication with our team (@cklima616 @munzekm @noorbuchi and I) as we decide where to go next in our class. I would just like to inquire about the availability of this issue? It seems very interesting and we would consider working on it if it is available still. Thanks again, we really do appreciate the cooperation.
michaelgrund commentedon Apr 7, 2021
Hey @nathandloria, I'm currently working on this in #923, so maybe you can find another interesting topic or issue like #549 (Add tutorial for plotting datetime inputs) as suggested by @weiji14 ?
maxrjones commentedon Aug 12, 2021
@michaelgrund, are you planning to add vlines after #923? If so, I'll remove the help-wanted label.
2 remaining items
seisman commentedon Dec 30, 2024
We have added
Figure.hlines(#923) andFigure.vlines(#3726), but we still need one gallery example to tutorial for these two new functions.seisman commentedon Feb 5, 2025
A gallery example was added in #3755. Closing.