1
$\begingroup$

Generate a 3 D list plot using the image data from a binarized size - 200 letter "w" as heights

    ListPlot3D[
Reverse[
ImageData[
Binarize[Rasterize[Style["W", 200]]]]]]

need  to create this plot

Need to create this plot

enter image description here

but the result that I created is mismatching

$\endgroup$
2
  • $\begingroup$ Ratheesh, you may get a better help with your homework assignment if you write precisely why your solution is "mismatching". $\endgroup$
    – yarchik
    Commented Jan 23, 2023 at 9:58
  • $\begingroup$ code giving the output. but, when i check it in the website it shows "the code wrong". this is the link to that page, question number 24.11 wolfram.com/wolfram-u/… $\endgroup$
    – Ratheesh
    Commented Jan 23, 2023 at 16:13

3 Answers 3

2
$\begingroup$

If I understand correctly, it's the Mesh that you want to match. Try this

ListPlot3D[ImageData[Binarize[Rasterize[Style["W", 200]]]], 
 Mesh -> 10]

w

$\endgroup$
3
  • $\begingroup$ thank you for helping out. this code giving the output. but, when i check it in the website it shows "the code wrong". this is the link to that page question number 24.11 wolfram.com/wolfram-u/… $\endgroup$
    – Ratheesh
    Commented Jan 23, 2023 at 16:11
  • $\begingroup$ @Ratheesh sorry, but I have no idea why this happens. $\endgroup$
    – bmf
    Commented Jan 24, 2023 at 2:32
  • $\begingroup$ thank you for your help. by the way I'm creating a repository for questions and answers in GitHub. I'm inviting u to check that github.com/Ratheesh-Babu-S/Wolfram-Mathamatica-tutorial :-) $\endgroup$
    – Ratheesh
    Commented Jan 25, 2023 at 13:15
2
$\begingroup$

It could be that your system is using a different font and thus your letter "W" looks different. You can specify the FontFamily as an Option to Style, see e.g.

ListPlot3D[ImageData[Binarize[Rasterize[Style["W", 200, FontFamily -> "Times"]]]]]

This produces the following plot

enter image description here

$\endgroup$
1
$\begingroup$

Based upon cvgmt's answer to Numbers in love

W =
  RegionProduct[
   DiscretizeGraphics[
    Text[Style["W", FontFamily -> "Times"]], _Text, 
    MaxCellMeasure -> 0.1],
   MeshRegion[{{0}, {3}}, Line[{1, 2}]]];

Graphics3D[{EdgeForm[], FaceForm[MaterialShading[{"Glazed", Red}]], W},
 Background -> GrayLevel[0.5],
 Boxed -> False,
 ViewPoint -> {5, 5, 10},
 ViewVertical -> {0, 1, 0},
 Lighting -> "ThreePoint"]

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.