Closed tomchor closed 1 year ago
I guess we could have a dimension order keyword?
How it currectly works is Ti, X, Y and Z dims are organised as you usually expect of dependent/independent dimensions (which varies by plot type). Use these dims and things just work.
If you use custom named dimensions there is no way to know the order.
Maybe we could specify something like plot(A; dependent=:somedim)
or plot(A; independent=:someotherdim)
?
The reason I haven't added this so far is you can just use permutedims
to change the plotted dimensions as you have to with a regular array.
Ah, I see. For me, as a user, it would be helpful to have a way of controlling that, but I also don't know how much work that'd be. If you were to implement this, in terms of API I'd suggest something like
plot(A; xdim=:somedim)
since I since "dependent" versus "independent" may be a bit less general.
or, in order to keep the current interface for Plots.heatmap:
plot(x=:xF, y=:zF, A) # Or I guess it'd have to be something like the following, no?
plot(x=Dim{:xF}, y=Dim{:zF}, A)
It's trivial to implement. It's just one more bit of interface to document and test.
It's trivial to implement. It's just one more bit of interface to document and test.
As a user I think it's a useful feature. Unfortunately at this point I don't have the skills to implement it by myself and create a PR, but lmk if I can help you out at least with the documentation part.
So, I tried to figure out how to implement it, but came up short.
I keep coming back to this feature because most of the time when I'm plotting, I'm doing it once in a script and I don't know a priori the order of the dimensions from the file I'm reading. So using permutedims()
would incur some trial-and-error that generally isn't easy for me to do.
Since you said it's trivial to implement, can you implement or at least point me how to do it? I can then document it if you want.
Thanks in advance
The usual way in plots
is with permutedims
or PermutedDimsArray
?
permutedims(A, (:xC,:yC)))
or whatever you have to the order you want? You can use the dims names or just numbers in a vector.
Did you try that. I don't get how it's any different thats what the plot recipe will do anyway.
(There shouldn't be trial any error using dim names?)
The usual way in
plots
is withpermutedims
orPermutedDimsArray
?
permutedims(A, (:xC,:yC)))
or whatever you have to the order you want? You can use the dims names or just numbers in a vector.Did you try that. I don't get how it's any different thats what the plot recipe will do anyway.
(There shouldn't be trial any error using dim names?)
@rafaqz thanks for the reply. I had tried permutedims(A, (:xC,:yC)))
and had gotten an error so I assumed it was only implemented with dims
as numbers. It turns out I was using an older version of DimensionalData
(sorry!). It seems like this indeed works at the moment with the latest version.
Thanks!
I've been exploring this great package and finding out about its features, but one simple thing I could not figure out how to do is to specify which dimensions go in which axes when plotting. For example when I plot this data:
I get this plot
It isn't a huge deal but I'd like the dimension
zF
to be in the vertical axis, andxC
to be in the horizontal. How can I achieve this?