Help on recipe for Parallel Coordinate Plots [WIP] #4223
Replies: 4 comments
-
Hi, thank you for the PR! I think plot recipes are not the right tool for this job, because a parallel plot consists of multiple axes in a particular arrangement, while plot recipes are meant to build the visual primitives you place inside an Axis or Scene. You cannot currently change axis properties in recipes because a plot primitive in its basic form doesn't have an axis to control, it usually happens to be plotted inside an axis with certain settings like ticks and labels, but that's a different thing. I've grabbed some parallel plot example off of Google, to me that looks like a composite plot with multiple axes side by side. For example, if the same thing were built as a plot recipe, the left side tick labels would have to remain inside the axis area unlike an Axis's labels which are outside of it because they belong to a different part of the figure. Maybe one doesn't need a bunch of full Axis objects but instead can use the |
Beta Was this translation helpful? Give feedback.
-
Thanks - I think I misunderstood the purpose of recipes then. If I understand correctly, all I really need to do is write up two functions (e.g., I can't seem to find LineAxis documented I'll set up a proper PR once I get it working smoothly.
In my mind, it's not so different. Unless I've misunderstood your position. # Dummy data (could be a dataframe or named array/tuple instead?)
y = rand(2, 10) # 2 experiments (the lines), 10 dimensions (cylinders, displacement, etc in your example)
dim_names = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J"]
pcp(data, dim_names; some_additional_options)
pcp!(ax, data, dim_names; some_additional_options) The additional options here would control the usual attributes plus whether to display just the min/max for each axis marking. |
Beta Was this translation helpful? Give feedback.
-
I think I am close. Mocked it up by layering multiple Axis objects that hold the y-axis for each dimension over a main figure that displays the series. As you can see, the main stumbling block is aligning the series data with x-axis of the main plot. A bit tricky cos of the padding and margins etc etc, so not the best way of doing this I know. Here is an alternate figure with the decorations for the main Axis displayed so you can see the misalignment clearer. |
Beta Was this translation helpful? Give feedback.
-
some students of mine implemented a version using LinkedAxes - maybe this is helpful to combine? I'm not convinced our solution is a particularly good one, but the LinekdAxes work. https://github.com/unfoldtoolbox/UnfoldMakie.jl/blob/refactorV0.3/src/plot_parallelcoordinates.jl |
Beta Was this translation helpful? Give feedback.
-
Hello!
I'm trying to create a plot recipe for a parallel coordinate plot for my own use and to address #1954
I'm running into a possible limitation where
it doesn't seem possible to modify a given plot within a recipe (e.g., remove axis decorations)
To address the first, I've added a wrapper function (
parallel_coordinates()
) to make the changes I want.I haven't gotten my head around the relationship between the defined
Attributes()
orTheme()
in the recipe definition. How do I make use of them? Can I add custom attributes for a specific plot recipe (as withshow_min
/max
below?)For example, you'll see I've included
colors
in the plot recipe, but I expect this should be an "inherited" attribute that I can reuse somehowPlease note this is an early attempt. I expect to rework things to support Observables properly in the future.
Current WIP figure:
Beta Was this translation helpful? Give feedback.
All reactions