1
$\begingroup$

I was exploring this first example of FeatureSpacePlot and it shows some strange behavior. On the left is the documentation window and to the right is the notebook. The same example outputs different results when evaluated in the help window and the notebook window. The b is behind the h on the notebook side (rhs) and is not visible.

What could be an explanation for this?

Thanks for your help in advance. I am using v12.2.0 on Win7-x64.

enter image description here

$\endgroup$
4
  • $\begingroup$ Moreover, any Method produces the picture from the documentation. The same issue with the next example (cats&dogs). $\endgroup$
    – user64494
    Nov 8, 2023 at 17:57
  • $\begingroup$ It looks correct to me. Note that rasterization is platforum/computer dependent. Therefore, you are not using the exact same images than they used in the documentation (you can see subtle differences if you look closely), and that is why the result is slightly different. Still, contextually, it seems correct (h and n are close together, l and i are close together and so on). $\endgroup$
    – Domen
    Nov 8, 2023 at 20:33
  • $\begingroup$ rasterization is platform/computer dependent ... but I am on the same computer evaluating these using the same commands. Why would Alphabet[] get rasterized differently? For the second comment, using Method->"Linear" for both scenarios (docs/notebook) still produces a different result. $\endgroup$
    – Syed
    Nov 9, 2023 at 0:48
  • $\begingroup$ @Syed, sorry, I was not paying attention that you evaluated also the code in the documentation. Nevertheless, please see my answer for the explanation. $\endgroup$
    – Domen
    Nov 9, 2023 at 12:15

1 Answer 1

1
$\begingroup$

The default font size in documentation is different than in your notebook. For example, in my case, it is 13 in the notebook and 12 in the documentation. (You can go to the menu Format > Font... to get these numbers; there is probably a programmatic way to get them, but I can't figure it out now).

To convince you, just rasterize one letter in both of them, and see that the image will be different.

(* Documentation *)
Rasterize["a"] // ImageDimensions
(* {11, 24} *)

(* Notebook *)
Rasterize["a"] // ImageDimensions
(* {12, 26} *)

Therefore, to get the same results in both cases, you have to match both styles.

imgs = Rasterize[Style[#, FontSize -> 12]] & /@ Alphabet[]
FeatureSpacePlot[imgs]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.