1D line plot with data on the x axis
See original GitHub issueConsider the following Dataset, representing a function f = cos(z)
z = np.arange(10)
ds = xray.Dataset( {'f': ('z', np.cos(z))}, coords={'z': z})
If I call
ds.f.plot()
xray naturally puts “z” on the x-axis.
However, since z represents the vertical dimension, it would be more natural do put it on the y-axis, i.e.
plt.plot(ds.f, ds.z)
This is conventional in atmospheric science and oceanography for buoy data or balloon data.
Is there an easy way to do this with xray’s plotting functions? I scanned the code and didn’t see an obvious solution, but maybe I missed it.
Issue Analytics
- State:
- Created 8 years ago
- Comments:13 (9 by maintainers)
Top Results From Across the Web
6.4. line plots (1D)
This demo shows how the x-axis of a 1d plot can be a date time. import ... Real data types: One or multiple...
Read more >Plotting with Matplotlib · python-data
A 1d line plot of the first column of the growth data (~t) vs the signal ... Set the current axes x-tick locations...
Read more >Plot 1D-data on 2D with discrete X-Axis values as labels in ...
I want to plot each column values vertically. For 15 rows including header = 14 values on one horizontal x value (which is...
Read more >1D Plot Overview
This page provides an overview of the different 1D plot features. ... Note that all frequency or time dependent plots share a corresponding...
Read more >1D Plot Group and Polar Plot Group
You can also use 1D plot groups to create cross-section plots for solutions in 2D and 3D models. Normally the plot axes (x-axis...
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 FreeTop 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
Top GitHub Comments
I don’t think we have an easy way to do this now.
Seaborn uses the keyword argument
orient='h'
ororient='v'
to control orientation for categorical plots likeviolinplot
. That might be a reasonable API to emulate here.@kuchaale Thanks!