Applying Affine Transforms to Axes #586
Replies: 2 comments 3 replies
-
Not implot author here, but I have done several custom plots by (ab)using the available functionality. I don't think implot can do skewed grid lines. But I think you may get the desired effect like this:
I think there is also a custom draw API that can plot lines and stuff given plot coordinates. Not sure if that can be useful. Be sure to check the implot demos window. Lots of inspiration there! (Completely untested and unverified of course... but maybe it can be done.. :-)) |
Beta Was this translation helpful? Give feedback.
-
Spending some time familiarizing myself with the API, it looks like there could be two approaches for this, and I'm not sure which one is more generalizable to other ideas/tasks (such as polar coordinate plotting, for example).
It would be easy enough for me to experiment with both solutions in my own fork, brute force something, and then go about the rest of the project... however, if there's an opportunity to generalize something into the API that makes ImPlot more powerful, I'd prefer that approach. I would love to hear other thoughts. |
Beta Was this translation helpful? Give feedback.
-
I wanted to see if anyone might have some suggestions on how to approach affine transforms within the ImPlot library. I'd be more than happy to do the legwork and contribute a PR, but I'm still in the beginning stages of learning to navigate the API and learn how things work under the hood.
I am interested in using ImPlot to created a SkewT-LogP diagram, in which the horizontal axis lines/data are skewed by 45 degrees, and the vertical axis is in log10 space. I've written code before that handles this transform by taking an x,y pair and transforms it from data space into the appropriate pixel space. I see some reference to ImPlot having the ability to perform custom transforms on individual axes, but have yet to deduce how to do something like a shearing affine transform (which I believe is what would be needed to make this work).
Any suggestions on a good starting place for this?
Beta Was this translation helpful? Give feedback.
All reactions