If I have a list (not necessarily always with the same number of elements), how do I create specific labels for points with abscissas of elements in the list, under the condition (which I define myself) that some numbers are represented as letters?
Is this in the context of a CL activity, or just in the graphing calculator? Also, is there an upper bound to the size of the list?
My understanding is that, either way, you’ll need to define individual points for each of the elements of your array in order to be able to give them custom labels like you’re looking for (source: comments on Reddit - The heart of the internet ).
I don’t know if it’s possible to create a list of letters in the Desmos graphing calculator. But I know that letters are possible in the point labels (of course!). However, I don’t know how to apply a conditional statement to make the values ​​in the list become letters in the labels.
In the Desmos computation layer, I know I can use pointLabel, and therefore, my intention is to use it in activities. But I haven’t yet figured out the logic for constructing the labels for each element of the list.
This list also doesn’t have a fixed number of elements beforehand, but it’s not huge.
My interest is in using it for base conversion, from decimal to a larger one. In this case, for example in base 16, the digit 10 should be A, the digit 11 should be B, and so on.
The difficulty of defining point labels in the CL is that you have to define each individual point with its own sink. You can use lists to define points in a graph. Although the difficulty here is that you can’t dynamically define letters in a label string, so I had to separate each digit into its own label. Here’s how I’d approach it in the graph. I didn’t take the time make a decimal to hex conversion, which may be easier in CL and then push those lists into the graph. Downside of multiple labels for each is having to play with the text sizes and spacing depending on your graph bounds.
Whoa, that’s a really neat way to do those labels!
I threw something together in a CL activity that lets you enter points into a table, and then conditionally format the labels as decimal or hex (if the value in the third column is either 1 (for decimal) or 2 (for hex)).
@valdel The Graph component in the activity has all of the logic around conditionally defining the point labels, so hopefully that provides a helpful example you can adapt for your use-case! The one limitation is that this is restricted to a total of 9 points (more could be hard-coded in, but this approach doesn’t scale arbitrarily).
Thank you for the efforts each of you put into solving my problem. This forum is extremely helpful. Through a series of ideas, I managed to solve the problem using only the Desmos calculator. Here is a calculator for converting from decimal base to any other base, in which I used letter labels from base 11 to base 36. (Unfortunately, I don’t know who came up with the original idea for the calculator, and I only added points, lists, and text for my own purposes.)
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.