I asked Notebook Assistant to make a nice plot of the United States population from 2014 to 2023 with population in millions. I'd appreciate help with coding to accomplish this. Notebook Assistant generated code that does not work:
usPopulationData=CountryData["UnitedStates",{"Population",{2014,2023}}];
usPopulationDataM=usPopulationData /. Quantity[v_,"People"]:>Quantity[v/1000000,"People"];
DateListPlot[
usPopulationDataM,
Joined->True,
PlotTheme->"Scientific",
Filling->Axis,
PlotLabel->Style["U.S. Population from 2014 to 2023",Bold,FontColor->DarkBlue,FontSize->16],
Frame->True,
FrameStyle->Directive[FontSize->12,Bold], FrameLabel->{Style["Year",Bold,DarkBlue,12],Style["Population (Millions)",Bold,DarkBlue,12]},
GridLines->Automatic,
GridLinesStyle->Directive[Dashed,Gray],
PlotStyle->Directive[Thick,Red],
ImageSize->Large
]
The biggest problem is that the calculation of usPopulationDataM doesn't work. In fact, usPopulationDataM == usPopulationData returns True. For details about the code and its problems, see attached file NotebookAssitantIssuesGDorfman11jul25.nb .
Attachments: