Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have a plot like this:

Table[Plot[a*x^2/4, {x, 0, 5}, PlotLabel -> "a="  a], {a, 1, 5, 1}]

I want to label the plots as a=1, a=2, ..., but Mathematica labels them as a=, 2a=, ....

How can I solve this problem?

I also have another problem:

DiscretePlot3D[2 x + y, {x, {1, 4, .2}}, {y, {2, 6, .2}}, 
   Filling -> None, PlotMarkers -> {"Sphere", .01}]

Why I can not use plot markers such as *, \[FilledSquare], ... in this plot?

share|improve this question
    
As to the "why" part of the question -- it is interesting that PlotMarkers isn't even mentioned in the More Information section of DiscretePlot3D nor is 3D Plot usage described in the PlotMarkers documentation. The usage DiscretePlot3D example demonstrates "Sphere" and "Point". Clearly inadequately documented. –  Mike Honeychurch Nov 20 '12 at 20:08
1  
Is this your another account mathematica.stackexchange.com/users/1894/soodeh ? To benefit from this site it would be advantageous to register your account. –  Artes Nov 21 '12 at 0:53
    
As Artes says, please consider registering your account . You'll be able to participate better in the community and also be able to login from anywhere and carry forward your points. If the above account is indeed yours, please register your current account and add the login credentials you used for the other one to confirm ownership and flag for moderator attention. –  rm -rf Nov 21 '12 at 1:00
add comment

2 Answers

The PlotLabel needs to be a string, so for instance:

 Table[Plot[a*x^2/4, {x, 0, 5}, PlotLabel -> "a=" ~~ ToString[a]], {a, 1, 5, 1}]
share|improve this answer
    
Thanks a lot. It helped me. –  soodeh Nov 20 '12 at 7:34
add comment
  1. Use StringForm[]:

    Table[Plot[a*x^2/4, {x, 0, 5}, PlotLabel -> StringForm["a=`1`", a]], {a, 1, 5, 1}]
    
  2. You could make a substitution into the plot graphics object to solve the problem:

    DiscretePlot3D[2 x + y, {x, {1, 4, .2}}, {y, {2, 6, .2}}, 
                   Filling -> None, PlotMarkers -> "Point"] /. 
    Point[pts : {__?VectorQ}] :> (Text["\[FilledSquare]", #, {0, -1}] & /@ pts)
    

    3D discrete plot with squares

share|improve this answer
    
Thanks a lot for your helpful answer. –  soodeh Nov 20 '12 at 7:33
    
@J.M. Your trick for DiscretePlot3D is sneaky clever. –  m_goldberg Nov 20 '12 at 15:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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