Mathematica: Plot a vector NOT against the component number

In summary, Mathematica offers the <code>VectorPlot</code> function to plot vectors without using component numbers. This function can be customized using options such as <code>VectorStyle</code> and <code>VectorScale</code>, and labels can be added using the <code>Epilog</code> option. Multiple vectors can be plotted in one plot, and the plot can be saved as an image using the <code>Export</code> function.
  • #1
faradayslaw
51
0
Hi,

I wish to listplot a list object against a scale that is NOT the component number of the vector, but is actually a well defined function of the component number, and I am lost how to do this?

changing "Ticks" didn't help, or I did it wrong, so I am wondering if anyone knows how to do this.

Thanks
 
Physics news on Phys.org
  • #2
Construct your substitute for the "component number" and transpose to put it in position

Example:

mylist = {1, 2, 7, 4};
myf[n_] = n^2;
myscale = Map[myf, Range[Length[mylist]]];
myresult = Transpose[{myscale, mylist}];
ListPlot[myresult, PlotJoined -> True, AxesOrigin -> 0]
 
  • #3
worked well, thanks
 

1. How do I plot a vector in Mathematica without using the component number?

In Mathematica, you can use the VectorPlot function to plot a vector without using the component number. This function takes in the vector field as an argument and automatically plots the corresponding vector at each point in the specified region.

2. Can I customize the appearance of the vector plot in Mathematica?

Yes, you can use various options such as VectorStyle and VectorScale to customize the appearance of the vector plot in Mathematica. These options allow you to change the color, size, and shape of the vectors to better visualize the vector field.

3. How do I add labels to the vector plot in Mathematica?

To add labels to the vector plot in Mathematica, you can use the Epilog option. This allows you to add any graphics or text to the plot, including labels for the axes or vectors.

4. Is it possible to plot multiple vectors in one plot in Mathematica?

Yes, you can use the VectorPlot function to plot multiple vectors in one plot. You can specify the vector fields as a list of functions, and each vector will be plotted with a different color or style for easy differentiation.

5. How can I save the vector plot in Mathematica as an image?

To save the vector plot as an image in Mathematica, you can use the Export function. This allows you to save the plot in various formats, such as JPEG or PNG, which can then be used for presentations or publications.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
764
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
261
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
Back
Top