Figure.plot fails to plot lines correctly
See original GitHub issueDescription of the problem
Figure.plot() doesn’t plot simple lines correctly.
Full code that generated the error
import pygmt
fig = pygmt.Figure()
fig.basemap(J="X8c/8c", R="-10/10/0/10", B=True)
fig.plot(x=[0.0, 0.0], y=[0, 10], W="1p,gray,-")
fig.plot(x=[5.0, 5.0], y=[2, 8], W="1p,gray,-")
fig.plot(x=[3.0, 8.0], y=[0, 10], W="1p,gray,-")
fig.show(method="external")
Output plot
Only the first line is correct. The other two lines are wrong.
System information
- Operating system: macOS
- Python installation (Anaconda, system, ETS): Anaconda
- Version of GMT: 6.0.0_15a9160
- Version of Python: 3.7.0
- Version of this package: latest
- If using conda, paste the output of
conda list
below
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Drawing objects do not plot and are missing from print preview ...
Issue: When plotting from AutoCAD, one or more drawing elements or lines do not show up in the output (PDF, hard copy) and...
Read more >Lines/Tracks Not Plotting with Matplotlib - Stack Overflow
I am getting the markers to correctly plot with color but, the lines are not there. python · csv · matplotlib · matplotlib-basemap...
Read more >Why won't my plot graph a line? - MATLAB Answers
But the real reason why your plot fails is every call that you make to plot, you are just plotting a SINGLE point....
Read more >Resolved: Matplotlib figures not showing up or displaying
In this blog post I detailed how to resolve a pesky issue where matplotlib figures are not displayed to your screen. Symptoms of...
Read more >A Complete Guide to Line Charts | Tutorial by Chartio
A line chart (aka line plot, line graph) uses points connected by line segments ... values if the line does not include distinct...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The issue is caused by a GMT bug. See https://github.com/GenericMappingTools/gmt/issues/3330 for the detailed bug report. The bug was already fixed in PR https://github.com/GenericMappingTools/gmt/pull/3331 and the script above should work with the upcoming GMT 6.1.0 release.
I added an upstream label to this issue and keep the issue opening, as I don’t think we can/should do any hacking on the PyGMT side.
Since plot() is one of the most commonly used functions, I propose that, when GMT 6.1.0 is released, we should:
Using
data
instead ofx
andy
also works.