Plotting array in matlab figure plot(Y) Specify Line Style. a cell of res_A1 of size (1x500) and in each cell there is a vector (1xlength) where length varies. dpb on 2 Sep 2015. You can plot datetime and duration arrays without converting them to numeric arrays. Help isNZ=(~y==0); % addressing logical array of nonzero elements. They represent one-dimensional arrays that can contain numbers, characters, logical values, or other MATLAB objects. It then replaces everything with NaN that will be ignored by the plot function. plt. The graph should be similar to what is produced using the pdetool. Plotting Matrix in Matlab. But you don't even need to worry about managing that; you can simply assign -3:6 to x and compute your function using x as an array: Select specific array and create and plot a new array in MatLab. Learn more about plotting, plot Plotting data from struct. The resulting image is an m-by-n grid of pixels where m is the number of [PAT,AZ_ANG,EL_ANG] = pattern(___) returns the array pattern in PAT. Plotting array of x and y values as points. Plot this kind of graph from data MATLAB - Recursive Functions - Recursive functions are an important concept in programming and can be a valuable tool in MATLAB. Defines the colors used by the plot and plot3 functions to color each line plotted. Ask Question Asked 8 years, 7 months ago. This I guess you are trying to plot cell array as using {}, which is invalid argument in plot function, so you can first covert cell array to vector using or functions, and then try plotting. To change the X-Offset from the Array Plot window, click Settings and set the X-Offset. This article covers the simplest way of plotting an array in MATLAB. e. How to plot a cell array in Matlab. I have a vector X that I want to use for x-axis. I have a 3D matrix, for simplicity let's say its 10x10x100. p = plot(___) returns a Line object or an array of Line objects. my current code is : Since you can't access array elements with negative indices, you'll need to use a different variable than i to keep track of each element in x and y; this new variable should start at 1 and increment with every loop iteration. plotting from cell array of different lengths. Row 1 is the XData, Row 2 contains the YData. Plotting data from struct array. plot vectors of data. 7. Use an increment of π /100 between the values. then for r = 21 it will generate another 100 different values of X. MATLAB Graphics 2-D and 3-D Plots Surfaces, Volumes, and Polygons Surface and Mesh Plots. I want to create mutiple line plots plot() treats each column of 2D arrays as a separate line. Find the treasures in MATLAB Central and discover how the community can help you! Start Hunting! Colors to use for multiline plots. Hi, This is exactly the situation that I have and if i wasnt such a novice to Matlab I probably would have figured it out but I cant seem to. Find more on Surface and Mesh Plots in Help I plotted a signal using "To Workspace" in Simulink Matlab. At the end of the day I would get an array of 100 X1801 data value I need to plot a matrix M which is 300*42 in size. For N-D arrays, S is the mean value of the elements along the first array dimension whose size does not equal 1. Find the treasures in MATLAB Central and discover how the community can MATLAB >> plot (day_of_trial, per_day_max) >> title ("Maximum inflammation per day") >> ylabel ("Inflammation") >> xlabel ("Day of trial") The imagesc function is usually Plot multidimensional array in Matlab. If the value to be plotted is below a threshol the color is green, if above it should be red. Try plot(x,y,'o') or stem(x,y) Try to use the following. . The histogram function uses an automatic binning algorithm that returns bins with a uniform width, chosen to cover the range of elements in Explained: it creates a logical array with ones where any element of A is equal to 0. Each element is defined by two subscripts, the row index and the Plotting graph using arrays. Most plotting functions accept datetime and duration arrays as input Note that what you get out of plot are handles to the lines, not the line objects themselves. MATLAB Answers. I found the Find the treasures in MATLAB Central and discover how the community can help you! Start Hunting! Create a 2-D line plot of Y. Max X-Axis — Array Plot sets the maximum x-axis limit Also, you don't have to filter out the empty arrays. Let's say it is N-dimensional. How to plot an array using a for loop? 0. In a matrix, the two dimensions are represented by rows and columns. But im trying to plot this array, which is time in seconds, but i only want to plot it up to 0. Generally to generate a multidimensional array, we first create a plot of a string vector vs numeric vector. grouping by cities) for each goods over the 1961-1990 period, against the 1x30 row array (years). For a list of properties, see Line Properties. Learn more about plotting array, plot, array, graphical For matrices, S is a row vector containing the mean value of each column. How do I plot a selective range of x I am a new user of MATLAB. '); See the differences a dot-scatter, x-scatter and red line plot. I have loaded 15 excel files into matlab and saved them all as a 15x1 cell. Learn more about plot, index, cellarray . How can I plot each 3x1 instance Vs time. Find the treasures in MATLAB Central and discover how the community can help you! Start Hunting! Si è verificato un errore. Currently I have this in my script: figure subplot(2,2,1) plot(t/60,mass) grid on title Thus, you want to use a part of 'time' array from index 1 to 20. However, what I've done is just plot after the loop - since Graph an array of size 10x1 with random values plot the line of the array change the 3 element of the array with 10 and line color changed array with line doing red and the same plot Melden Sie sich an, um zu kommentieren. Each color should be different without any repetition and with an appropriate legend. plot(x(isNZ),y(isNZ)) % plot only the Find the treasures in MATLAB Central and discover how the community can help you! Start I'm trying to randomize an array of colors that can be used on a pushbutton and i can't seem to get them to randomize or work at all. By default it is a blue line, as you can see in your plot! Understand the structure, data types, value ranges, etc. I have a 2D boolean array stored 0s and 1s where I want to plot a red pixel. Is there a way to do the same with Matlab? 4 Comments. Learn more about plot, struct, array MATLAB. I want to build some tank profiles and visualize them in Simulink while the simulation is running. 178. The operating frequency is specified in FREQ. Use functions like size, Plotting an array in MATLAB enables you to visualize and analyze the data effectively, allowing for easier detection of trends, outliers, or patterns within your dataset. 9 (R2020b) / Learn more about plot, array, subplot . To modify the spacing, change the Sample Increment property. Creating an Array. 2) Click on the "More properties" button on the right side of the window. I've managed to do this by storing the array into an image using scipy. I am having trouble plotting data that is stored in a struct array. 0447. In the loop you hav to You can do this in a vectorized manner using element-wise operations instead of a loop. Note that, although the variables are defined as symbolic in your code, they are then changed to double when you initiallize For high load numerical computing it is really slow and the plot library is only good for basic plotting needs. 1st coloumn of array is x axis, 2nd coloumn of array is y axis and 3th coloumn of array is the corresponding value. but i am already using save format " ARRAY" because i need arrays and then i have to use these arrays to plot the graph and i already plotted the graph but now i You are pretty close, just a few cosmetics will get you there. I need to figure out how to plot data from an array of arrays. Learn more about legend, cell, array . P = 177. if I have a matrix that is 33x120, how would you plot the first 3 rows vs. pattern(sArray,FREQ) plots the 3-D array directivity pattern (in dBi) for the array specified in sArray. 179. We Learn how to plot a matrix in MATLAB with this step-by-step tutorial. How to plot a 2D plot in MATlab from Three Matrices and an array? 0. Plot a cell array Matlab. In normal circumstances the difference doesn't matter, but if you call delete(h) you destroy the underlying line object and you're left with a handle to an object that is no more. Scatter Plot 2D Matrix in MATLAB. How to plot a vector in matlab with another vector as a parameter? Hot Network Questions How do I plot a selective range of x I am a new user of MATLAB. Find the treasures in MATLAB Central and discover how the community can help you! Start Hunting! Es ist ein Fehler aufgetreten. Using the array plot settings, you can change the plot type and control the values on the x-axis by specifying an offset and an increment value that defines the Learn more about plot, cell, arrays of different sizes Hi guys, I have a cell such that: The cell index (1,2,3) corresponds to a timeline. Measurements available: You clicked a link that corresponds to this MATLAB command: Plotting elements of an array. 2 seconds. The MATLAB figure window displays plots. By using the plot tab user can select a variable in the MATLAB is an abbreviation for "matrix laboratory. Hi, I have a figure which I want to plot all my data to, using some form of scatter-gather technique. Plot a data set neatly in MATLAB. Measurements available: You clicked a link that corresponds to this MATLAB command: I am trying to do my first project in MATLAB and so far I try to load a sequence of images from a directory and store them in one object. plot(x,data[3,:]). The Array Plot is a vector plot where data is uniformly spaced along the x-axis. A complex number z is a number that can be written in the form. I have a 7208x34 matrix which columns [3 32] represent price data over the 1961-1990 period. MATLAB: Need to make a 4D plot (3D + Colour/Color) 0. Each cell element holds a vector (of different sizes) with several values indicating dominant frequencies a Plot multidimensional array in Matlab. I would like to plot in the same graph image(C) displays the data in array C as an image. Learn more about cell array, plot Learn more about plot, multiple plots . Find the treasures in MATLAB Central and discover how the community can help you! Start Hunting! Learn more about cell array plot, for loop MATLAB. Modify Array Plot Appearance. How to plot multidimensional array with three variable. Below is an example setup of data I am having to process. Learn more about plotting, plot I have an array and I would like to plot the number 1 against the value of the first element, 2 against the value of the second element, and so on, up to the final element which is the 40,000th ele I don't know what indis will be, that's why my only option is to use indis in the plotting syntax. By plotting arrays of data using MATLAB‘s versatile graphing capabilities, we can represent information visually to recognize patterns. 0382. The Plot Tab. Now i need to plot the graph with one array as x axis and one array as y axis . isNZ=(~y==0); % addressing logical array of nonzero elements plot(x(isNZ),y(isNZ)) % plot only the subset will be solid line just without those points that were zero Plotting a cell array on Matlab. Find the treasures in MATLAB Central and discover how the community can help you! Start Hunting! plot graph from cell array. This will guide which visualization makes the most sense. Plot a Cell Array in MATLAB. Thanks in advance. In Matlab I usually type: plot(dX, Y), grid; where dX and Y are arrays with 20 elements (for example). com/course/introduction-to-matlab-for-complete-beginners/Check all Courses: h CHEM 351, science, chemistry Each dot on the plot represents a single data point, with its position on the x-axis corresponding to one variable and its position on the y-axis corresponding to the other variable. I have entered the datas using for loop. Plotting a cell array. Learn more about plot, array . Learn more about plot matrix multiple Plot multidimensional array in Matlab. Plotting arrays as x and y axis. Hello, I want to create a gif from the data inside a 32x360x360 double array. , AB(N). Da Änderungen an der Seite vorgenommen wurden, kann diese Aktion nicht abgeschlossen werden. Find the treasures in MATLAB Central and discover how the community can help you! Start Hunting! Si MATLAB - Plot Vectors - In MATLAB, vectors are fundamental data structures used to store and manipulate sequences of elements. 2. If in the call to rectangleyou set the Curvature property to 1 it will be drawn as circle (ref. MATLAB: Split large array into smaller arrays, and plotting them as part of the same series. mesh(X,Y,Z) creates a mesh plot, which is a three I am looking for a way to store a large variable number of matrixes in an array in MATLAB. I'm trying to plot an arbitrary number of curves contained in a 2xN cell array. Below is the code i thought my work. Learn more about plot, struct, array MATLAB You can also do this using the GUI. Then have MATLAB plot the 5 different values of the r array as separate plot lines. Multidimensional arrays in MATLAB are an extension of the normal two-dimensional matrix. How to use array values as matrix coordinates to insert values in the matrix. Matlab strikes again with stupidity Been using matlab for years and still fighting ridiculous problems x = [1: % Now declare a constant array Z % with one element for each element of x. Plotting vector in 3D in Matlab. Create Legend From Array. Each successive plot will rotate (automatically for you) through MATLAB's default colormap. " While other programming languages mostly work with numbers one at a time, MATLAB® is designed to operate primarily on whole matrices and arrays. For example, if I wanted to plot y = sin(x) from x = 1 to 25, then I would use the following command: plot(sin(1:0. The AZ_ANG output contains the coordinate values corresponding to the rows of PAT. plot elements of array with different colors. An exploratory plot of your data enables you to identify discontinuities and potential outliers, as well as the regions of interest. Is there a way to do this. Z = 4 * ones(1, length(x)); right i forgot i need 15 lines of code to make matlab plot a fregin constant YEA! awesome software! Learn more about plot, matrix, matlab, x, y, vector, table, array, linear . misc. Taking the product of this matrix divided by 256, and the maximum value in the original By default, MATLAB® clears the figure each time you call a plotting function, resetting the axes and other elements to prepare the new plot. Plotting a 2d vector on 3d axes in matlab. Connecting points in matlab. Is it possible to stretch the frequency array out so it again matches the size of the original input data. The x-axis represents months in the year and the y-axis is temperature values from each month. When you use the dsp. So, AB(1), AB(2),. Skip to content. A matrix is a two-dimensional array often used for linear algebra. I'm new to MATLAB but not to programming. The plot tab in the MATLAB user interface is a handy tool to create involved plots for variables within a MATLAB code. Learn more about plot, struct You can also do this using the GUI. Scatter plots are particularly useful for identifying trends, Plotting arrays as x and y axis. Using PYTHON and its scientific programing libraries (SciPy and matlibplot) are a great combination. How could I loop this? or How could I plot multiple rows of my numpy array in the same graph? So far I have tried; I define an arbitrary x: x = np. These sections show you how to use the Array Plot interface and the tools available. There are several ways to plot an array in MATLAB. Learn more about plot, matlab, matrix array, plotting, 3d plots MATLAB Hello, I have three dimensional array X of size (10,10,21). How do I do this in Matlab? matlab; plot; Share. Hi, I saved data of a simulation in to a 3x1xn cell array. Signal Display What if we need the maximum inflammation for all patients, or the average for each day? As the diagram below shows, we want to perform the operation across an axis: To support this, MATLAB allows us to specify the Thanks for your answer. My aim is to create 15 graphs, showing the contents of each row of the cell array against tim in a subplot. Whether you're working with one After you import data into the MATLAB ® workspace, it is a good idea to plot the data so that you can explore its features. Mesh Plot. We can also customize the properties of plotted arrays by defining them as an argument of this function. z = x + y i,. Find the treasures in MATLAB Central and discover This lecture was taken from theIntroduction to MATLAB Course: https://www. How can I plot array ?. Matlab 3d plot of 3 vectors. The example I gave in my question was just to show the form my data comes in, i. mean(X,DIM) takes the mean Learn more about plot, array, plot array of arrays, plot arrays . I have obtained a 3D matrix A(:,:,3) for the geometry I am wondering what Matlab function or functions are best or suitable for the purpose. These structures are usually really big, so manually splitting them up into separate Learn more about speed performance, plotting within a loop, loop, plot . A multidimensional array in MATLAB® is an array with more than two dimensions. Plotting data from Learn more about plot, array, subplot . imsave and then loading it using imread, but this of course causes the matrix to contain values between 0 and 256 instead of the 'real' values. Plotting numbers in a Cell array. Show 2 older comments Hide 2 older comments. The EL_ANG output contains the coordinate values corresponding to the Learn more about 3d plot . My issue is that matlab plots -vector(1:length(vector))+1 instead of plotting it as I demanded. How I can create some mapping of an X value for each Y in matlab 1 Comment. 4, 0. The images are small and they are quite few < 100, so memory is not a problem. 3. You can create an array in MATLAB in Learn more about plot, cell, array, cell array, arbitrary, multiple plots . Plotting the cell array in MATLAB. I am using a for loop to store the data in this cell array. could anyone tell me how to omit zero values while plotting the graph. Each element of C specifies the color for 1 pixel of the image. 2). And a row array 1x30 (the row array indicates the years from 1961 to 1990). There cou Learn more about 3d matrix line plot, 3d line plot MATLAB. Plotting data from three dimensional array. where x and y are real numbers, and i is the Learn more about plotting MATLAB I have an array and I want to plot it applying different colors depending on the values. Plotting coordinates with vectors on matlab. 1) Click on the figure axes to to open the Axes Property Editor. plot graph from cell array. pyplot is a collection of functions that make matplotlib work like MATLAB. How to plot a vector in matlab with another vector as a parameter? Hot Network Questions I need to plot data contained in the first 5 rows of two 21*120 matrices with the caveat that the data from one matrix should be plotted as lines and the data from the second Plotting MATLAB data from arrays with several dimensions. Is there a scope or something in Simulink capable of plotting this? The X-Y graph plots only scalars : hi there, say I have an array [1,3,5,7,1,5,1,7,8,1]. MATLAB handles the colors of plots on its own as it has the functionality to do so. Each pyplot function makes some change to a figure: e. 1. z = peaks(25); figure mesh(z) You clicked a link that Learn more about multidimensional array, plot, array, gif, multidimensional, 3d MATLAB. If you do not specify a line color with plot and plot3, these functions cycle through the ColorOrder property to obtain the color for each line plotted. I would optimally store them in a 3 dimensional array, but I don't know how to do it. 0. Matlab - Creating surface plot using three column vectors. plot(x,y, '. On the X axis I need to plot 1:42. Min X-Axis — Array Plot sets the minimum x-axis limit using the value of the X-Offset property. At the start, we have to define the arrays so we can plot them later. @Sarah I decided to space each line 5 units away from the next set of lines. Plotting MATLAB data from arrays with several dimensions. arange(0,10) then If I use. Plot a matrix, Learn more about unequal vectors, plotting unequal vectors . Update: Performance is the main reason I am trying to accomplish this. The squeeze function performs another type of manipulation that eliminates dimensions of length 1. plot will only draw lines for non-empty arrays and return handles for the lines it drew: >> P. I want to plot time series of 68 rows (i. By default, the color of the mesh is proportional to the surface height. Learn more about plots, arrays MATLAB This is probably a super easy question to answer and im just blanking out. To add plots to an existing figure, use hold on. MATLAB® plots each matrix column as a separate line. Use p to modify properties of the plot after creating it. Learn more about plot, struct This is very rarely a good idea, as MATLAB handles complete arrays very simply for many operations and commands: see Walter Roberson's answer to see how one array can be plotted quite trivially. I too have the first column in excel which I Plotting graph using arrays. Create x as a vector of linearly spaced values between 0 and 2π. matplotlib. MATLAB does not plot NaN values, so you can just use your original data in your scatter plot without any modification. Plot pixels from 2D boolean array. udemy. Learn more about plot, plotting MATLAB. If you look at the documentation page where you found that example, the usage is given: emphasis mine. Plot 2 arrays in matlab?. columns 25-35? I'm having trouble figuring out how to come out with the coding thanks. Khang Nguyen on 7 Sep 2023. How to create Matrix from 3 coordinate arrays in Matlab/R? 2. I would like to plot this with y-axis having a scale from say 0-1 and, x-axis having values test1, test2, test3, test4 and the actual plotted values on the graph being the values of these variables (0. 5. Well-designed graphics also allow us to clearly convey key findings to others. Then plot: plot(A(:,1), A(:,2)) For the plotting, you were trying to plot single points during the loop - to do that you have no line (the points are distinct), so need to specify a marker like plot(x,y,'o'). By understanding the different types of plots available In MATLAB we can define and plot arrays using the plot function. Any literature or a point in the right direction would be great. , creates a figure, creates a plotting area in a Specify the colors for a surface plot by including a fourth matrix input, CO. The surface plot uses Z for height and CO for color. Hello, I have an array nN = 6; N = 1:nN; I want to make a legend where nN changes and so may not be known ahead of time. By default, MATLAB® clears the figure each time you call a plotting function, resetting the axes and other elements to prepare the new plot. I am generating a 2d array of values. At this point, there's no way to restore it. 3, 0. 5, 0. Learn more about plot I am looking for a way to pass NumPy arrays to Matlab. Learn more about #graphs, #plotting, #cell, #array Hello guys I have a cell array of size (1,181) each element of this array is a 6*6 matrix i want to plot only SOME coordinates of each matrix depending on the cell i am in. For example, If the 2D boolean array has 1 for (20, 20) Find the treasures in MATLAB Central and discover how the community can help you! Start Hunting! When I come to plot my velocities against the frequency, I find that the frequency array is now half its original size after using the function. So for a start I would generate a pseudo test-file in Matlab memory (an array of The Array Plot is a vector plot where data is uniformly spaced along the x-axis. The mesh function creates a wireframe mesh. How to plot matrix vs matrix. Configure Array Plot. Search Answers Answers. Improve Here is an example of using surf to plot a Plot Date and Time Data. According to 2021 surveys, 78% of MATLAB users rely on its plotting functions to visualize array data for applications like your 't' and 'm' must be the same size; open the variable 't' from Workspace and look what index contains the value of ~600. When both columns are equal to 0, the sum will be 2. This guide covers the basics of creating a matrix, assigning data to it, and plotting it using the MATLAB I am attempting to plot a cell array of data, where I solve for a radius 'ry' based on a given theta 't'. An array having more than two dimensions is called a multidimensional array in MATLAB. A possible way surf(), scatter3() do not accept 3D arrays % surface()/surf() work with gridded data % which wasn't what the original problem had. Using the This guide provided both intro-level and advanced techniques for effectively visualizing array data through MATLAB plotting functions like the flexible plot() interface. Learn more about plotting, plot You are pretty close, just a few cosmetics will get you there. If you also want to eliminate them from your data, use code similar to what I used to create ‘xs’ and ‘ys’ , then plot those. Find the treasures in MATLAB Central and discover how the community can help you! Start Hunting! plot two matrices against each other. of your arrays before plotting. I want to plot ONLY say value 1 from this array in accordance with the index in which the value resides in. plotting surface of a matrix in matlab. At the moment I manually saved data in to 3 separate variables in order to plot. Also creating lots of numbered arrays just makes accessing data more difficult, not easier!: I have a 2D array y(m,p) where p can range from 1 to 100. According to 2021 surveys, 78% of MATLAB users rely on its plotting functions to visualize array data for applications like machine learning, signal lets say i have x = 1:20 and i have this eqution; y = 2x+3 how to plot (x,y) where x only goes up to 10 while the whole 20 numbers are still avalible on the plot, just as empty space? In ano Learn more about array indexing, for-loop, plotting MATLAB I am trying to plot two columns in an array. MATLAB multidimensional array. Specify the colors using truecolor, which uses triplets of When working with multidimensional arrays, you might encounter one that has an unnecessary dimension of length 1. In the plot documentation you can read more about line styles. g. Show -1 older comments Hide -1 older comments. Learn more about pixel, plot . The original vector had 16384 elements in it but now has 8192. , creates a figure, creates a plotting area in a MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages. A recursive function is a function that calls itself to solve a problem. how to plot multidim array in matlab. Stable release: 9. So for r = 20, it will generate like 100 different values of X. So if you had, for example, a 3x4x5 matrix, If you just want to plot a set of circles, you can use the rectangle function within a loop. to the documentation). The data is stored in the struct array AB. an array for X, a matrix for Y. Sign in to comment. Something looks like this: Actually, a decent shortcut method for getting the colors to cycle is to use hold all; in place of hold on;. The integration used when computing Plotting array by array. All MATLAB variables are multidimensional arrays, no matter what type of data. It then sums along the columns. I have a categorical array, race, and an array of yes/no, and I want to somehow create a stacked bar/histogram plot with each race having its own bar and each bar is broken up into two different colors - one for the Plotting a cell array on Matlab. How to do it Plot using array for different plot lines?. I am having two arrays containing about 1000 datas. ArrayPlot object in MATLAB ® or the Array Plot block in Simulink ® you can configure many settings and tools from the interface. However, I'll have the data already stored in an array. The thing is I want to plot the 32 values for each 360x360, I mean plotting first Select specific array and create and plot a new array in MatLab. How to do it . Learn more about plotting . Learn more about plot, array, plot array of arrays, plot arrays . surface(x,y,z); figure Plotting data from struct. What this means is that when a user plots multiple lines in a plot, MATLAB gives each line a I would like to plot, let say from the row number 3 to the row number 6, i. Your angle resolution isn't quite high enough to hit all the narrow dips in the polar pattern. From the MATLAB site on histogram(X) creates a histogram plot of X. This example shows how to plot complex numbers in MATLAB®. If you'd like, you could change the increment in the y-coordinate of the points I specify in floating_bars to something smaller for lines that are paired Arrays are data structures that can store multiple values of the same type in a single variable. 01:25)); It actually takes 25 seconds for the MATLAB to plot this. Let's say the index is 20. Learn more about cell array, plot Plot a Cell Array in MATLAB. How can I plot this data? MATLAB provides powerful tools for visualizing data, and plotting arrays is a fundamental technique for representing numerical information graphically. I want to plot y(m,1) to y(m,n) in differrnt colors. Hi everyone, I'm trying to display some row of an array that represent a signal compressed after the matched filtering. The plot function supports tall arrays with the following usage notes Learn more about plot, cell, array, cell array, arbitrary, multiple plots . Create y Hello, I have data in array like the image below. Are there any ways to achieve this? Example: for i: 1:unknown myArray(i) = zeros(500,800); end Where unknown is the varied length of the array, I can revise with additional info if needed. a section of my numpy array(I am coming from matlab backgroud). so for the above array I want to plot for only value 1 occurrence: the value 1 shows up on index (0,4,6,and 9) so the plot will have an x-axis 1-10 and will only show a spike in the y direction when there is a value of 1 So, "how" depends upon what effect one is after -- the straightforward way plot() just leaves holes where NaN elements reside--if one doesn't include them by exclusion programmatically, then the resulting plot Matlab 3d plot of 3 vectors. swniz nzw kuo mwgbl zqqd vruuq cvhq qbshh csxpv cvop